#1 Please merge binutils 2.29 patches for F27
Closed 3 years ago by merlinm. Opened 3 years ago by merlinm.
Unknown source f27-merge-fixes  into  f27

@@ -1,54 +0,0 @@

- Common subdirectories: ../binutils-2.24.orig/ld/emulparams and ld/emulparams

- Common subdirectories: ../binutils-2.24.orig/ld/emultempl and ld/emultempl

- diff -up ../binutils-2.24.orig/ld/ldlang.c ld/ldlang.c

- --- a/ld/ldlang.c	2014-05-09 10:35:04.589504928 +0100

- +++ b/ld/ldlang.c	2014-05-09 10:35:55.515661478 +0100

- @@ -7096,6 +7096,18 @@

-  	       && little != NULL)

-  	format = little;

-  

- +      if (getenv ("LD_FORCE_LE") != NULL)

- +	{

- +	  if (strcmp (format, "elf64-powerpc") == 0)

- +	    format = "elf64-powerpcle";

- +	  else if (strcmp (format, "elf32-powerpc") == 0)

- +	    format = "elf32-powerpcle";

- +	  else if (strcmp (format, "elf64-big") == 0)

- +	    format = "elf64-little";

- +	  else if (strcmp (format, "elf32-big") == 0)

- +	    format = "elf32-little";

- +	}

- +

-        output_target = format;

-      }

-  }

- Only in ld: ldlang.c.orig

- diff -up ../binutils-2.24.orig/ld/ldmain.c ld/ldmain.c

- --- a/ld/ldmain.c	2014-05-09 10:35:04.593504941 +0100

- +++ b/ld/ldmain.c	2014-05-09 10:35:55.515661478 +0100

- @@ -603,6 +603,18 @@

-  	}

-      }

-  

- +  if ((strncmp (emulation, "elf64ppc", 8) == 0

- +       || strncmp (emulation, "elf32ppc", 8) == 0)

- +      && getenv ("LD_FORCE_LE") != NULL)

- +    {

- +      size_t len = strlen (emulation);

- +      char *le = xmalloc (len + 2);

- +      memcpy (le, emulation, 5);

- +      le[5] = 'l';

- +      memcpy (le + 6, emulation + 5, len - 4);

- +      emulation = le;

- +    }

- +

-    return emulation;

-  }

-  

- Only in ld: ldmain.c.orig

- Common subdirectories: ../binutils-2.24.orig/ld/ldscripts and ld/ldscripts

- Common subdirectories: ../binutils-2.24.orig/ld/.libs and ld/.libs

- Common subdirectories: ../binutils-2.24.orig/ld/po and ld/po

- Common subdirectories: ../binutils-2.24.orig/ld/scripttempl and ld/scripttempl

- Common subdirectories: ../binutils-2.24.orig/ld/testsuite and ld/testsuite

- Common subdirectories: ../binutils-2.24.orig/ld/tmpdir and ld/tmpdir

@@ -1,38 +0,0 @@

- diff -up binutils-2.25.orig/bfd/configure.ac binutils-2.25/bfd/configure.ac

- --- binutils-2.25.orig/bfd/configure.ac	2014-12-24 10:34:45.590491143 +0000

- +++ binutils-2.25/bfd/configure.ac	2014-12-24 10:36:12.997981992 +0000

- @@ -183,11 +183,13 @@ if test "x${ac_cv_sizeof_long}" = "x8";

-    BFD_HOST_64BIT_LONG=1

-    test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"

-    test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"

- -elif test "x${ac_cv_sizeof_long_long}" = "x8"; then

- +fi

- +if test "x${ac_cv_sizeof_long_long}" = "x8"; then

-    BFD_HOST_64BIT_LONG_LONG=1

-    test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"

-    test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"

- -  if test "x${ac_cv_sizeof_void_p}" = "x8"; then

- +  if test "x${ac_cv_sizeof_void_p}" = "x8" \

- +          -a "x${ac_cv_sizeof_long}" != "x8"; then

-      BFD_HOSTPTR_T="unsigned long long"

-    fi

-  fi

- diff -up ../binutils-2.20.51.0.7.original/bfd/configure ./bfd/configure

- --- a/bfd/configure	2010-04-08 15:23:58.000000000 +0100

- +++ b/bfd/configure	2010-04-08 15:24:06.000000000 +0100

- @@ -12819,11 +12819,13 @@

-    BFD_HOST_64BIT_LONG=1

-    test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"

-    test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"

- -elif test "x${ac_cv_sizeof_long_long}" = "x8"; then

- +fi

- +if test "x${ac_cv_sizeof_long_long}" = "x8"; then

-    BFD_HOST_64BIT_LONG_LONG=1

-    test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"

-    test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"

- -  if test "x${ac_cv_sizeof_void_p}" = "x8"; then

- +  if test "x${ac_cv_sizeof_void_p}" = "x8" \

- +          -a "x${ac_cv_sizeof_long}" != "x8"; then

-      BFD_HOSTPTR_T="unsigned long long"

-    fi

-  fi

@@ -1,63 +0,0 @@

- --- ../binutils-2.25.1.orig/ld/testsuite/ld-plugin/lto.exp	2016-01-08 15:24:58.241083264 +0000

- +++ ld/testsuite/ld-plugin/lto.exp	2016-01-08 16:30:51.845827089 +0000

- @@ -386,6 +386,11 @@ if { [at_least_gcc_version 4 7] } {

-      }

-  }

-  

- +# Fedora specific binutils patches break some of the tests that follow...

- +restore_notify

- +return

- +

- +

-  # Run "ld -r" to generate inputs for complex LTO tests.

-  run_dump_test "lto-3r"

-  remote_exec host "mv" "tmpdir/dump tmpdir/lto-3.o"

- --- ../binutils-2.26.orig/ld/testsuite/ld-size/size.exp	2016-01-27 15:51:27.223093570 +0000

- +++ ld/testsuite/ld-size/size.exp	2016-01-27 16:00:04.262015016 +0000

- @@ -113,37 +113,6 @@ run_cc_link_tests [list \

-  	"libsize-6b.so" \

-      ] \

-      [list \

- -	"Build libsize-7.so" \

- -	"-shared" \

- -	"-fPIC" \

- -	{size-7b.c} \

- -	{} \

- -	"libsize-7.so" \

- -    ] \

- -    [list \

- -	"Build size-7" \

- -	"$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libsize-7.so" \

- -	"$NOPIE_CFLAGS" \

- -	{size-7a.c} \

- -	{{readelf -rW size-7.rd}} \

- -	"size-7.exe" \

- -    ] \

- -    [list \

- -	"Build libsize-8.so" \

- -	"-shared" "-fPIC" \

- -	{size-8b.c} \

- -	{} \

- -	"libsize-8.so" \

- -    ] \

- -    [list \

- -	"Build size-8" \

- -	"$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libsize-8.so" \

- -	"$NOPIE_CFLAGS" \

- -	{size-8a.c} \

- -	{{readelf -rW size-8.rd}} \

- -	"size-8.exe" \

- -    ] \

- -    [list \

-  	"Build libsize-9.so" \

-  	"-shared" \

-  	"-fPIC" \

- @@ -161,6 +130,8 @@ run_cc_link_tests [list \

-      ] \

-  ]

-  

- +return

- +

-  # Check if size relocation works at run-time.

-  catch "exec tmpdir/size-7.exe > tmpdir/dump.out" exec_output

-  if ![string match "" $exec_output] then {

@@ -1,38 +0,0 @@

- --- binutils-2.26.orig/gold/dirsearch.cc	2016-02-04 10:31:45.228796199 +0000

- +++ binutils-2.26/gold/dirsearch.cc	2016-02-04 11:33:15.875824355 +0000

- @@ -122,6 +122,7 @@ class Dir_caches

-    Cache_hash caches_;

-  };

-  

- +#if 0

-  Dir_caches::~Dir_caches()

-  {

-    for (Cache_hash::iterator p = this->caches_.begin();

- @@ -129,6 +130,7 @@ Dir_caches::~Dir_caches()

-         ++p)

-      delete p->second;

-  }

- +#endif

-  

-  void

-  Dir_caches::add(const char* dirname)

- --- binutils-2.26.orig/gold/arm.cc	2016-02-04 10:31:45.227796193 +0000

- +++ binutils-2.26/gold/arm.cc	2016-02-04 12:02:43.897996168 +0000

- @@ -4493,7 +4493,7 @@ Stub::do_fixed_endian_write(unsigned cha

-  // Reloc_stub::Key methods.

-  

-  // Dump a Key as a string for debugging.

- -

- +#if 0

-  std::string

-  Reloc_stub::Key::name() const

-  {

- @@ -4524,7 +4524,7 @@ Reloc_stub::Key::name() const

-        return std::string(buffer);

-      }

-  }

- -

- +#endif

-  // Reloc_stub methods.

-  

-  // Determine the type of stub needed, if any, for a relocation of R_TYPE at

@@ -1,14 +0,0 @@

- diff -rup binutils.orig/ld/ldmain.c binutils-2.28/ld/ldmain.c

- --- binutils.orig/ld/ldmain.c	2017-06-09 09:08:26.954016429 +0100

- +++ binutils-2.28/ld/ldmain.c	2017-06-09 09:09:11.307490976 +0100

- @@ -923,6 +923,10 @@ multiple_definition (struct bfd_link_inf

-        obfd = h->u.def.section->owner;

-        break;

-      case bfd_link_hash_indirect:

- +      /* PR 21074: The GOLD linker can produce multiple indirect

- +	 refences to the same symbol.  These can be ignored.  */

- +      if (bfd_is_ind_section (nsec))

- +	return;

-        osec = bfd_ind_section_ptr;

-        oval = 0;

-        obfd = NULL;

@@ -0,0 +1,147 @@

+ --- binutils.orig/ld/emultempl/elf32.em	2017-09-14 15:35:45.971100712 +0100

+ +++ binutils-2.29/ld/emultempl/elf32.em	2017-09-14 15:40:30.315782167 +0100

+ @@ -2011,6 +2011,29 @@ output_rel_find (asection *sec, int isdy

+  

+  static int orphan_init_done = 0;

+  

+ +/* Return whether IN is suitable to be part of OUT.  */

+ +

+ +static bfd_boolean

+ +elf_orphan_compatible (asection *in, asection *out)

+ +{

+ +  /* Non-zero sh_info implies a section with SHF_INFO_LINK with

+ +     unknown semantics for the generic linker, or a SHT_REL/SHT_RELA

+ +     section where sh_info specifies a symbol table.  (We won't see

+ +     SHT_GROUP, SHT_SYMTAB or SHT_DYNSYM sections here.)  We clearly

+ +     can't merge SHT_REL/SHT_RELA using differing symbol tables, and

+ +     shouldn't merge sections with differing unknown semantics.  */

+ +  if (elf_section_data (out)->this_hdr.sh_info

+ +      != elf_section_data (in)->this_hdr.sh_info)

+ +    return FALSE;

+ +  /* We can't merge two sections with differing SHF_EXCLUDE when doing

+ +     a relocatable link.  */

+ +  if (bfd_link_relocatable (&link_info)

+ +      && ((elf_section_flags (out) ^ elf_section_flags (in)) & SHF_EXCLUDE) != 0)

+ +    return FALSE;

+ +  return _bfd_elf_match_sections_by_type (link_info.output_bfd, out,

+ +					  in->owner, in);

+ +}

+ +

+  /* Place an orphan section.  We use this to put random SHF_ALLOC

+     sections in the right segment.  */

+  

+ @@ -2067,8 +2090,9 @@ gld${EMULATION_NAME}_place_orphan (asect

+    lang_output_section_statement_type *os;

+    lang_output_section_statement_type *match_by_name = NULL;

+    int isdyn = 0;

+ -  int iself = s->owner->xvec->flavour == bfd_target_elf_flavour;

+ -  unsigned int sh_type = iself ? elf_section_type (s) : SHT_NULL;

+ +  int elfinput = s->owner->xvec->flavour == bfd_target_elf_flavour;

+ +  int elfoutput = link_info.output_bfd->xvec->flavour == bfd_target_elf_flavour;

+ +  unsigned int sh_type = elfinput ? elf_section_type (s) : SHT_NULL;

+    flagword flags;

+    asection *nexts;

+  

+ @@ -2076,7 +2100,7 @@ gld${EMULATION_NAME}_place_orphan (asect

+        && link_info.combreloc

+        && (s->flags & SEC_ALLOC))

+      {

+ -      if (iself)

+ +      if (elfinput)

+  	switch (sh_type)

+  	  {

+  	  case SHT_RELA:

+ @@ -2098,6 +2122,8 @@ gld${EMULATION_NAME}_place_orphan (asect

+      }

+  

+    if (!bfd_link_relocatable (&link_info)

+ +      && elfinput

+ +      && elfoutput

+        && (s->flags & SEC_ALLOC) != 0

+        && (elf_section_flags (s) & SHF_GNU_MBIND) != 0)

+      {

+ @@ -2148,23 +2174,18 @@ gld${EMULATION_NAME}_place_orphan (asect

+  	   lang_insert_orphan to create a new output section.  */

+  	constraint = SPECIAL;

+  

+ -	/* SEC_EXCLUDE is cleared when doing a relocatable link.  But

+ -	   we can't merge 2 input sections with the same name when only

+ -	   one of them has SHF_EXCLUDE.  Don't merge 2 sections with

+ -	   different sh_info.  */

+ +	/* Check to see if we already have an output section statement

+ +	   with this name, and its bfd section has compatible flags.

+ +	   If the section already exists but does not have any flags

+ +	   set, then it has been created by the linker, possibly as a

+ +	   result of a --section-start command line switch.  */

+  	if (os->bfd_section != NULL

+ -	    && (elf_section_data (os->bfd_section)->this_hdr.sh_info

+ -		== elf_section_data (s)->this_hdr.sh_info)

+  	    && (os->bfd_section->flags == 0

+ -		|| ((!bfd_link_relocatable (&link_info)

+ -		     || (iself && (((elf_section_flags (s)

+ -				     ^ elf_section_flags (os->bfd_section))

+ -				    & SHF_EXCLUDE) == 0)))

+ -		    && ((s->flags ^ os->bfd_section->flags)

+ +		|| (((s->flags ^ os->bfd_section->flags)

+  		     & (SEC_LOAD | SEC_ALLOC)) == 0

+ -		    && _bfd_elf_match_sections_by_type (link_info.output_bfd,

+ -							os->bfd_section,

+ -							s->owner, s))))

+ +		    && (!elfinput

+ +			|| !elfoutput

+ +			|| elf_orphan_compatible (s, os->bfd_section)))))

+  	  {

+  	    /* We already have an output section statement with this

+  	       name, and its bfd section has compatible flags.

+ @@ -2253,8 +2274,8 @@ gld${EMULATION_NAME}_place_orphan (asect

+    else if ((flags & SEC_ALLOC) == 0)

+      ;

+    else if ((flags & SEC_LOAD) != 0

+ -	   && ((iself && sh_type == SHT_NOTE)

+ -	       || (!iself && CONST_STRNEQ (secname, ".note"))))

+ +	   && ((elfinput && sh_type == SHT_NOTE)

+ +	       || (!elfinput && CONST_STRNEQ (secname, ".note"))))

+      place = &hold[orphan_interp];

+    else if ((flags & (SEC_LOAD | SEC_HAS_CONTENTS | SEC_THREAD_LOCAL)) == 0)

+      place = &hold[orphan_bss];

+ @@ -2264,8 +2285,8 @@ gld${EMULATION_NAME}_place_orphan (asect

+      place = &hold[orphan_tdata];

+    else if ((flags & SEC_READONLY) == 0)

+      place = &hold[orphan_data];

+ -  else if (((iself && (sh_type == SHT_RELA || sh_type == SHT_REL))

+ -	    || (!iself && CONST_STRNEQ (secname, ".rel")))

+ +  else if (((elfinput && (sh_type == SHT_RELA || sh_type == SHT_REL))

+ +	    || (!elfinput && CONST_STRNEQ (secname, ".rel")))

+  	   && (flags & SEC_LOAD) != 0)

+      place = &hold[orphan_rel];

+    else if ((flags & SEC_CODE) == 0)

+ diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.29/bfd/elf32-i386.c

+ --- binutils.orig/bfd/elf32-i386.c	2017-09-15 10:27:16.828950825 +0100

+ +++ binutils-2.29/bfd/elf32-i386.c	2017-09-15 10:27:38.962692771 +0100

+ @@ -6921,8 +6921,9 @@ elf_i386_link_setup_gnu_properties (stru

+        for (abfd = info->input_bfds;

+  	   abfd != NULL;

+  	   abfd = abfd->link.next)

+ -	if ((abfd->flags

+ -	     & (DYNAMIC | BFD_LINKER_CREATED | BFD_PLUGIN)) == 0)

+ +	if (bfd_get_flavour (abfd) == bfd_target_elf_flavour

+ +	    && (abfd->flags

+ +		 & (DYNAMIC | BFD_LINKER_CREATED | BFD_PLUGIN)) == 0)

+  	  {

+  	    htab->elf.dynobj = abfd;

+  	    dynobj = abfd;

+ diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.29/bfd/elf64-x86-64.c

+ --- binutils.orig/bfd/elf64-x86-64.c	2017-09-15 10:27:16.820950918 +0100

+ +++ binutils-2.29/bfd/elf64-x86-64.c	2017-09-15 10:28:02.621416935 +0100

+ @@ -7466,8 +7466,9 @@ error_alignment:

+  	  for (abfd = info->input_bfds;

+  	       abfd != NULL;

+  	       abfd = abfd->link.next)

+ -	    if ((abfd->flags

+ -		 & (DYNAMIC | BFD_LINKER_CREATED | BFD_PLUGIN)) == 0)

+ +	    if (bfd_get_flavour (abfd) == bfd_target_elf_flavour

+ +		&& (abfd->flags

+ +		    & (DYNAMIC | BFD_LINKER_CREATED | BFD_PLUGIN)) == 0)

+  	      {

+  		htab->elf.dynobj = abfd;

+  		dynobj = abfd;

file modified
+156 -69
@@ -1,19 +1,14 @@

- # rpmbuild parameters:

+ # Binutils SPEC file.  Can be invoked with the following parameters:

+ 

  # --define "binutils_target arm-linux-gnu" to create arm-linux-gnu-binutils.

  # --with=bootstrap: Build with minimal dependencies.

  # --with=debug: Build without optimizations and without splitting the debuginfo.

  # --without=docs: Skip building documentation.

- # --without=testsuite: Do not run the testsuite.

+ # --without=testsuite: Do not run the testsuite.  Default is to run it.

+ # --with=testsuite: Run the testsuite.  Default when --with=debug is not to run it.

+ 

+ #---Start of Configure Options-----------------------------------------------------------------------

  

- %if 0%{!?binutils_target:1}

- %define binutils_target %{_target_platform}

- %define isnative 1

- %define enable_shared 1

- %else

- %define cross %{binutils_target}-

- %define isnative 0

- %define enable_shared 0

- %endif

  # BZ 1124342: Provide a way to enable deterministic archives.

  # BZ 1195883: But do not do this by default.

  %define enable_deterministic_archives 0
@@ -21,6 +16,8 @@

  %define enable_lto 1

  # Disable the default generation of compressed debug sections.

  %define default_compress_debug 0

+ # Default to read-only-relocations (relro) in shared binaries.

+ %define default_relro 1

  

  # Default: Not bootstrapping.

  %bcond_with bootstrap
@@ -40,51 +37,99 @@

  %undefine with_testsuite

  %endif

  

+ #----End of Configure Options-----------------------------------------------------------------------

+ 

+ %if 0%{!?binutils_target:1}

+ %define binutils_target %{_target_platform}

+ %define isnative 1

+ %define enable_shared 1

+ %else

+ %define cross %{binutils_target}-

+ %define isnative 0

+ %define enable_shared 0

+ %endif

+ 

+ #---------------------------------------------------------------------------------

+ 

  Summary: A GNU collection of binary utilities

  Name: %{?cross}binutils%{?_with_debug:-debug}

  Version: 2.29

- Release: 6%{?dist}

+ Release: 9%{?dist}

  License: GPLv3+

  Group: Development/Tools

  URL: http://sources.redhat.com/binutils

  

- # Note - the Linux Kernel binutils releases are too unstable and contain too

- # many controversial patches so we stick with the official FSF version

+ # Note - the Linux Kernel binutils releases are too unstable and contain

+ # too many controversial patches so we stick with the official FSF version

  # instead.

  

  Source: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz

  

  Source2: binutils-2.19.50.0.1-output-format.sed

  

+ # Purpose: Use /lib64 and /usr/lib64 instead of /lib and /usr/lib in the

+ #          default library search path of 64-bit targets.

+ # Lifetime: Permanent, but it should not be.  This is a bug in the libtool

+ #          sources used in both binutils and gcc, (specifically the libtool.m4

+ #          file).  These are based on a version released in 2009 (2.2.6?) rather

+ #          than the latest version.  (Definitely fixed in libtool version 2.4.6).

  Patch01: binutils-2.20.51.0.2-libtool-lib64.patch

+ 

+ # Purpose:  Appends a RHEL or Fedora release string to the generic binutils version string.

+ # Lifetime: Permanent.  This is a RHEL/Fedora specific patch.

  Patch02: binutils-2.25-version.patch

- Patch03: binutils-2.25-set-long-long.patch

+ 

+ # Purpose:  Prevent a seg-fault when attempting to pad a section with a NULL padding pointer.

+ # Lifetime: Permanent - but should be contributed upstream and fixed.

+ #           FIXME: Need a test case to reproduce the potential bug so

+ #           that the patch can be contributes.

  Patch04: binutils-2.20.51.0.10-sec-merge-emit.patch

- # Enable -zrelro by default: BZ #621983

- Patch05: binutils-2.22.52.0.1-relro-on-by-default.patch

- # Local patch - export demangle.h with the binutils-devel rpm.

+ 

+ # Purpose:  Exports the demangle.h header file (associated with the libiberty sources) with

+ #           the binutils-devel rpm.

+ # Lifetime: Permanent.  This is a RHEL/Fedora specific patch.

  Patch06: binutils-2.22.52.0.1-export-demangle.h.patch

- # Disable checks that config.h has been included before system headers.  BZ #845084

+ 

+ # Purpose:  Disables the check in the BFD library's header file that config.h has been

+ #           included before the bfd.h header.  See BZ #845084 for more details.

+ # Lifetime: Permanent - but it should not be.  The bfd.h header defines various types that

+ #           are dependent upon configuration options, so he order of inclusion is important.

+ #           FIXME: It would be better if the packages using the BFD header were fixed so

+ #           that they do include the header files in the correct order.  It may also be

+ #           necessary to add a way for a package to tell the bfd.h header that this check

+ #           is not necessary.

  Patch07: binutils-2.22.52.0.4-no-config-h-check.patch

- # Fix detections little endian PPC shared libraries

- Patch08: binutils-2.24-ldforcele.patch

- Patch09: binutils-2.25.1-cleansweep.patch

- Patch10: binutils-2.26-fix-compile-warnings.patch

- # Import H.J.Lu's Kernel LTO patch.

+ 

+ # Purpose:  Import H.J.Lu's Kernel LTO patch.

+ # Lifetime: Permanent, but needs continual updating.

+ #   FIXME:  Try removing....

  Patch11: binutils-2.26-lto.patch

- # Skip PR14918 linker test for ARM native targets.

+ 

+ # Purpose:  Skip PR14918 linker test for ARM native targets.

+ # Lifetime: Permanent - but it should not be.

+ #           FIXME: This patch should be contributed upstream.

  Patch12: binutils-2.29-skip-rp14918-test-for-arm.patch

- # Include the filename concerned in readelf error messages.

+ 

+ # Purpose:  Include the filename concerned in readelf error messages.

+ # Lifetime: Permanent.  This patch changes the format of readelf's output, making it

+ #           better (IMHO) but also potentially breaking tools that depend upon readelf's

+ #           current format.  Hence it remains a local patch.

  Patch13: binutils-2.29-filename-in-error-messages.patch

- # Ignore duplicate indirect symbols generated by GOLD.

- Patch14: binutils-2.28-ignore-gold-duplicates.patch

- # Do not enable the PPC64 plt-localentry0 linker optimization by default.

+ 

+ # Purpose:  Do not enable the PPC64 plt-localentry0 linker optimization by default.

+ # Lifetime: Fixed in 2.29.1.

  Patch15: binutils-2.29-ppc64-plt-localentry0-disable.patch

  

+ # Purpose:  Prevent a seg-fault in the linker by not attempting to place orphan ELF

+ #           sections into a non-ELF output section.

+ # Lifetime: Fixed in 2.29.1.

+ Patch16: binutils-2.29-non-elf-orphan-skip.patch

+ 

+ #---------------------------------------------------------------------------------

+ 

  Provides: bundled(libiberty)

  

  # BZ 1173780: Building GOLD for PPC is not working at the moment.

- # %define gold_arches %ix86 x86_64 %arm aarch64 ppc* %{power64}

  %define gold_arches %ix86 x86_64 %arm aarch64

  

  %if %{with bootstrap}
@@ -155,6 +200,8 @@

  %define _gnu %{nil}

  %endif

  

+ #---------------------------------------------------------------------------------

+ 

  %description

  Binutils is a collection of binary utilities, including ar (for

  creating, modifying and extracting from archives), as (a family of GNU
@@ -168,6 +215,8 @@

  from files), strip (for discarding symbols), and addr2line (for

  converting addresses to file and line).

  

+ #---------------------------------------------------------------------------------

+ 

  %package devel

  Summary: BFD and opcodes static and dynamic libraries and header files

  Group: System Environment/Libraries
@@ -195,25 +244,20 @@

  Developers starting new projects are strongly encouraged to consider

  using libelf instead of BFD.

  

+ #---------------------------------------------------------------------------------

+ 

  %prep

  %setup -q -n binutils-%{version}

- %patch01 -p1 -b .libtool-lib64~

- %patch02 -p1 -b .version~

- %patch03 -p1 -b .set-long-long~

- %patch04 -p1 -b .sec-merge-emit~

- %patch05 -p1 -b .relro~

- %patch06 -p1 -b .export-demangle-h~

- %patch07 -p1 -b .no-config-h-check~

- %ifarch ppc64le

- %patch08 -p1 -b .ldforcele~

- %endif

- %patch09 -p0

- %patch10 -p1

+ %patch01 -p1

+ %patch02 -p1 

+ %patch04 -p1 

+ %patch06 -p1 

+ %patch07 -p1 

  %patch11 -p1

  %patch12 -p1

  %patch13 -p1

- %patch14 -p1

  %patch15 -p1

+ %patch16 -p1

  

  # We cannot run autotools as there is an exact requirement of autoconf-2.59.

  
@@ -251,15 +295,17 @@

  %define _target_platform %{_arch}-%{_vendor}-%{_host_os}

  %endif

  

+ #---------------------------------------------------------------------------------

+ 

  %build

  echo target is %{binutils_target}

+ 

  %ifarch %{power64}

- #CFLAGS=`echo $RPM_OPT_FLAGS | sed -e -s "s/-Werror//g"`

- #export CFLAGS

  export CFLAGS="$RPM_OPT_FLAGS -Wno-error"

  %else

  export CFLAGS="$RPM_OPT_FLAGS"

  %endif

+ 

  CARGS=

  

  case %{binutils_target} in i?86*|sparc*|ppc*|s390*|sh*|arm*|aarch64*)
@@ -300,6 +346,7 @@

  # We could optimize the cross builds size by --enable-shared but the produced

  # binaries may be less convenient in the embedded environment.

  %configure \

+   --quiet \

    --build=%{_target_platform} --host=%{_target_platform} \

    --target=%{binutils_target} \

  %ifarch %gold_arches
@@ -323,7 +370,7 @@

  %endif

  %if %{enable_deterministic_archives}

    --enable-deterministic-archives \

- %else    

+ %else

    --enable-deterministic-archives=no \

  %endif

  %if %{enable_lto}
@@ -334,11 +381,16 @@

  %else

    --enable-compressed-debug-sections=none \

  %endif

+ %if %{default_relro}

+   --enable-relro=yes \

+ %else

+   --enable-relro=no \

+ %endif

    $CARGS \

    --enable-plugins \

    --with-bugurl=http://bugzilla.redhat.com/bugzilla/

  

- %if %{with docs}  

+ %if %{with docs}

  make %{_smp_mflags} tooldir=%{_prefix} all

  make %{_smp_mflags} tooldir=%{_prefix} info

  %else
@@ -363,16 +415,18 @@

  rm -f binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}-*.{sum,log}

  %endif

  

+ #---------------------------------------------------------------------------------

+ 

  %install

  rm -rf %{buildroot}

- %if %{with docs}  

+ %if %{with docs}

  make install DESTDIR=%{buildroot}

  %else

  make install DESTDIR=%{buildroot} MAKEINFO=true

  %endif

  

  %if %{isnative}

- %if %{with info}

+ %if %{with docs}

  make prefix=%{buildroot}%{_prefix} infodir=%{buildroot}%{_infodir} install-info

  %endif

  
@@ -400,7 +454,7 @@

  

  %if %{enable_shared}

  chmod +x %{buildroot}%{_libdir}/lib*.so*

- %endif

+ %endif # isnative

  

  # Prevent programs from linking against libbfd and libopcodes

  # dynamically, as they are change far too often.
@@ -453,14 +507,14 @@

  INPUT ( %{_libdir}/libopcodes.a -lbfd )

  EOH

  

- %else # !%{isnative}

+ %else # !isnative

  # For cross-binutils we drop the documentation.

  rm -rf %{buildroot}%{_infodir}

  # We keep these as one can have native + cross binutils of different versions.

- #rm -rf %{buildroot}%{_prefix}/share/locale

- #rm -rf %{buildroot}%{_mandir}

+ #rm -rf {buildroot}{_prefix}/share/locale

+ #rm -rf {buildroot}{_mandir}

  rm -rf %{buildroot}%{_libdir}/libiberty.a

- %endif # !%{isnative}

+ %endif # !isnative

  

  # This one comes from gcc

  rm -f %{buildroot}%{_infodir}/dir
@@ -485,9 +539,13 @@

    cat %{?cross}gold.lang >> %{?cross}binutils.lang

  fi

  

+ #---------------------------------------------------------------------------------

+ 

  %clean

  rm -rf %{buildroot}

  

+ #---------------------------------------------------------------------------------

+ 

  %post

  %if "%{build_gold}" == "both"

  %__rm -f %{_bindir}/%{?cross}ld
@@ -495,8 +553,9 @@

    %{_bindir}/%{?cross}ld.bfd %{ld_bfd_priority}

  %{_sbindir}/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \

    %{_bindir}/%{?cross}ld.gold %{ld_gold_priority}

- %{_sbindir}/alternatives --auto %{?cross}ld 

- %endif

+ %{_sbindir}/alternatives --auto %{?cross}ld

+ %endif # both ld.gold and ld.bfd

+ 

  %if %{isnative}

  /sbin/ldconfig

  %if %{with docs}
@@ -505,16 +564,20 @@

    /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz

    /sbin/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz

  %endif # with docs

- %endif # %{isnative}

+ %endif # isnative

+ 

  exit 0

  

+ #---------------------------------------------------------------------------------

+ 

  %preun

  %if "%{build_gold}" == "both"

  if [ $1 = 0 ]; then

    %{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.bfd

    %{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.gold

  fi

- %endif

+ %endif # both ld.gold and ld.bfd

+ 

  %if %{isnative}

  if [ $1 = 0 ]; then

    if [ -e %{_infodir}/binutils.info.gz ]
@@ -525,9 +588,12 @@

      /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz

    fi

  fi

- %endif

+ %endif # isnative

+ 

  exit 0

  

+ #---------------------------------------------------------------------------------

+ 

  %if %{isnative}

  %postun

  /sbin/ldconfig
@@ -538,29 +604,36 @@

      /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz

      /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz

    fi

- %endif # %{isnative}

+ %endif # isnative

+ 

+ #---------------------------------------------------------------------------------

  

  %files -f %{?cross}binutils.lang

  %defattr(-,root,root,-)

  %license COPYING COPYING3 COPYING3.LIB COPYING.LIB

  %doc README

  %{_bindir}/%{?cross}[!l]*

+ 

  %if "%{build_gold}" == "both"

  %{_bindir}/%{?cross}ld.*

  %ghost %{_bindir}/%{?cross}ld

  %else

  %{_bindir}/%{?cross}ld*

- %endif

+ %endif # both ld.gold and ld.bfd

+ 

+ %if %{with docs}

  %{_mandir}/man1/*

  %{_infodir}/as.info.gz

  %{_infodir}/binutils.info.gz

  %{_infodir}/gprof.info.gz

  %{_infodir}/ld.info.gz

+ %endif # with docs

+ 

  %if %{enable_shared}

  %{_libdir}/lib*.so

  %exclude %{_libdir}/libbfd.so

  %exclude %{_libdir}/libopcodes.so

- %endif

+ %endif # enable_shared

  

  %if %{isnative}

  %if %{with docs}
@@ -577,9 +650,27 @@

  %if %{with docs}

  %{_infodir}/bfd*info*

  %endif # with docs

- %endif # %{isnative}

+ %endif # isnative

+ 

+ #---------------------------------------------------------------------------------

  

  %changelog

+ * Thu Sep 14 2017 Nick Clifton  <nickc@redhat.com> 2.29-10

+ - Extend fix for PR 21884.

+   (#1491023)

+ 

+ * Thu Sep 14 2017 Nick Clifton  <nickc@redhat.com> 2.29-8

+ - Import fix for PR 21884 which stops a seg-fault in the linker when changing output format to binary during a final link.

+   (#1491023)

+ 

+ * Sun Sep 10 2017 Nick Clifton  <nickc@redhat.com> - 2.29-7

+ - Annotate patches with reason and lifetime expectances.

+ - Retire: binutils-2.24-ldforcele.patch

+ - Retire: binutils-2.25-set-long-long.patch

+ - Retire: binutils-2.25.1-cleansweep.patch

+ - Retire: binutils-2.26-fix-compile-warnings.patch

+ - Retire: binutils-2.28-ignore-gold-duplicates.patch

+ 

  * Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.29-6

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

  
@@ -686,7 +777,7 @@

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

  

  * Thu Feb 02 2017 Stephen Gallagher  <sgallagh@redhat.com> 2.27-16

- - Install COPYING[*] files using the %license macro.

+ - Install COPYING[*] files using the % license macro.

    (#1418430)

  

  * Tue Jan 31 2017 Nick Clifton  <nickc@redhat.com> 2.27-15
@@ -1018,7 +1109,7 @@

  - Fix compiling using gcc 4.9  (#1087374)

  

  * Thu Mar 27 2014 Nick Clifton <nickc@redhat.com> - 2.24-11

- - Use %{version} in Source string.  Delete unused patches.

+ - Use {version} in Source string.  Delete unused patches.

  

  * Tue Jan 28 2014 Nick Clifton <nickc@redhat.com> - 2.24-10

  - Fix decoding of abbrevs using a DW_FORM_ref_addr attribute.  (#1056797)
@@ -1233,10 +1324,8 @@

  * Fri Apr 27 2012 Nick Clifton <nickc@redhat.com> - 2.22.52.0.1-12

  - Include demangle.h in the devel rpm.

  

- %if 0%{?rhel} >= 7

  * Tue Apr 03 2012 Nick Clifton <nickc@redhat.com> - 2.22.52.0.1-11

  - Enable -zrelro by default for RHEL 7+. (#807831)

- %endif

  

  * Fri Mar 16 2012 Jakub Jelinek <jakub@redhat.com> - 2.22.52.0.1-10

  - Fix up handling of hidden ifunc relocs on i?86
@@ -1248,10 +1337,8 @@

  - Fix up handling of hidden ifunc relocs on x86_64

  - Add Intel TSX support

  

- %if 0%{?fedora} >= 18

  * Tue Mar 06 2012 Nick Clifton <nickc@redhat.com> - 2.22.52.0.1-7

  - Enable -zrelro by default. (#621983 #807831)

- %endif

  

  * Mon Feb 27 2012 Jeff Law <law@redhat.com> - 2.22.52.0.1-6

  - Fix c++filt docs (#797752)

Please merge patch commits that were made to binutils 2.29 (just prior to the rebase to 2.29.1) from rawhide branch into f27 branch.

Scratch build for f27 including these patches: https://koji.fedoraproject.org/koji/taskinfo?taskID=23160333

Fixed in: binutils-2.29-7.fc27

Note - I have only updated the N-V-R by 1, since only one patch was brought in. The rest of the changes are cosmetic improvements to the binutils.spec file.

That works! Thank you.

Pull-Request has been closed by merlinm

3 years ago

Oops. The binutils-2.29-non-elf-orphan-skip.patch file didn't make it into the f27 branch!

[merlinm@f27dev fedpkg]$ fedpkg clone binutils
Cloning into 'binutils'...
remote: Counting objects: 2480, done.
remote: Compressing objects: 100% (1987/1987), done.
remote: Total 2480 (delta 1210), reused 1171 (delta 438)
Receiving objects: 100% (2480/2480), 35.98 MiB | 2.67 MiB/s, done.
Resolving deltas: 100% (1210/1210), done.
[merlinm@f27dev fedpkg]$ cd binutils
[merlinm@f27dev binutils]$ fedpkg switch-branch f27
Branch f27 set up to track remote branch f27 from origin.
[merlinm@f27dev binutils]$ fedpkg verrel
binutils-2.29-7.fc27
[merlinm@f27dev binutils]$ fedpkg srpm
Downloading binutils-2.29.tar.xz
######################################################################## 100.0%

error: File /home/merlinm/fedpkg/binutils/binutils-2.29-non-elf-orphan-skip.patch: No such file or directory
Could not execute srpm: Command 'rpmbuild --define '_sourcedir /home/merlinm/fedpkg/binutils' --define '_specdir /home/merlinm/fedpkg/binutils' --define '_builddir /home/merlinm/fedpkg/binutils' --define '_srcrpmdir /home/merlinm/fedpkg/binutils' --define '_rpmdir /home/merlinm/fedpkg/binutils' --define 'dist .fc27' --define 'fedora 27' --eval '%undefine rhel' --define 'fc27 1' --nodeps -bs /home/merlinm/fedpkg/binutils/binutils.spec' returned non-zero exit status 1
[merlinm@f27dev binutils]$ 

Oh bananas! Sorry about that. This missing patch has been added and I have run a brew build to confirm it:

https://koji.fedoraproject.org/koji/taskinfo?taskID=23257370

Cheers
Nick