From: H.J. Lu Date: Tue, 5 Sep 2017 20:41:18 +0000 (-0700) Subject: x86-64: Properly set converted_reloc X-Git-Tag: users/gbenson/thread_db-test/2017-11-22~1019 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc089072135ec2e30337879b1f6147b77c77b341;p=thirdparty%2Fbinutils-gdb.git x86-64: Properly set converted_reloc Linker now generates failed to convert GOTPCREL relocation; relink with --no-relax for more cases. bfd/ * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set converted_reloc. ld/ * testsuite/ld-x86-64/pr19609-5d.d: Updated. * testsuite/ld-x86-64/pr19609-7a.d: Likewise. * testsuite/ld-x86-64/pr19609-7c.d: Likewise. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 551891d4023..7e98b61c030 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2017-09-05 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set + converted_reloc. + 2017-09-05 H.J. Lu * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index ddbf1330e4d..bb471911a93 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1597,10 +1597,10 @@ elf_x86_64_convert_load_reloc (bfd *abfd, if (no_overflow) return TRUE; +convert: if (h != NULL) ((struct elf_x86_link_hash_entry *) h)->converted_reloc = 1; -convert: if (opcode == 0xff) { /* We have "call/jmp *foo@GOTPCREL(%rip)". */ diff --git a/ld/ChangeLog b/ld/ChangeLog index 983c471f7c7..73137958480 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2017-09-05 H.J. Lu + + * testsuite/ld-x86-64/pr19609-5d.d: Updated. + * testsuite/ld-x86-64/pr19609-7a.d: Likewise. + * testsuite/ld-x86-64/pr19609-7c.d: Likewise. + 2017-09-05 H.J. Lu * testsuite/ld-x86-64/pr19609-4e.d: Updated. diff --git a/ld/testsuite/ld-x86-64/pr19609-5d.d b/ld/testsuite/ld-x86-64/pr19609-5d.d index 959c63e3d0d..608c97bd6b9 100644 --- a/ld/testsuite/ld-x86-64/pr19609-5d.d +++ b/ld/testsuite/ld-x86-64/pr19609-5d.d @@ -1,4 +1,4 @@ #source: pr19609-5.s #as: --64 -mrelax-relocations=yes #ld: -melf_x86_64 -Ttext=0x80000000 -#error: .*relocation truncated to fit: R_X86_64_PC32 .* +#error: failed to convert GOTPCREL relocation; relink with --no-relax diff --git a/ld/testsuite/ld-x86-64/pr19609-7a.d b/ld/testsuite/ld-x86-64/pr19609-7a.d index d9605728147..015a6ffd0a7 100644 --- a/ld/testsuite/ld-x86-64/pr19609-7a.d +++ b/ld/testsuite/ld-x86-64/pr19609-7a.d @@ -1,4 +1,4 @@ #source: pr19609-7.s #as: --64 -mrelax-relocations=yes #ld: -melf_x86_64 -Ttext=0x80000000 -#error: .*relocation truncated to fit: R_X86_64_PC32 .* +#error: failed to convert GOTPCREL relocation; relink with --no-relax diff --git a/ld/testsuite/ld-x86-64/pr19609-7c.d b/ld/testsuite/ld-x86-64/pr19609-7c.d index 8bd919a8e45..ff600498d4f 100644 --- a/ld/testsuite/ld-x86-64/pr19609-7c.d +++ b/ld/testsuite/ld-x86-64/pr19609-7c.d @@ -1,4 +1,4 @@ #source: pr19609-7.s #as: --x32 -mrelax-relocations=yes #ld: -melf32_x86_64 -Ttext=0x80000000 -#error: .*relocation truncated to fit: R_X86_64_PC32 .* +#error: failed to convert GOTPCREL relocation; relink with --no-relax