From 4584ec12076e088cf36965b88ef8710ca85491f9 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 21 Jan 2014 15:42:43 -0800 Subject: 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. --- bfd/elflink.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'bfd/elflink.c') 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; -- cgit v1.1