From 4c10bbaa0912742322f10d9d5bb630ba4e15dfa7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 15 Mar 2016 11:07:06 -0700 Subject: 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. --- include/ChangeLog | 5 +++++ include/bfdlink.h | 3 +++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index 7e01b27..3523a27 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2016-03-15 H.J. Lu + + PR ld/19807 + * bfdlink.h (bfd_link_info): Add no_reloc_overflow_check. + 2016-03-08 Cupertino Miranda Andrew Burgess diff --git a/include/bfdlink.h b/include/bfdlink.h index eeea6ef..a285f6d 100644 --- a/include/bfdlink.h +++ b/include/bfdlink.h @@ -446,6 +446,9 @@ struct bfd_link_info /* TRUE if generation of .interp/PT_INTERP should be suppressed. */ unsigned int nointerp: 1; + /* TRUE if we shouldn't check relocation overflow. */ + unsigned int no_reloc_overflow_check: 1; + /* TRUE if generate a 1-byte NOP as suffix for x86 call instruction. */ unsigned int call_nop_as_suffix : 1; -- cgit v1.1