diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-09-05 11:24:01 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-09-05 11:24:14 -0700 |
commit | 8b43e456886c5b3aaba1ef93195ed888b15de242 (patch) | |
tree | 971277b504081ef9ea170bcb1b26e1bf5e757d9d /bfd/elfxx-x86.h | |
parent | 5eb5f85062a3d43bf449ded1b256d761d487f0d6 (diff) | |
download | gdb-8b43e456886c5b3aaba1ef93195ed888b15de242.zip gdb-8b43e456886c5b3aaba1ef93195ed888b15de242.tar.gz gdb-8b43e456886c5b3aaba1ef93195ed888b15de242.tar.bz2 |
x86-64: Improve GOTPCREL relocation conversion
When GOTPCREL relocation conversion leads to relocation overflow, we
may get a mysterious linker message, like
relocation truncated to fit: R_X86_64_32S against symbol `foo'
This patch changes the linker message to
failed to convert GOTPCREL relocation; relink with --no-relax
bfd/
* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
argument. Don't check relocation overflow. Avoid relocation
overflow if --no-relax is used. Set converted_reloc on symbol
if a GOTPCREL relocation is converted.
(elf_x86_64_relocate_section): Issue a fatal error and suggest
--no-relax if GOTPCREL relocation conversion leads to relocation
overflow.
* elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
ld/
* testsuite/ld-x86-64/pr19609-4e.d: Updated.
* testsuite/ld-x86-64/pr19609-6a.d: Likewise.
Diffstat (limited to 'bfd/elfxx-x86.h')
-rw-r--r-- | bfd/elfxx-x86.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h index 9c0dcbbe..775e025 100644 --- a/bfd/elfxx-x86.h +++ b/bfd/elfxx-x86.h @@ -110,6 +110,11 @@ struct elf_x86_link_hash_entry is only used by x86-64. */ unsigned int needs_copy : 1; + /* TRUE if a symbol with GOTPCREL relocations which have been converted + to R_X86_64_PC32, R_X86_64_32 or R_X86_64_32S. This is only used by + x86-64 for now. */ + unsigned int converted_reloc : 1; + /* Reference count of C/C++ function pointer relocations in read-write section which can be resolved at run-time. */ bfd_signed_vma func_pointer_refcount; |