aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-01-21 15:42:43 -0800
committerH.J. Lu <hjl.tools@gmail.com>2014-01-21 15:42:51 -0800
commit4584ec12076e088cf36965b88ef8710ca85491f9 (patch)
tree9b22f0bbf45bb9e59e1f3516cfb773d556d2a567 /bfd/elflink.c
parentefec45729843f9b1864b2a9b491adff85304525a (diff)
downloadgdb-4584ec12076e088cf36965b88ef8710ca85491f9.zip
gdb-4584ec12076e088cf36965b88ef8710ca85491f9.tar.gz
gdb-4584ec12076e088cf36965b88ef8710ca85491f9.tar.bz2
Check incompatible existing default symbol definition
After resolving a versioned reference, foo@VER1, to a default versioned definition, foo@@VER1, from a shared object, we also merge it with the existing regular default symbol definition, foo. When foo is IFUNC and foo@@VER1 aren't, we will merge 2 incompatible definitions. This patch avoids merging foo@@VER1 definition with foo definition if one is IFUNC and the other isn't.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index d0006da..792e14e 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1092,11 +1092,14 @@ _bfd_elf_merge_symbol (bfd *abfd,
&& 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
- && !(newfunc && oldfunc))
+ && (((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
+ && !(newfunc && oldfunc))
+ || (olddef
+ && ((h->type == STT_GNU_IFUNC)
+ != (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)))))
{
*skip = TRUE;
return TRUE;