summaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2006-04-05 13:36:32 +0000
committerH.J. Lu <hjl@lucon.org>2006-04-05 13:36:32 +0000
commitb52b82121aa9b6da9502fce16dc0e956be960298 (patch)
treecb89aa0cd4ec8668236bd7bacd3d100829acf03e /bfd/elflink.c
parentabcbf62078575b641fee82ade024c8d03347ae70 (diff)
downloadbinutils-redhat-b52b82121aa9b6da9502fce16dc0e956be960298.tar.gz
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/elflink.c')
-rw-r--r--bfd/elflink.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 88e56da54d..f3098aedfd 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)