aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2006-04-05 13:36:32 +0000
committerH.J. Lu <hjl.tools@gmail.com>2006-04-05 13:36:32 +0000
commit580a2b6ef36f848f0661ecf07fdc6ae5c97470a4 (patch)
tree29d08a22f309bebf76b0b46a171c586ce092dd12 /bfd
parent910600e9c7e78f59a8e89638016b70837a1ea622 (diff)
downloadgdb-580a2b6ef36f848f0661ecf07fdc6ae5c97470a4.zip
gdb-580a2b6ef36f848f0661ecf07fdc6ae5c97470a4.tar.gz
gdb-580a2b6ef36f848f0661ecf07fdc6ae5c97470a4.tar.bz2
2006-04-05 H.J. Lu <hongjiu.lu@intel.com>
PR ld/2404 * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect symbol from the dynamic definition with the default version if its type and the type of existing regular definition mismatch.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elflink.c20
2 files changed, 27 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 322b77f..9f371a8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/2404
+ * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect
+ symbol from the dynamic definition with the default version if
+ its type and the type of existing regular definition mismatch.
+
2006-04-05 Richard Sandiford <richard@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 88e56da..f3098ae 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -889,6 +889,26 @@ _bfd_elf_merge_symbol (bfd *abfd,
&& h->root.type != bfd_link_hash_undefweak
&& h->root.type != bfd_link_hash_common);
+ /* When we try to create a default indirect symbol from the dynamic
+ definition with the default version, we skip it if its type and
+ the type of existing regular definition mismatch. We only do it
+ if the existing regular definition won't be dynamic. */
+ if (pold_alignment == NULL
+ && !info->shared
+ && !info->export_dynamic
+ && !h->ref_dynamic
+ && newdyn
+ && newdef
+ && !olddyn
+ && (olddef || h->root.type == bfd_link_hash_common)
+ && ELF_ST_TYPE (sym->st_info) != h->type
+ && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
+ && h->type != STT_NOTYPE)
+ {
+ *skip = TRUE;
+ return TRUE;
+ }
+
/* Check TLS symbol. We don't check undefined symbol introduced by
"ld -u". */
if ((ELF_ST_TYPE (sym->st_info) == STT_TLS || h->type == STT_TLS)