* is_relocatable_executable --exclude-libs failure
@ 2021-01-05 12:37 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2021-01-05 12:37 UTC (permalink / raw)
To: binutils
--exclude-libs makes symbols hidden, but that doesn't prevent them
being made dynamic for is_relocatable_executable targets. Fix that.
* elflink.c (bfd_elf_link_record_dynamic_symbol): Handle no_export
for relocatable executable.
diff --git a/bfd/elflink.c b/bfd/elflink.c
index df5b997cf0..4c54b1a159 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -534,7 +534,12 @@ bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *info,
&& h->root.type != bfd_link_hash_undefweak)
{
h->forced_local = 1;
- if (!elf_hash_table (info)->is_relocatable_executable)
+ if (!elf_hash_table (info)->is_relocatable_executable
+ || ((h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && h->root.u.def.section->owner->no_export)
+ || (h->root.type == bfd_link_hash_common
+ && h->root.u.c.p->section->owner->no_export))
return TRUE;
}
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-05 12:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 12:37 is_relocatable_executable --exclude-libs failure Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).