diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2013-05-03 15:19:26 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2013-05-03 15:19:26 +0000 |
commit | a347c1bd9be53513f60ed0e5f440c1f5cd78dec4 (patch) | |
tree | 59e450a4e6504dbb590f6cac28d5545387ad811b /ld/emultempl | |
parent | b0d2b7b6eae7b7f4fbfd1695d4d2f1b45198d597 (diff) | |
download | binutils-redhat-a347c1bd9be53513f60ed0e5f440c1f5cd78dec4.tar.gz |
gold/
PR ld/15365
* layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
ld/
PR ld/15365
* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
Restrict __ehdr_start's export class to no less than STV_HIDDEN.
ld/testsuite/
PR ld/15365
* ld-elf/ehdr_start.d: Expect __ehdr_start to be STB_LOCAL.
* ld-mips-elf/ehdr_start-1.nd: New test.
* ld-mips-elf/ehdr_start-2.nd: New test.
* ld-mips-elf/ehdr_start-1.ld: New test linker script.
* ld-mips-elf/ehdr_start-2.ld: New test linker script.
* ld-mips-elf/ehdr_start-new.s: New test source.
* ld-mips-elf/ehdr_start-o32.s: New test source.
* ld-mips-elf/mips-elf.exp: Run the new tests.
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/elf32.em | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 251c511082..581d9db897 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -1487,6 +1487,13 @@ gld${EMULATION_NAME}_before_allocation (void) { _bfd_elf_tls_setup (link_info.output_bfd, &link_info); + /* Make __ehdr_start hidden if it has been referenced, to + prevent the symbol from being dynamic. */ + if (!bfd_elf_record_link_assignment (link_info.output_bfd, &link_info, + "__ehdr_start", TRUE, TRUE)) + einfo ("%P%F: failed to record assignment to %s: %E\n", + "__ehdr_start"); + /* If we are going to make any variable assignments, we need to let the ELF backend know about them in case the variables are referred to by dynamic objects. */ |