diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-12-25 23:10:18 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-12-25 23:10:18 +0000 |
commit | fb151dde0a21b64eb8979c581fb965e43f70fb4f (patch) | |
tree | 48590e75e4477b4108c0609e1db073de4f22b9ea /gnu | |
parent | cf07e8a103925a4108a8140a679158515053aed5 (diff) |
Don't generate PLT entries for symbols defined in a regular object for
-static -pie.
On sparc64, avoid generating GLOB_DAT relocs and convert certain absolute
relocs into RELATIVE relocs when we can for -static -pie.
With this change we don't need -Wl,-Bsymbolic anymore when building -static
-pie binaries.
ok millert@, kurt@
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/binutils/bfd/elf64-sparc.c | 5 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/bfd/elflink.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/gnu/usr.bin/binutils/bfd/elf64-sparc.c b/gnu/usr.bin/binutils/bfd/elf64-sparc.c index 1dd92ed667c..7704bb71012 100644 --- a/gnu/usr.bin/binutils/bfd/elf64-sparc.c +++ b/gnu/usr.bin/binutils/bfd/elf64-sparc.c @@ -2222,7 +2222,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* h->dynindx may be -1 if the symbol was marked to become local. */ else if (h != NULL && ! is_plt - && ((! info->symbolic && h->dynindx != -1) + && ((!info->symbolic && !info->static_link + && h->dynindx != -1) || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) { @@ -2776,7 +2777,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) The entry in the global offset table will already have been initialized in the relocate_section function. */ if (info->shared - && (info->symbolic || h->dynindx == -1) + && (info->symbolic || info->static_link || h->dynindx == -1) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) { asection *sec = h->root.u.def.section; diff --git a/gnu/usr.bin/binutils/bfd/elflink.c b/gnu/usr.bin/binutils/bfd/elflink.c index 4707de15838..73a8a4778aa 100644 --- a/gnu/usr.bin/binutils/bfd/elflink.c +++ b/gnu/usr.bin/binutils/bfd/elflink.c @@ -2139,7 +2139,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h, if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0 && eif->info->shared && is_elf_hash_table (eif->info->hash) - && (eif->info->symbolic + && (eif->info->symbolic || eif->info->static_link || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) { |