summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/usr.bin/binutils/bfd/elf64-sparc.c5
-rw-r--r--gnu/usr.bin/binutils/bfd/elflink.c2
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)
{