Add -z noreloc-overflow option to x86-64 ld
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 15 Mar 2016 18:07:06 +0000 (11:07 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 15 Mar 2016 18:07:54 +0000 (11:07 -0700)
commit4c10bbaa0912742322f10d9d5bb630ba4e15dfa7
tree4da4677185d00b755043d03f5781dd316029926c
parent1eb2dbb8d73c344e199fd04531ec3f649e2835b2
Add -z noreloc-overflow option to x86-64 ld

Add -z noreloc-overflow command-line option to the x86-64 ELF linker to
disable relocation overflow check.  This can be used to avoid relocation
overflow check if there will be no dynamic relocation overflow at
run-time.

bfd/

PR ld/19807
* elf64-x86-64.c (elf_x86_64_relocate_section): Check
no_reloc_overflow_check to diable R_X86_64_32/R_X86_64_32S
relocation overflow check.

include/

PR ld/19807
* bfdlink.h (bfd_link_info): Add no_reloc_overflow_check.

ld/

PR ld/19807
* Makefile.am (ELF_X86_DEPS): Add
$(srcdir)/emulparams/reloc_overflow.sh.
* Makefile.in: Regenerated.
* NEWS: Mention -z noreloc-overflow.
* ld.texinfo: Document -z noreloc-overflow.
* emulparams/elf32_x86_64.sh: Source
${srcdir}/emulparams/reloc_overflow.sh.
* emulparams/elf_x86_64.sh: Likewise.
* emulparams/reloc_overflow.sh: New file.
* testsuite/ld-x86-64/pr19807-1.s: New file.
* testsuite/ld-x86-64/pr19807-1a.d: Likewise.
* testsuite/ld-x86-64/pr19807-1b.d: Likewise.
* testsuite/ld-x86-64/pr19807-2.s: Likewise.
* testsuite/ld-x86-64/pr19807-2a.d: Likewise.
* testsuite/ld-x86-64/pr19807-2b.d: Likewise.
* testsuite/ld-x86-64/pr19807-2c.d: Likewise.
* testsuite/ld-x86-64/pr19807-2d.d: Likewise.
* testsuite/ld-x86-64/pr19807-2e.d: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run PR ld/19807 tests.
22 files changed:
bfd/ChangeLog
bfd/elf64-x86-64.c
include/ChangeLog
include/bfdlink.h
ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/NEWS
ld/emulparams/elf32_x86_64.sh
ld/emulparams/elf_x86_64.sh
ld/emulparams/reloc_overflow.sh [new file with mode: 0644]
ld/ld.texinfo
ld/testsuite/ld-x86-64/pr19807-1.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr19807-1a.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr19807-1b.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr19807-2.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr19807-2a.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr19807-2b.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr19807-2c.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr19807-2d.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr19807-2e.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp