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