aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-02-19 05:07:50 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-02-19 05:07:50 +0000
commitc16153aed7cc77c39bb5e78b2880a9792e1d0554 (patch)
tree0542a42ea09f6314fc9c21f028e7f5c76b82c708 /bfd
parent487565fe48accbc88da056cc373ca254763d7479 (diff)
downloadgdb-c16153aed7cc77c39bb5e78b2880a9792e1d0554.zip
gdb-c16153aed7cc77c39bb5e78b2880a9792e1d0554.tar.gz
gdb-c16153aed7cc77c39bb5e78b2880a9792e1d0554.tar.bz2
Don't set ELFOSABI_LINUX in dynamic ifunc-using executable.
bfd/ 2010-02-18 H.J. Lu <hongjiu.lu@intel.com> * elf32-i386.c (elf_i386_add_symbol_hook): Don't set has_ifunc_symbols if the symbol comes from a shared library. * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise. * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise. * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): Likewise. ld/testsuite/ 2010-02-18 H.J. Lu <hongjiu.lu@intel.com> * ld-ifunc/ifunc.exp: Expect System V OSABI in dynamic ifunc-using executable.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog10
-rw-r--r--bfd/elf32-i386.c5
-rw-r--r--bfd/elf32-ppc.c3
-rw-r--r--bfd/elf32-sparc.c5
-rw-r--r--bfd/elf64-ppc.c7
-rw-r--r--bfd/elf64-sparc.c3
-rw-r--r--bfd/elf64-x86-64.c3
7 files changed, 27 insertions, 9 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index a09058a..7ff3959 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,13 @@
+2010-02-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_add_symbol_hook): Don't set
+ has_ifunc_symbols if the symbol comes from a shared library.
+ * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
+ * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
+ * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
+ * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
+ * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): Likewise.
+
2010-02-19 Alan Modra <amodra@gmail.com>
* elf.c (_bfd_elf_fixup_group_sections): New function, split out from..
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index e2cdbf7..6ec2c2e 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -4620,7 +4620,7 @@ elf_i386_hash_symbol (struct elf_link_hash_entry *h)
file. */
static bfd_boolean
-elf_i386_add_symbol_hook (bfd * abfd ATTRIBUTE_UNUSED,
+elf_i386_add_symbol_hook (bfd * abfd,
struct bfd_link_info * info ATTRIBUTE_UNUSED,
Elf_Internal_Sym * sym,
const char ** namep ATTRIBUTE_UNUSED,
@@ -4628,7 +4628,8 @@ elf_i386_add_symbol_hook (bfd * abfd ATTRIBUTE_UNUSED,
asection ** secp ATTRIBUTE_UNUSED,
bfd_vma * valp ATTRIBUTE_UNUSED)
{
- if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
+ if ((abfd->flags & DYNAMIC) == 0
+ && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
return TRUE;
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 3667413..6e4cbc1 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3113,7 +3113,8 @@ ppc_elf_add_symbol_hook (bfd *abfd,
*valp = sym->st_size;
}
- if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
+ if ((abfd->flags & DYNAMIC) == 0
+ && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
return TRUE;
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index ab4f703..80102e9 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -171,7 +171,7 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela)
file. */
static bfd_boolean
-elf32_sparc_add_symbol_hook (bfd * abfd ATTRIBUTE_UNUSED,
+elf32_sparc_add_symbol_hook (bfd * abfd,
struct bfd_link_info * info ATTRIBUTE_UNUSED,
Elf_Internal_Sym * sym,
const char ** namep ATTRIBUTE_UNUSED,
@@ -179,7 +179,8 @@ elf32_sparc_add_symbol_hook (bfd * abfd ATTRIBUTE_UNUSED,
asection ** secp ATTRIBUTE_UNUSED,
bfd_vma * valp ATTRIBUTE_UNUSED)
{
- if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
+ if ((abfd->flags & DYNAMIC) == 0
+ && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
return TRUE;
}
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 90d1b9f..ffd37dd 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -4557,7 +4557,7 @@ make_fdh (struct bfd_link_info *info,
function type. */
static bfd_boolean
-ppc64_elf_add_symbol_hook (bfd *ibfd ATTRIBUTE_UNUSED,
+ppc64_elf_add_symbol_hook (bfd *ibfd,
struct bfd_link_info *info,
Elf_Internal_Sym *isym,
const char **name ATTRIBUTE_UNUSED,
@@ -4566,7 +4566,10 @@ ppc64_elf_add_symbol_hook (bfd *ibfd ATTRIBUTE_UNUSED,
bfd_vma *value ATTRIBUTE_UNUSED)
{
if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC)
- elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
+ {
+ if ((ibfd->flags & DYNAMIC) == 0)
+ elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
+ }
else if (ELF_ST_TYPE (isym->st_info) == STT_FUNC)
;
else if (*sec != NULL
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index a1bde20..5a2fda2 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -424,7 +424,8 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
{
static const char *const stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" };
- if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
+ if ((abfd->flags & DYNAMIC) == 0
+ && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
if (ELF_ST_TYPE (sym->st_info) == STT_REGISTER)
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 9459b9c..373a8da 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -4257,7 +4257,8 @@ elf64_x86_64_add_symbol_hook (bfd *abfd,
break;
}
- if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
+ if ((abfd->flags & DYNAMIC) == 0
+ && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
return TRUE;