x86-64: Improve GOTPCREL relocation conversion
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 5 Sep 2017 18:24:01 +0000 (11:24 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 5 Sep 2017 18:24:14 +0000 (11:24 -0700)
commit8b43e456886c5b3aaba1ef93195ed888b15de242
tree971277b504081ef9ea170bcb1b26e1bf5e757d9d
parent5eb5f85062a3d43bf449ded1b256d761d487f0d6
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.
bfd/ChangeLog
bfd/elf64-x86-64.c
bfd/elfxx-x86.h
ld/ChangeLog
ld/testsuite/ld-x86-64/pr19609-4e.d
ld/testsuite/ld-x86-64/pr19609-6a.d
This page took 0.055705 seconds and 4 git commands to generate.