rpms/binutils/F-13 binutils-2.20.51.0.2-copy-osabi.patch, NONE, 1.1 binutils-2.20.51.0.2-do-not-set-ifunc.patch, NONE, 1.1 binutils.spec, 1.191, 1.192

Nicholas Clifton nickc at fedoraproject.org
Thu Mar 4 16:51:03 UTC 2010


Author: nickc

Update of /cvs/pkgs/rpms/binutils/F-13
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3843

Modified Files:
	binutils.spec 
Added Files:
	binutils-2.20.51.0.2-copy-osabi.patch 
	binutils-2.20.51.0.2-do-not-set-ifunc.patch 
Log Message:
- Do not set ELFOSABI_LINUX on binaries which just link to IFUNC using DSOs.  (BZ 568941)
- Copy the OSABI field in ELF headers, if set.  (BZ 568921)


binutils-2.20.51.0.2-copy-osabi.patch:
 elf.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- NEW FILE binutils-2.20.51.0.2-copy-osabi.patch ---
*** ../binutils-2.20.51.0.2.copy-patched/bfd/elf.c	2010-03-02 14:37:43.000000000 +0000
--- bfd/elf.c	2010-03-02 14:39:27.000000000 +0000
*************** _bfd_elf_copy_private_bfd_data (bfd *ibf
*** 1069,1074 ****
--- 1069,1081 ----
    /* Copy object attributes.  */
    _bfd_elf_copy_obj_attributes (ibfd, obfd);
  
+   /* If the input BFD has the OSABI field set and the
+      output BFD does not, then copy the value.  */
+   if (elf_elfheader (ibfd)->e_ident [EI_OSABI] != ELFOSABI_NONE
+       && elf_elfheader (obfd)->e_ident [EI_OSABI] == ELFOSABI_NONE)
+     elf_elfheader (obfd)->e_ident [EI_OSABI] =
+       elf_elfheader (ibfd)->e_ident [EI_OSABI];
+ 
    return TRUE;
  }
  

binutils-2.20.51.0.2-do-not-set-ifunc.patch:
 bfd/ChangeLog                   |    8 ++++++++
 bfd/elf32-i386.c                |    3 !!!
 bfd/elf32-ppc.c                 |    3 !!!
 bfd/elf64-ppc.c                 |    5 !!!!!
 bfd/elf64-x86-64.c              |    3 !!!
 ld/testsuite/ChangeLog          |    5 +++++
 ld/testsuite/ld-ifunc/ifunc.exp |    4 !!!!
 7 files changed, 13 insertions(+), 18 modifications(!)

--- NEW FILE binutils-2.20.51.0.2-do-not-set-ifunc.patch ---
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 at 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 at 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 at intel.com>
+ 
+ 	* ld-ifunc/ifunc.exp: Expect System V OSABI in dynamic
+ 	ifunc-using executable.
+ 
  2009-10-09  H.J. Lu  <hongjiu.lu at 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}]} {


Index: binutils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/binutils/F-13/binutils.spec,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -p -r1.191 -r1.192
--- binutils.spec	12 Feb 2010 13:53:24 -0000	1.191
+++ binutils.spec	4 Mar 2010 16:51:03 -0000	1.192
@@ -17,7 +17,7 @@
 Summary: A GNU collection of binary utilities
 Name: %{?cross}binutils%{?_with_debug:-debug}
 Version: 2.20.51.0.2
-Release: 15%{?dist}
+Release: 17%{?dist}
 License: GPLv3+
 Group: Development/Tools
 URL: http://sources.redhat.com/binutils
@@ -37,6 +37,8 @@ Patch11: binutils-2.20.51.0.2-enable-gol
 Patch12: binutils-2.20.51.0.2-gas-expr.patch
 Patch13: binutils-2.20.51.0.2-ppc-hidden-plt-relocs.patch
 Patch14: binutils-2.20.51.0.2-x86-hash-table.patch
+Patch15: binutils-2.20.51.0.2-copy-osabi.patch
+Patch16: binutils-2.20.51.0.2-do-not-set-ifunc.patch
 
 %define gold_arches %ix86 x86_64
 
@@ -143,6 +145,8 @@ libelf instead of BFD.
 %patch12 -p0 -b .gas-expr~
 %patch13 -p0 -b .hidden-plt~
 %patch14 -p0 -b .hash-table~
+%patch15 -p0 -b .copy-osabi~
+%patch16 -p0 -b .no-ifunc~
 
 # We cannot run autotools as there is an exact requirement of autoconf-2.59.
 
@@ -445,6 +449,12 @@ exit 0
 %endif # %{isnative}
 
 %changelog
+* Thu Mar   4 2010 Nick Clifton <nickc at redhat.com> - 2.20.51.0.2-17
+- Do not set ELFOSABI_LINUX on binaries which just link to IFUNC using DSOs.  (BZ 568941)
+
+* Tue Mar   2 2010 Nick Clifton <nickc at redhat.com> - 2.20.51.0.2-16
+- Copy the OSABI field in ELF headers, if set.  (BZ 568921)
+
 * Fri Feb  12 2010 Nick Clifton <nickc at redhat.com> - 2.20.51.0.2-15
 - Create separate static and devel sub-packages.  (BZ 556040)
 



More information about the scm-commits mailing list