diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2011-08-01 23:04:23 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2011-08-01 23:04:23 +0000 |
commit | d7921315bafbc6419613771c6ad075e3cf160a0e (patch) | |
tree | 6584835bb8a8d456e85f2b491657a2934aa16032 /gas/testsuite | |
parent | c3f7b0e5a192ae55613bed418690637a3ebbc2c5 (diff) | |
download | fsf-binutils-gdb-d7921315bafbc6419613771c6ad075e3cf160a0e.zip fsf-binutils-gdb-d7921315bafbc6419613771c6ad075e3cf160a0e.tar.gz fsf-binutils-gdb-d7921315bafbc6419613771c6ad075e3cf160a0e.tar.bz2 |
Check R_X86_64_32 overflow and allow R_X86_64_64 for x32.
bfd/
2011-08-01 H.J. Lu <hongjiu.lu@intel.com>
PR ld/13048
* archures.c (bfd_mach_i386_intel_syntax): New.
(bfd_mach_i386_i8086): Updated.
(bfd_mach_i386_i386): Likewise.
(bfd_mach_x86_64): Likewise.
(bfd_mach_x64_32): Likewise.
(bfd_mach_i386_i386_intel_syntax): Likewise.
(bfd_mach_x86_64_intel_syntax): Likewise.
(bfd_mach_x64_32_intel_syntax): Likewise.
(bfd_mach_l1om): Likewise.
(bfd_mach_l1om_intel_syntax): Likewise.
(bfd_mach_k1om): Likewise.
(bfd_mach_k1om_intel_syntax): Likewise.
* bfd-in2.h: Regenerated.
* cpu-i386.c (bfd_i386_compatible): Check mach instead of
bits_per_address.
(bfd_x64_32_arch_intel_syntax): Set bits_per_address to 64.
(bfd_x64_32_arch): Likewise.
* elf64-x86-64.c: Include "libiberty.h".
(x86_64_elf_howto_table): Append x32 R_X86_64_32.
(elf_x86_64_rtype_to_howto): Support x32 R_X86_64_32.
(elf_x86_64_reloc_type_lookup): Likewise.
(elf_x86_64_reloc_name_lookup): Likewise.
(elf_x86_64_relocate_section): Likewise.
(elf_x86_64_check_relocs): Allow R_X86_64_64 relocations for x32.
gas/
2011-08-01 H.J. Lu <hongjiu.lu@intel.com>
PR ld/13048
* config/tc-i386.c (handle_quad): Removed.
(md_pseudo_table): Remove "quad".
(tc_gen_reloc): Don't check BFD_RELOC_64 for disallow_64bit_reloc.
(x86_dwarf2_addr_size): New.
* config/tc-i386.h (x86_dwarf2_addr_size): New.
(DWARF2_ADDR_SIZE): Likewise.
gas/testsuite/
2011-08-01 H.J. Lu <hongjiu.lu@intel.com>
PR ld/13048
* gas/i386/ilp32/ilp32.exp: Don't run inval.
* gas/i386/ilp32/inval.l: Removed.
* gas/i386/ilp32/inval.s: Likewise.
* gas/i386/ilp32/quad.d: Expect R_X86_64_64 instead of
R_X86_64_32.
* gas/i386/ilp32/x86-64-pcrel.s: Add tests for movabs.
* gas/i386/ilp32/x86-64-pcrel.d: Updated.
ld/testsuite/
2011-08-01 H.J. Lu <hongjiu.lu@intel.com>
PR ld/13048
* ld-x86-64/ilp32-6.d: New.
* ld-x86-64/ilp32-6.s: Likewise.
* ld-x86-64/ilp32-7.d: Likewise.
* ld-x86-64/ilp32-7.s: Likewise.
* ld-x86-64/ilp32-8.d: Likewise.
* ld-x86-64/ilp32-8.s: Likewise.
* ld-x86-64/ilp32-9.d: Likewise.
* ld-x86-64/ilp32-9.s: Likewise.
* ld-x86-64/x86-64.exp: Run ilp32-6, ilp32-7, ilp32-8 and ilp32-9.
opcodes/
2011-08-01 H.J. Lu <hongjiu.lu@intel.com>
PR ld/13048
* i386-dis.c (print_insn): Optimize info->mach check.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/ChangeLog | 14 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/ilp32/ilp32.exp | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/ilp32/inval.l | 23 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/ilp32/inval.s | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/ilp32/quad.d | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/ilp32/x86-64-pcrel.d | 20 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/ilp32/x86-64-pcrel.s | 2 |
7 files changed, 32 insertions, 44 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 063f899..28a549f 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,5 +1,19 @@ 2011-08-01 H.J. Lu <hongjiu.lu@intel.com> + PR ld/13048 + * gas/i386/ilp32/ilp32.exp: Don't run inval. + + * gas/i386/ilp32/inval.l: Removed. + * gas/i386/ilp32/inval.s: Likewise. + + * gas/i386/ilp32/quad.d: Expect R_X86_64_64 instead of + R_X86_64_32. + + * gas/i386/ilp32/x86-64-pcrel.s: Add tests for movabs. + * gas/i386/ilp32/x86-64-pcrel.d: Updated. + +2011-08-01 H.J. Lu <hongjiu.lu@intel.com> + PR gas/13046 * gas/i386/x86-64-branch.s: Add tests for direct branch. * gas/i386/x86-64-branch.d: Updated. diff --git a/gas/testsuite/gas/i386/ilp32/ilp32.exp b/gas/testsuite/gas/i386/ilp32/ilp32.exp index 7145fad..de43bf2 100644 --- a/gas/testsuite/gas/i386/ilp32/ilp32.exp +++ b/gas/testsuite/gas/i386/ilp32/ilp32.exp @@ -25,7 +25,6 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check] && } } - run_list_test "inval" "-al" run_list_test "reloc64" "--defsym _bad_=1" set ASFLAGS "$old_ASFLAGS" diff --git a/gas/testsuite/gas/i386/ilp32/inval.l b/gas/testsuite/gas/i386/ilp32/inval.l deleted file mode 100644 index d037bae..0000000 --- a/gas/testsuite/gas/i386/ilp32/inval.l +++ /dev/null @@ -1,23 +0,0 @@ -.*: Assembler messages: -.*:3: Error: .* -.*:4: Error: .* -.*:5: Error: .* -.*:6: Error: .* -GAS LISTING .* - - -[ ]*1[ ]+\.text -[ ]*2[ ]+\# All the following should be illegal for x32 -[ ]*3[ ]+\?\?\?\? 48A10000 movabs xxx,%rax -[ ]*3[ ]+00000000 -[ ]*3[ ]+0000 -[ ]*4[ ]+\?\?\?\? 48A10000 movabs foo,%rax -[ ]*4[ ]+00000000 -[ ]*4[ ]+0000 -[ ]*5[ ]+\?\?\?\? 48A10000 movabsq xxx,%rax -[ ]*5[ ]+00000000 -[ ]*5[ ]+0000 -[ ]*6[ ]+\?\?\?\? 48A10000 movabsq foo,%rax -\*\*\*\* Error:cannot represent relocation type BFD_RELOC_[ ]*64[ ]+in x32 mode -[ ]*6[ ]+00000000 -[ ]*6[ ]+0000 diff --git a/gas/testsuite/gas/i386/ilp32/inval.s b/gas/testsuite/gas/i386/ilp32/inval.s deleted file mode 100644 index f117ca0..0000000 --- a/gas/testsuite/gas/i386/ilp32/inval.s +++ /dev/null @@ -1,6 +0,0 @@ - .text -# All the following should be illegal for x32 - movabs xxx,%rax - movabs foo,%rax - movabsq xxx,%rax - movabsq foo,%rax diff --git a/gas/testsuite/gas/i386/ilp32/quad.d b/gas/testsuite/gas/i386/ilp32/quad.d index 6f8a6c6..f337bae 100644 --- a/gas/testsuite/gas/i386/ilp32/quad.d +++ b/gas/testsuite/gas/i386/ilp32/quad.d @@ -1,14 +1,14 @@ #objdump: -sr -#name: xquad +#name: x86-64 (ILP32) quad .*: +file format .* RELOCATION RECORDS FOR \[.data\]: OFFSET +TYPE +VALUE -0+ R_X86_64_32 +foo -0+10 R_X86_64_32 +bar -0+20 R_X86_64_32 +foo -0+30 R_X86_64_32 +bar +0+ R_X86_64_64 +foo +0+10 R_X86_64_64 +bar +0+20 R_X86_64_64 +foo +0+30 R_X86_64_64 +bar Contents of section .data: diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-pcrel.d b/gas/testsuite/gas/i386/ilp32/x86-64-pcrel.d index decbf58..6d11381 100644 --- a/gas/testsuite/gas/i386/ilp32/x86-64-pcrel.d +++ b/gas/testsuite/gas/i386/ilp32/x86-64-pcrel.d @@ -5,13 +5,15 @@ Disassembly of section .text: -0+000 <_start>: -[ ]*[0-9a-f]+:[ ]+b0 00[ ]+movb?[ ]+\$(0x)?0,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trn +[ ]*[a-f0-9]+: 66 b8 00 00 mov \$0x0,%ax 16: R_X86_64_16 xtrn +[ ]*[a-f0-9]+: b8 00 00 00 00 mov \$0x0,%eax 19: R_X86_64_32 xtrn +[ ]*[a-f0-9]+: 48 c7 c0 00 00 00 00 mov \$0x0,%rax 20: R_X86_64_32S xtrn +[ ]*[a-f0-9]+: 48 b8 00 00 00 00 00 00 00 00 movabs \$0x0,%rax 26: R_X86_64_64 xtrn +[ ]*[a-f0-9]+: 48 a1 00 00 00 00 00 00 00 00 movabs 0x0,%rax 30: R_X86_64_64 xtrn #pass diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-pcrel.s b/gas/testsuite/gas/i386/ilp32/x86-64-pcrel.s index 0fbee46..f8392ee 100644 --- a/gas/testsuite/gas/i386/ilp32/x86-64-pcrel.s +++ b/gas/testsuite/gas/i386/ilp32/x86-64-pcrel.s @@ -9,3 +9,5 @@ _start: movw $xtrn, %ax movl $xtrn, %eax movq $xtrn, %rax + movabs $xtrn, %rax + movabsq xtrn, %rax |