mirror of https://github.com/yasm/yasm.git
Tag:
Branch:
Tree:
master
0.2
0.3
0.4
0.5
0.5.0
0.5.0rc2
0.6
0.6.0
0.6.1
0.6.2
0.7
0.7.0
0.7.1
0.7.2
0.8
0.8.0
1.0
1.0.0
1.0.1
1.1
1.1.0
master
multiarch
v0.1.0
v0.2.0
v0.2.1
v0.2.2
v0.3.0
v0.4.0
v0.5.0
v0.5.0rc1
v0.5.0rc2
v0.6.0
v0.6.1
v0.6.2
v0.7.0
v0.7.1
v0.7.2
v0.8.0
v1.0.0
v1.0.1
v1.1.0
v1.2.0
v1.3.0
${ noResults }
1 Commits (master)
Author | SHA1 | Message | Date |
---|---|---|---|
Peter Johnson | 0cdfa29994 |
Add a feature and fix a long-standing bug in Win64 output. The new feature
is support for cross-section relative symbol references using "sym-$". This generates a 32-bit relative relocation similar to those used for cross-section jumps and calls. The bugfix is that in Win64 output, RIP-relative relocations do something special when there is an immediate value (or anything else) between the value being relocated and the next instruction. E.g. "shl dword [sym wrt rip], 5" needs to generate a REL32_1 relocation thanks to the immediate byte following the RIP-relative value. * symrec.c (sym_type): add SYM_CURPOS to track labels representing the current assembly position (e.g. $ in NASM, . in GAS). (yasm_symtab_define_curpos): New function to create symbols of this type. (yasm_symrec_is_curpos): Check to see if symbol is SYM_CURPOS type. (yasm_symrec_get_label, yasm_symrec_print): Update to handle SYM_CURPOS. * symrec.h (yasm_symtab_define_curpos): Prototype. (yasm_symrec_is_curpos): Prototype. * gas-bison.y: Use yasm_symtab_define_curpos when defining '.'. * nasm-bison.y: Use yasm_symtab_define_curpos when defining '$'. * value.c (yasm_value_finalize_expr): Look for cross-section "sym-SYM_CURPOS" combinations and generate curpos-relative value if found. * coretype.h (yasm_value): Add ip_rel member to designate that curpos_rel is set due to the value being IP-relative (rather than sym-curpos). * value.h (yasm_value_initialize, yasm_value_init_sym): Initialize ip_rel. * x86expr.c (yasm_x86__check_ea): Set ip_rel in addition to curpos_rel if detected WRT rip. * x86bc.c (x86_bc_insn_tobytes): Use ip_rel instead of curpos_rel when adjusting for RIP-relative. * coff-objfmt.c (coff_objfmt_output_value): Properly adjust output and generate correct relocations for both curpos_rel and ip_rel. This includes new generation of REL32_1, REL32_2, etc relocations. * symrec.c, symrec.h (yasm_symtab_define_label2): Delete. * coff-objfmt.c (stabs_debgfmt_generate_sections): Change to use yasm_symtab_define_label() instead. * win32-curpos.asm, win64-curpos.asm, curpos.asm, curpos-err.asm, elf_gas64_curpos.asm: New tests for above. svn path=/trunk/yasm/; revision=1423 |
19 years ago |