binutils/binutils-2.20.51.0.2-do-not-set-ifunc.patch

140 lines
5.5 KiB
Diff
Raw Normal View History

diff -rcp ../binutils-2.20.51.0.2.copy-patched/bfd/ChangeLog bfd/ChangeLog
*** ../binutils-2.20.51.0.2.copy-patched/bfd/ChangeLog 2010-03-04 09:15:22.000000000 +0000
--- bfd/ChangeLog 2010-03-04 10:37:24.000000000 +0000
***************
*** 1,3 ****
--- 1,11 ----
+ 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.
+ * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
+ * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): Likewise.
+
2009-12-17 Alan Modra <amodra@bigpond.net.au>
PR ld/11088
diff -rcp ../binutils-2.20.51.0.2.copy-patched/bfd/elf32-i386.c bfd/elf32-i386.c
*** ../binutils-2.20.51.0.2.copy-patched/bfd/elf32-i386.c 2010-03-04 09:15:19.000000000 +0000
--- bfd/elf32-i386.c 2010-03-04 10:37:39.000000000 +0000
*************** elf_i386_add_symbol_hook (bfd * abfd ATT
*** 4613,4619 ****
asection ** secp ATTRIBUTE_UNUSED,
bfd_vma * valp ATTRIBUTE_UNUSED)
{
! if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
return _bfd_elf_add_sharable_symbol (abfd, info, sym, namep, flagsp,
--- 4613,4620 ----
asection ** secp ATTRIBUTE_UNUSED,
bfd_vma * valp ATTRIBUTE_UNUSED)
{
! if ((abfd->flags & DYNAMIC) == 0
! && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
return _bfd_elf_add_sharable_symbol (abfd, info, sym, namep, flagsp,
diff -rcp ../binutils-2.20.51.0.2.copy-patched/bfd/elf32-ppc.c bfd/elf32-ppc.c
*** ../binutils-2.20.51.0.2.copy-patched/bfd/elf32-ppc.c 2010-03-04 09:15:20.000000000 +0000
--- bfd/elf32-ppc.c 2010-03-04 10:38:02.000000000 +0000
*************** ppc_elf_add_symbol_hook (bfd *abfd,
*** 3133,3139 ****
*valp = sym->st_size;
}
! if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
return TRUE;
--- 3133,3140 ----
*valp = sym->st_size;
}
! 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 -rcp ../binutils-2.20.51.0.2.copy-patched/bfd/elf64-ppc.c bfd/elf64-ppc.c
*** ../binutils-2.20.51.0.2.copy-patched/bfd/elf64-ppc.c 2010-03-04 09:15:20.000000000 +0000
--- bfd/elf64-ppc.c 2010-03-04 10:38:32.000000000 +0000
*************** ppc64_elf_add_symbol_hook (bfd *ibfd ATT
*** 4531,4537 ****
bfd_vma *value ATTRIBUTE_UNUSED)
{
if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC)
! elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
else if (ELF_ST_TYPE (isym->st_info) == STT_FUNC)
;
else if (*sec != NULL
--- 4531,4540 ----
bfd_vma *value ATTRIBUTE_UNUSED)
{
if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC)
! {
! 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 -rcp ../binutils-2.20.51.0.2.copy-patched/bfd/elf64-x86-64.c bfd/elf64-x86-64.c
*** ../binutils-2.20.51.0.2.copy-patched/bfd/elf64-x86-64.c 2010-03-04 09:15:21.000000000 +0000
--- bfd/elf64-x86-64.c 2010-03-04 10:38:50.000000000 +0000
*************** elf64_x86_64_add_symbol_hook (bfd *abfd,
*** 4242,4248 ****
return TRUE;
}
! if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
return _bfd_elf_add_sharable_symbol (abfd, info, sym, namep, flagsp,
--- 4242,4249 ----
return TRUE;
}
! if ((abfd->flags & DYNAMIC) == 0
! && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
return _bfd_elf_add_sharable_symbol (abfd, info, sym, namep, flagsp,
diff -rcp ../binutils-2.20.51.0.2.copy-patched/ld/testsuite/ChangeLog ld/testsuite/ChangeLog
*** ../binutils-2.20.51.0.2.copy-patched/ld/testsuite/ChangeLog 2010-03-04 09:16:17.000000000 +0000
--- ld/testsuite/ChangeLog 2010-03-04 11:43:29.000000000 +0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2010-02-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-ifunc/ifunc.exp: Expect System V OSABI in dynamic
+ ifunc-using executable.
+
2009-10-09 H.J. Lu <hongjiu.lu@intel.com>
PR ld/10749
diff -rcp ../binutils-2.20.51.0.2.copy-patched/ld/testsuite/ld-ifunc/ifunc.exp ld/testsuite/ld-ifunc/ifunc.exp
*** ../binutils-2.20.51.0.2.copy-patched/ld/testsuite/ld-ifunc/ifunc.exp 2010-03-04 09:16:08.000000000 +0000
--- ld/testsuite/ld-ifunc/ifunc.exp 2010-03-04 11:44:15.000000000 +0000
*************** if {! [check_osabi tmpdir/static_prog {U
*** 257,264 ****
fail "Static ifunc-using executable does not have an OS/ABI field of LINUX"
set fails [expr $fails + 1]
}
! if {! [check_osabi tmpdir/dynamic_prog {UNIX - Linux}]} {
! fail "Dynamic ifunc-using executable does not have an OS/ABI field of LINUX"
set fails [expr $fails + 1]
}
if {! [check_osabi tmpdir/static_nonifunc_prog {UNIX - System V}]} {
--- 257,264 ----
fail "Static ifunc-using executable does not have an OS/ABI field of LINUX"
set fails [expr $fails + 1]
}
! if {! [check_osabi tmpdir/dynamic_prog {UNIX - System V}]} {
! fail "Dynamic ifunc-using executable does not have an OS/ABI field of System V"
set fails [expr $fails + 1]
}
if {! [check_osabi tmpdir/static_nonifunc_prog {UNIX - System V}]} {