Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] package/binutils-2.25.1: backport upstream patch for PR19405
Date: Fri, 12 Feb 2016 23:33:23 +0100	[thread overview]
Message-ID: <1455316403-7793-2-git-send-email-romain.naour@gmail.com> (raw)
In-Reply-To: <1455316403-7793-1-git-send-email-romain.naour@gmail.com>

Fixes Buildroot generated toolchains:
http://autobuild.buildroot.net/results/89b/89b46f97e2736d9337f888c761259e7bc7cdd128

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
 ...ertion-in-NIOS2-linker-to-allow-signed-16.patch | 70 ++++++++++++++++++++++
 1 file changed, 70 insertions(+)
 create mode 100644 package/binutils/2.25.1/915-Correct-assertion-in-NIOS2-linker-to-allow-signed-16.patch

diff --git a/package/binutils/2.25.1/915-Correct-assertion-in-NIOS2-linker-to-allow-signed-16.patch b/package/binutils/2.25.1/915-Correct-assertion-in-NIOS2-linker-to-allow-signed-16.patch
new file mode 100644
index 0000000..6ae9d9a
--- /dev/null
+++ b/package/binutils/2.25.1/915-Correct-assertion-in-NIOS2-linker-to-allow-signed-16.patch
@@ -0,0 +1,70 @@
+From d07f38875f37f4608e8ecb761619d84716896f14 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Wed, 10 Feb 2016 11:25:59 +0000
+Subject: [PATCH] Correct assertion in NIOS2 linker to allow signed 16-buit
+ immediate values.
+
+	PR 19405
+	* elf32-nios2.c (nios2_elf32_install_imm16): Allow for signed
+	immediate values.
+	* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Limit the
+	number of messages about FDE encoding preventing .eh_frame_hdr
+	generation.
+
+[Romain: rebase on 2.25.1]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ bfd/elf-eh-frame.c | 18 +++++++++++++++---
+ bfd/elf32-nios2.c  |  2 +-
+ 2 files changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
+index 002932d..22430f9 100644
+--- a/bfd/elf-eh-frame.c
++++ b/bfd/elf-eh-frame.c
+@@ -1181,14 +1181,26 @@ _bfd_elf_discard_section_eh_frame
+ 		     && ent->make_relative == 0)
+ 		    || (ent->fde_encoding & 0x70) == DW_EH_PE_aligned))
+ 	      {
++		static int num_warnings_issued = 0;
++
+ 		/* If a shared library uses absolute pointers
+ 		   which we cannot turn into PC relative,
+ 		   don't create the binary search table,
+ 		   since it is affected by runtime relocations.  */
+ 		hdr_info->table = FALSE;
+-		(*info->callbacks->einfo)
+-		  (_("%P: FDE encoding in %B(%A) prevents .eh_frame_hdr"
+-		     " table being created.\n"), abfd, sec);
++		if (num_warnings_issued < 10)
++		  {
++		    (*info->callbacks->einfo)
++		      (_("%P: FDE encoding in %B(%A) prevents .eh_frame_hdr"
++			 " table being created.\n"), abfd, sec);
++		    num_warnings_issued ++;
++		  }
++		else if (num_warnings_issued == 10)
++		  {
++		    (*info->callbacks->einfo)
++		      (_("%P: Further warnings about FDE encoding preventing .eh_frame_hdr generation dropped.\n"));
++		    num_warnings_issued ++;
++		  }
+ 	      }
+ 	    ent->removed = 0;
+ 	    hdr_info->fde_count++;
+diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
+index 0105b70..726647d 100644
+--- a/bfd/elf32-nios2.c
++++ b/bfd/elf32-nios2.c
+@@ -1035,7 +1035,7 @@ nios2_elf32_install_imm16 (asection *sec, bfd_vma offset, bfd_vma value)
+ {
+   bfd_vma word = bfd_get_32 (sec->owner, sec->contents + offset);
+ 
+-  BFD_ASSERT(value <= 0xffff);
++  BFD_ASSERT (value <= 0xffff || ((bfd_signed_vma) value) >= -0xffff);
+ 
+   bfd_put_32 (sec->owner, word | ((value & 0xffff) << 6),
+ 	      sec->contents + offset);
+-- 
+2.4.3
+
-- 
2.4.3

  reply	other threads:[~2016-02-12 22:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12 22:33 [Buildroot] [PATCH 1/2] toolchain-external: CodeSourcery NiosII 2015.11 affected by PR19405 Romain Naour
2016-02-12 22:33 ` Romain Naour [this message]
2016-02-17 21:29   ` [Buildroot] [PATCH 2/2] package/binutils-2.25.1: backport upstream patch for PR19405 Peter Korsgaard
2016-02-17 21:26 ` [Buildroot] [PATCH 1/2] toolchain-external: CodeSourcery NiosII 2015.11 affected by PR19405 Peter Korsgaard
2016-02-20 12:48   ` Romain Naour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455316403-7793-2-git-send-email-romain.naour@gmail.com \
    --to=romain.naour@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox