This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] ct-ng: binutils-2.22: add some patches from Debian binutils package


# HG changeset patch
# User Johannes Stezenbach <js@sig21.net>
# Date 1329404007 -3600
# Node ID 13582b22317968514d22a0a24d372fe0da15ed04
# Parent  369e2fbe9010a1911d61b56c977d2c94949daef9
binutils-2.22: add some patches from Debian

Signed-off-by: Johannes Stezenbach <js@sig21.net>

---
The patch for PR 13449 seems to be fairly important for C++
exception handling.  The sysroot patch for PR ld/10340
is not in upstream (don't know why), but Debian, Fedora,
OpenSuse have it and the bugzilla says the issue is hit
by libtool.
Note: I only picked up patches relevant for ARM.

diff -r 369e2fbe9010 -r 13582b223179 patches/binutils/2.22/300-128_build_id.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/binutils/2.22/300-128_build_id.patch	Thu Feb 16 15:53:27 2012 +0100
@@ -0,0 +1,44 @@
+Description: Description: Fix ld corrupt build ID generation
+Author: Nick Clifton
+Upstream status: Taken from Fedora (BZ 501582)
+
+http://sourceware.org/bugzilla/show_bug.cgi?id=12451
+
+--- a/bfd/compress.c
++++ b/bfd/compress.c
+@@ -174,7 +174,7 @@
+     case COMPRESS_SECTION_NONE:
+       if (p == NULL)
+ 	{
+-	  p = (bfd_byte *) bfd_malloc (sz);
++	  p = (bfd_byte *) bfd_zmalloc (sz);
+ 	  if (p == NULL)
+ 	    return FALSE;
+ 	  need_free = TRUE;
+--- a/bfd/elfcode.h
++++ b/bfd/elfcode.h
+@@ -1158,6 +1158,24 @@
+ 
+       if (i_shdr.contents)
+ 	(*process) (i_shdr.contents, i_shdr.sh_size, arg);
++      else
++	{
++	  asection *sec;
++
++	  sec = bfd_section_from_elf_index (abfd, count);
++	  if (sec != NULL)
++	    {
++	      if (sec->contents == NULL)
++		{
++		  /* Force rereading from file.  */
++		  sec->flags &= ~SEC_IN_MEMORY;
++		  if (! bfd_malloc_and_get_section (abfd, sec, & sec->contents))
++		    continue;
++		}
++	      if (sec->contents != NULL)
++		(*process) (sec->contents, i_shdr.sh_size, arg);
++	    }
++	}
+     }
+ 
+   return TRUE;
diff -r 369e2fbe9010 -r 13582b223179 patches/binutils/2.22/300-140_pr10340.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/binutils/2.22/300-140_pr10340.patch	Thu Feb 16 15:53:27 2012 +0100
@@ -0,0 +1,35 @@
+# DP: Proposed patch for PR ld/10340, ld doesn't honor sysroot prefix for ldscripts
+
+Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
+
+Always try to prepend the sysroot prefix to absolute filenames first.
+
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -308,18 +308,24 @@
+      directory first.  */
+   if (! entry->is_archive)
+     {
+-      if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename))
++      /* For absolute pathnames, try to always open the file in the
++	 sysroot first. If this fails, try to open the file at the
++	 given location. */
++      entry->sysrooted = is_sysrooted_pathname(entry->filename, FALSE);
++      if (IS_ABSOLUTE_PATH (entry->filename) && ld_sysroot && ! entry->sysrooted)
+ 	{
+ 	  char *name = concat (ld_sysroot, entry->filename,
+ 			       (const char *) NULL);
+ 	  if (ldfile_try_open_bfd (name, entry))
+ 	    {
+ 	      entry->filename = name;
++	      entry->sysrooted = TRUE;
+ 	      return TRUE;
+ 	    }
+ 	  free (name);
+ 	}
+-      else if (ldfile_try_open_bfd (entry->filename, entry))
++
++      if (ldfile_try_open_bfd (entry->filename, entry))
+ 	{
+ 	  entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename)
+ 	    && is_sysrooted_pathname (entry->filename, TRUE);
diff -r 369e2fbe9010 -r 13582b223179 patches/binutils/2.22/300-160_gas_pr12698.diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/binutils/2.22/300-160_gas_pr12698.diff	Thu Feb 16 15:53:27 2012 +0100
@@ -0,0 +1,54 @@
+# DP: Proposed patch for PR gas/12698
+
+2011-04-15  Bernd Schmidt  <bernds@codesourcery.com>
+
+	gas/
+	* config/tc-arm.c (m_profile_p): New function.
+	(parse_psr, do_t_mrs, do_t_msr): Use m_profile_p.
+
+
+--- a/gas/config/tc-arm.c
++++ b/gas/config/tc-arm.c
+@@ -234,6 +234,15 @@
+ static const arm_feature_set fpu_neon_ext_fma = ARM_FEATURE (0, FPU_NEON_EXT_FMA);
+ static const arm_feature_set fpu_vfp_ext_fma = ARM_FEATURE (0, FPU_VFP_EXT_FMA);
+ 
++/* Return whether FEATURES indicates an M profile CPU, without getting
++   confused by ARM_ANY.  */
++static int
++m_profile_p (arm_feature_set features)
++{
++  return (ARM_CPU_HAS_FEATURE (features, arm_ext_v6m)
++	  && !ARM_CPU_HAS_FEATURE (features, arm_ext_v7a));
++}
++
+ static int mfloat_abi_opt = -1;
+ /* Record user cpu selection for object attributes.  */
+ static arm_feature_set selected_cpu = ARM_ARCH_NONE;
+@@ -5354,7 +5363,7 @@
+   const struct asm_psr *psr;
+   char *start;
+   bfd_boolean is_apsr = FALSE;
+-  bfd_boolean m_profile = ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_m);
++  bfd_boolean m_profile = m_profile_p (selected_cpu);
+ 
+   /* CPSR's and SPSR's can now be lowercase.  This is just a convenience
+      feature for ease of use and backwards compatibility.  */
+@@ -10947,7 +10956,7 @@
+     {
+       int flags = inst.operands[1].imm & (PSR_c|PSR_x|PSR_s|PSR_f|SPSR_BIT);
+ 
+-      if (ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_m))
++      if (m_profile_p (selected_cpu))
+ 	constraint (flags != 0, _("selected processor does not support "
+         	    "requested special purpose register"));
+       else
+@@ -10979,7 +10988,7 @@
+   else
+     flags = inst.operands[0].imm;
+ 
+-  if (ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_m))
++  if (m_profile_p (selected_cpu))
+     {
+       int bits = inst.operands[0].imm & (PSR_c|PSR_x|PSR_s|PSR_f|SPSR_BIT);
+ 
diff -r 369e2fbe9010 -r 13582b223179 patches/binutils/2.22/300-pr13449.diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/binutils/2.22/300-pr13449.diff	Thu Feb 16 15:53:27 2012 +0100
@@ -0,0 +1,20 @@
+2011-12-21  Nick Clifton  <nickc@redhat.com>
+
+	PR gas/13449
+	* config/tc-arm.c (create_unwind_entry): Zero allocated table
+	entries.
+
+ 
+diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
+index 865f430..02a63a6 100644
+--- a/gas/config/tc-arm.c
++++ b/gas/config/tc-arm.c
+@@ -19944,6 +19944,8 @@ create_unwind_entry (int have_data)
+ 
+   /* Allocate the table entry.	*/
+   ptr = frag_more ((size << 2) + 4);
++  /* PR 13449: Zero the table entries in case some of them are not used.  */
++  memset (ptr, 0, (size << 2) + 4);
+   where = frag_now_fix () - ((size << 2) + 4);
+ 
+   switch (unwind.personality_index)

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]