aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-03-22 23:35:55 +0000
committerAlan Modra <amodra@gmail.com>2013-03-22 23:35:55 +0000
commit96f29d96afbe3e6835d75146a556f148688a5464 (patch)
tree37ec29c501b6dbd82935becd75f3a425f5ea8674 /bfd
parent4f778543a00e3ab59d9f04782554b491a8763b94 (diff)
downloadgdb-96f29d96afbe3e6835d75146a556f148688a5464.zip
gdb-96f29d96afbe3e6835d75146a556f148688a5464.tar.gz
gdb-96f29d96afbe3e6835d75146a556f148688a5464.tar.bz2
PR ld/15270
* elflink.c (elf_link_add_object_symbols): Don't set def_regular or ref_regular for BFD_PLUGIN owned syms, or have them affect def_dynamic/ref_dynamic. (_bfd_elf_fix_symbol_flags): Don't set def_regular for BFD_PLUGIN owned syms.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/elflink.c13
2 files changed, 16 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index a57684d..16b2b1b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2013-03-23 Alan Modra <amodra@gmail.com>
+
+ PR ld/15270
+ * elflink.c (elf_link_add_object_symbols): Don't set def_regular
+ or ref_regular for BFD_PLUGIN owned syms, or have them affect
+ def_dynamic/ref_dynamic.
+ (_bfd_elf_fix_symbol_flags): Don't set def_regular for BFD_PLUGIN
+ owned syms.
+
2013-03-22 David S. Miller <davem@davemloft.net>
* elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Set type of
diff --git a/bfd/elflink.c b/bfd/elflink.c
index fa805bc..be53ca3 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -2491,7 +2491,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
&& !h->def_regular
&& h->ref_regular
&& !h->def_dynamic
- && (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
+ && (h->root.u.def.section->owner->flags & (DYNAMIC | BFD_PLUGIN)) == 0)
h->def_regular = 1;
/* If -Bsymbolic was used (which means to bind references to global
@@ -4361,7 +4361,12 @@ error_free_dyn:
is one which is referenced or defined by both a regular
object and a shared object. */
dynsym = FALSE;
- if (! dynamic)
+
+ /* Plugin symbols aren't normal. Don't set def_regular or
+ ref_regular for them, nor make them dynamic. */
+ if ((abfd->flags & BFD_PLUGIN) != 0)
+ ;
+ else if (! dynamic)
{
if (! definition)
{
@@ -4415,10 +4420,6 @@ error_free_dyn:
if (definition && (sec->flags & SEC_DEBUGGING) && !info->relocatable)
dynsym = FALSE;
- /* Nor should we make plugin symbols dynamic. */
- if ((abfd->flags & BFD_PLUGIN) != 0)
- dynsym = FALSE;
-
if (definition)
{
h->target_internal = isym->st_target_internal;