summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2014-07-10 20:25:13 +0400
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-07-12 14:34:05 +0200
commit0dd180ec1901edac7d1f10a0e68951f738299c9d (patch)
tree0602ed2e0211a9d6ae0611d3454fed95e0c99f65
parent89d26851ca8ab9e47d6768ae69b1877de0d69766 (diff)
downloadbuildroot-0dd180ec1901edac7d1f10a0e68951f738299c9d.tar.gz
buildroot-0dd180ec1901edac7d1f10a0e68951f738299c9d.zip
binutils: fix xtensa ld segfault on linking linux modules
This fixes the following build error reproducible with any linux kernel module built with a recent buildroot toolchain: LD [M] fs/jbd2/jbd2.ko /bin/sh: line 1: 12069 Segmentation fault buildroot/host/usr/bin/xtensa-buildroot-linux-uclibc-ld -r --no-relax -T linux/scripts/module-common.lds --build-id -o fs/jbd2/jbd2.ko fs/jbd2/jbd2.o fs/jbd2/jbd2.mod.o Backported from: e7d17e71cdc10a2e81e454ce3b9637f1b2a587f2 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/binutils/2.22/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch47
-rw-r--r--package/binutils/2.23.2/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch47
-rw-r--r--package/binutils/2.24/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch47
3 files changed, 141 insertions, 0 deletions
diff --git a/package/binutils/2.22/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch b/package/binutils/2.22/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch
new file mode 100644
index 0000000000..6a0846ef8e
--- /dev/null
+++ b/package/binutils/2.22/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch
@@ -0,0 +1,47 @@
+From e7d17e71cdc10a2e81e454ce3b9637f1b2a587f2 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 10 Jul 2014 01:47:33 +0400
+Subject: [PATCH] Fix xtensa ld segfault when linking linux modules
+
+is_inconsistent_linkonce_section makes an assumption that section name
+that starts with ".gnu.linkonce.prop." has one more dot in its suffix.
+However gas generates such section name by insertion of "prop." right
+after ".gnu.linkonce." part of the name of the original section. So, for
+section named ".gnu.linkonce.this_module" corresponding property section
+name does not satisfy the assumption. Such section names are common in
+linux modules. This bug was exposed by the patch "a35d5e8 Fix alignment
+for the first section frag on xtensa", that makes gas produce property
+section for each section that has ".align" directive in it.
+
+Use suffix that immediately follows ".gnu.linkonce.prop." when there are
+no more dots following it.
+
+2014-07-10 Max Filippov <jcmvbkbc@gmail.com>
+
+ld/
+ * emultempl/xtensaelf.em (is_inconsistent_linkonce_section):
+ correctly handle missing dot in section name after
+ ".gnu.linkonce.prop.".
+---
+Backported from: e7d17e71cdc10a2e81e454ce3b9637f1b2a587f2
+Changes to ld/ChangeLog file are dropped.
+
+ ld/emultempl/xtensaelf.em | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
+index 151eea4..948d18d 100644
+--- a/ld/emultempl/xtensaelf.em
++++ b/ld/emultempl/xtensaelf.em
+@@ -1310,7 +1310,7 @@ is_inconsistent_linkonce_section (asection *sec)
+ for Tensilica's XCC compiler. */
+ name = sec_name + linkonce_len;
+ if (CONST_STRNEQ (name, "prop."))
+- name = strchr (name + 5, '.') + 1;
++ name = strchr (name + 5, '.') ? strchr (name + 5, '.') + 1 : name + 5;
+ else if (name[1] == '.'
+ && (name[0] == 'p' || name[0] == 'e' || name[0] == 'h'))
+ name += 2;
+--
+1.8.1.4
+
diff --git a/package/binutils/2.23.2/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch b/package/binutils/2.23.2/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch
new file mode 100644
index 0000000000..6a0846ef8e
--- /dev/null
+++ b/package/binutils/2.23.2/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch
@@ -0,0 +1,47 @@
+From e7d17e71cdc10a2e81e454ce3b9637f1b2a587f2 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 10 Jul 2014 01:47:33 +0400
+Subject: [PATCH] Fix xtensa ld segfault when linking linux modules
+
+is_inconsistent_linkonce_section makes an assumption that section name
+that starts with ".gnu.linkonce.prop." has one more dot in its suffix.
+However gas generates such section name by insertion of "prop." right
+after ".gnu.linkonce." part of the name of the original section. So, for
+section named ".gnu.linkonce.this_module" corresponding property section
+name does not satisfy the assumption. Such section names are common in
+linux modules. This bug was exposed by the patch "a35d5e8 Fix alignment
+for the first section frag on xtensa", that makes gas produce property
+section for each section that has ".align" directive in it.
+
+Use suffix that immediately follows ".gnu.linkonce.prop." when there are
+no more dots following it.
+
+2014-07-10 Max Filippov <jcmvbkbc@gmail.com>
+
+ld/
+ * emultempl/xtensaelf.em (is_inconsistent_linkonce_section):
+ correctly handle missing dot in section name after
+ ".gnu.linkonce.prop.".
+---
+Backported from: e7d17e71cdc10a2e81e454ce3b9637f1b2a587f2
+Changes to ld/ChangeLog file are dropped.
+
+ ld/emultempl/xtensaelf.em | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
+index 151eea4..948d18d 100644
+--- a/ld/emultempl/xtensaelf.em
++++ b/ld/emultempl/xtensaelf.em
+@@ -1310,7 +1310,7 @@ is_inconsistent_linkonce_section (asection *sec)
+ for Tensilica's XCC compiler. */
+ name = sec_name + linkonce_len;
+ if (CONST_STRNEQ (name, "prop."))
+- name = strchr (name + 5, '.') + 1;
++ name = strchr (name + 5, '.') ? strchr (name + 5, '.') + 1 : name + 5;
+ else if (name[1] == '.'
+ && (name[0] == 'p' || name[0] == 'e' || name[0] == 'h'))
+ name += 2;
+--
+1.8.1.4
+
diff --git a/package/binutils/2.24/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch b/package/binutils/2.24/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch
new file mode 100644
index 0000000000..6a0846ef8e
--- /dev/null
+++ b/package/binutils/2.24/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch
@@ -0,0 +1,47 @@
+From e7d17e71cdc10a2e81e454ce3b9637f1b2a587f2 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 10 Jul 2014 01:47:33 +0400
+Subject: [PATCH] Fix xtensa ld segfault when linking linux modules
+
+is_inconsistent_linkonce_section makes an assumption that section name
+that starts with ".gnu.linkonce.prop." has one more dot in its suffix.
+However gas generates such section name by insertion of "prop." right
+after ".gnu.linkonce." part of the name of the original section. So, for
+section named ".gnu.linkonce.this_module" corresponding property section
+name does not satisfy the assumption. Such section names are common in
+linux modules. This bug was exposed by the patch "a35d5e8 Fix alignment
+for the first section frag on xtensa", that makes gas produce property
+section for each section that has ".align" directive in it.
+
+Use suffix that immediately follows ".gnu.linkonce.prop." when there are
+no more dots following it.
+
+2014-07-10 Max Filippov <jcmvbkbc@gmail.com>
+
+ld/
+ * emultempl/xtensaelf.em (is_inconsistent_linkonce_section):
+ correctly handle missing dot in section name after
+ ".gnu.linkonce.prop.".
+---
+Backported from: e7d17e71cdc10a2e81e454ce3b9637f1b2a587f2
+Changes to ld/ChangeLog file are dropped.
+
+ ld/emultempl/xtensaelf.em | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
+index 151eea4..948d18d 100644
+--- a/ld/emultempl/xtensaelf.em
++++ b/ld/emultempl/xtensaelf.em
+@@ -1310,7 +1310,7 @@ is_inconsistent_linkonce_section (asection *sec)
+ for Tensilica's XCC compiler. */
+ name = sec_name + linkonce_len;
+ if (CONST_STRNEQ (name, "prop."))
+- name = strchr (name + 5, '.') + 1;
++ name = strchr (name + 5, '.') ? strchr (name + 5, '.') + 1 : name + 5;
+ else if (name[1] == '.'
+ && (name[0] == 'p' || name[0] == 'e' || name[0] == 'h'))
+ name += 2;
+--
+1.8.1.4
+
OpenPOWER on IntegriCloud