mirror of https://github.com/yasm/yasm.git
GAS output. The way we were generating relocations before would make common+global symbol usage generate a relocation against the symbol but figure in the symbol's value into the relocation addend. * expr.h (yasm_symrec_relocate_action): New enum, so that: (yasm_expr_extract_symrec): can conditionalize replacing the symbol with its value based on whether the symbol is only local (e.g. not declared global, etc). * expr.c (yasm_expr_extract_symrec): Update implementation. * xdf-objfmt.c, coff-objfmt.c: Update to use new enum constants. * elf-objfmt.c (elf_objfmt_output_expr): Only relocate against section if symbol is only local, and change call to yasm_expr_extract_symrec to only add in symbol value if symbol is only local. * stabs-elf.hex, elftest.hex: Update for changes. * elf_gas64_reloc.asm: New test. svn path=/trunk/yasm/; revision=13110.5.0rc2
parent
b4d6598630
commit
36ff44b3ac
12 changed files with 108 additions and 30 deletions
@ -0,0 +1,8 @@ |
||||
# $Id: Makefile.inc 1168 2004-10-31 01:07:52Z peter $ |
||||
|
||||
TESTS += modules/objfmts/elf/tests/gas64/elf_gas64_test.sh |
||||
|
||||
EXTRA_DIST += modules/objfmts/elf/tests/gas64/elf_gas64_test.sh |
||||
EXTRA_DIST += modules/objfmts/elf/tests/amd64/elf_gas64_reloc.asm |
||||
EXTRA_DIST += modules/objfmts/elf/tests/amd64/elf_gas64_reloc.hex |
||||
EXTRA_DIST += modules/objfmts/elf/tests/amd64/elf_gas64_reloc.errwarn |
@ -0,0 +1,37 @@ |
||||
.comm _ZEROVAR, 32, 16 |
||||
.comm _VAR, 16, 16 |
||||
.data |
||||
.org 0 |
||||
_ZEROVAR: |
||||
.org 0xa0 |
||||
.globl _VAR |
||||
.type _VAR, @object |
||||
.size _VAR, 16 |
||||
_VAR: |
||||
.4byte 0 |
||||
.4byte 0 |
||||
.4byte 0 |
||||
.4byte 0 |
||||
.org 0xc0 |
||||
_VAR2: |
||||
.org 0xe0 |
||||
.globl _VAR3 |
||||
_VAR3: |
||||
|
||||
.text |
||||
movq $0, %rax |
||||
movq _VAR, %rax |
||||
movq %rax, _VAR(%rip) |
||||
movq _VAR+8(%rip), %rcx |
||||
movlpd _VAR(%rip), %xmm1 |
||||
|
||||
movq _VAR2, %rax |
||||
movq %rax, _VAR2(%rip) |
||||
movq _VAR2+8(%rip), %rcx |
||||
movlpd _VAR2(%rip), %xmm1 |
||||
|
||||
movq _VAR3, %rax |
||||
movq %rax, _VAR3(%rip) |
||||
movq _VAR3+8(%rip), %rcx |
||||
movlpd _VAR3(%rip), %xmm1 |
||||
|
@ -0,0 +1,4 @@ |
||||
#! /bin/sh |
||||
# $Id: elf_amd64_test.sh 1137 2004-09-04 01:24:57Z peter $ |
||||
${srcdir}/out_test.sh elf_gas64_test modules/objfmts/elf/tests/gas64 "GAS elf-amd64 objfmt" "-f elf64 -p gas" ".o" |
||||
exit $? |
Loading…
Reference in new issue