From d5b2f6115160a907cc7fb5d8b6cdc42d76fb1ae9 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 1 Apr 2005 07:46:07 +0000 Subject: [PATCH] gas/ 2005-04-01 Jan Beulich * config/tc-i386.c (md_apply_fix3): Also handle BFD_RELOC_X86_64_32S. (tc_gen_reloc): Handle BFD_RELOC_X86_64_32S in the default case. gas/testsuite/ 2005-04-01 Jan Beulich * gas/i386/x86-64-pcrel.[sd]: New. * gas/i386/i386.exp: Run new test. --- gas/ChangeLog | 5 +++++ gas/config/tc-i386.c | 2 +- gas/testsuite/ChangeLog | 4 ++++ gas/testsuite/gas/i386/i386.exp | 1 + gas/testsuite/gas/i386/x86-64-pcrel.d | 13 +++++++++++++ gas/testsuite/gas/i386/x86-64-pcrel.s | 8 ++++++++ 6 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 gas/testsuite/gas/i386/x86-64-pcrel.d create mode 100644 gas/testsuite/gas/i386/x86-64-pcrel.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 237da3710..47b9f573e 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2005-04-01 Jan Beulich + + * config/tc-i386.c (md_apply_fix3): Also handle BFD_RELOC_X86_64_32S. + (tc_gen_reloc): Handle BFD_RELOC_X86_64_32S in the default case. + 2005-03-30 Julian Brown * config/tc-arm.c (arm_adjust_symtab): Rename diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 220e99cd7..80f430e4b 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -4798,6 +4798,7 @@ md_apply_fix3 (fixP, valP, seg) break; case BFD_RELOC_32: + case BFD_RELOC_X86_64_32S: fixP->fx_r_type = BFD_RELOC_32_PCREL; break; case BFD_RELOC_16: @@ -5361,7 +5362,6 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_386_TLS_GOTIE: case BFD_RELOC_386_TLS_LE_32: case BFD_RELOC_386_TLS_LE: - case BFD_RELOC_X86_64_32S: case BFD_RELOC_X86_64_TLSGD: case BFD_RELOC_X86_64_TLSLD: case BFD_RELOC_X86_64_DTPOFF32: diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 2e41c3376..239bb8c6f 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-04-01 Jan Beulich + * gas/i386/x86-64-pcrel.[sd]: New. + * gas/i386/i386.exp: Run new test. + 2005-03-30 Julian Brown * gas/arm/mapping.d: Update expected output due to mapping symbols diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index 24ca1a6d7..8c455677d 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -120,6 +120,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t run_dump_test "x86_64" run_dump_test "x86-64-addr32" run_dump_test "x86-64-opcode" + run_dump_test "x86-64-pcrel" run_dump_test "x86-64-rip" run_list_test "x86-64-inval" "-al" run_list_test "x86-64-segment" "-al" diff --git a/gas/testsuite/gas/i386/x86-64-pcrel.d b/gas/testsuite/gas/i386/x86-64-pcrel.d new file mode 100644 index 000000000..f33f6cd68 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-pcrel.d @@ -0,0 +1,13 @@ +#objdump: -drw +#name: x86-64 pcrel + +.*: +file format elf64-x86-64 + +Disassembly of section .text: + +0+000 <_start>: +[ ]*[0-9a-f]+:[ ]+b0 00[ ]+movb?[ ]+\$(0x)?0,%al[ ]*[0-9a-f]+:[ ]+R_X86_64_PC8[ ]+xtrn\+(0x)?1 +[ ]*[0-9a-f]+:[ ]+66 b8 00 00[ ]+movw?[ ]+\$(0x)?0,%ax[ ]*[0-9a-f]+:[ ]+R_X86_64_PC16[ ]+xtrn\+(0x)?2 +[ ]*[0-9a-f]+:[ ]+b8 00 00 00 00[ ]+movl?[ ]+\$(0x)?0,%eax[ ]*[0-9a-f]+:[ ]+R_X86_64_PC32[ ]+xtrn\+(0x)?1 +[ ]*[0-9a-f]+:[ ]+48 c7 c0 00 00 00 00[ ]+movq?[ ]+\$(0x)?0,%rax[ ]*[0-9a-f]+:[ ]+R_X86_64_PC32[ ]+xtrn\+(0x)?3 +#pass diff --git a/gas/testsuite/gas/i386/x86-64-pcrel.s b/gas/testsuite/gas/i386/x86-64-pcrel.s new file mode 100644 index 000000000..bdd40dc4c --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-pcrel.s @@ -0,0 +1,8 @@ + .text +_start: + movb $(xtrn - .), %al + movw $(xtrn - .), %ax + movl $(xtrn - .), %eax + movq $(xtrn - .), %rax + + .p2align 4,0 -- 2.11.4.GIT