aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-01-05 22:51:42 +1030
committerAlan Modra <amodra@gmail.com>2021-01-05 23:09:04 +1030
commitc8bad65eee4667f731c4abcc4642c4a68c8601ca (patch)
tree1f96706c15221c020b666e7882444869cfac5f2d /bfd
parentd750c713c9a34c8835e8e60370708cae675edb40 (diff)
downloadgdb-c8bad65eee4667f731c4abcc4642c4a68c8601ca.zip
gdb-c8bad65eee4667f731c4abcc4642c4a68c8601ca.tar.gz
gdb-c8bad65eee4667f731c4abcc4642c4a68c8601ca.tar.bz2
is_relocatable_executable --exclude-libs failure
--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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4eda3a1..6c050b1 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2021-01-05 Alan Modra <amodra@gmail.com>
+ * elflink.c (bfd_elf_link_record_dynamic_symbol): Handle no_export
+ for relocatable executable.
+
+2021-01-05 Alan Modra <amodra@gmail.com>
+
* vms-alpha.c (_bfd_vms_slurp_egsd): Read flags after size check.
2021-01-05 Nelson Chu <nelson.chu@sifive.com>
diff --git a/bfd/elflink.c b/bfd/elflink.c
index df5b997..4c54b1a 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;
}