From 8cf0d2dd210b73dff4a2d63d60c49e42b86565a7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 10 May 2012 03:25:17 +0000 Subject: Check 64-bit relocation addend overflow for x32 bfd/ * elf64-x86-64.c (elf_x86_64_relocate_section): Check addend overflow for R_X86_64_RELATIVE64. gas/ * config/tc-i386.c (tc_gen_reloc): Check x32 addend overflow for BFD_RELOC_64. gas/testsuite/ * gas/i386/ilp32/ilp32.exp: Run reloc64-inval. * gas/i386/ilp32/reloc64.s: Add tests for ".quad". * gas/i386/ilp32/reloc64.d: Updated. * gas/i386/ilp32/reloc64-inval.l: New file. * gas/i386/ilp32/reloc64-inval.s: Likewise. ld/testsuite/ * ld-x86-64/ilp32-11.d: New file. * ld-x86-64/ilp32-11.s: Likewise. * ld-x86-64/x86-64.exp: Run ilp32-11. --- ld/testsuite/ld-x86-64/ilp32-11.d | 3 +++ ld/testsuite/ld-x86-64/ilp32-11.s | 9 +++++++++ ld/testsuite/ld-x86-64/x86-64.exp | 1 + 3 files changed, 13 insertions(+) create mode 100644 ld/testsuite/ld-x86-64/ilp32-11.d create mode 100644 ld/testsuite/ld-x86-64/ilp32-11.s (limited to 'ld/testsuite/ld-x86-64') diff --git a/ld/testsuite/ld-x86-64/ilp32-11.d b/ld/testsuite/ld-x86-64/ilp32-11.d new file mode 100644 index 0000000..7240c58 --- /dev/null +++ b/ld/testsuite/ld-x86-64/ilp32-11.d @@ -0,0 +1,3 @@ +#as: --x32 +#ld: -shared -melf32_x86_64 +#error: .*addend 2147483647 in relocation R_X86_64_64 against symbol `.text' at 0x0 in section `.data.rel.local' is out of range diff --git a/ld/testsuite/ld-x86-64/ilp32-11.s b/ld/testsuite/ld-x86-64/ilp32-11.s new file mode 100644 index 0000000..2c85385 --- /dev/null +++ b/ld/testsuite/ld-x86-64/ilp32-11.s @@ -0,0 +1,9 @@ + .section .data.rel.local,"aw",@progbits + .align 8 +.Ljmp: + .quad func + 0x7fffffff + + .text + .type func, @function +func: + ret diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index 27174d5..e8afbc2 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -253,6 +253,7 @@ run_dump_test "ilp32-7" run_dump_test "ilp32-8" run_dump_test "ilp32-9" run_dump_test "ilp32-10" +run_dump_test "ilp32-11" run_dump_test "ia32-1" run_dump_test "ia32-2" run_dump_test "ia32-3" -- cgit v1.1