summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2018-09-28 22:43:17 (GMT)
committerAlexey Neyman <stilor@att.net>2018-09-28 22:43:17 (GMT)
commit83a5eb4084b4a4ec2249e7ff10e480d3c75d65f7 (patch)
tree324426aa995629c63fb45fd3a10a8b878197b0e1 /packages
parentd0dd654ca65029da8b30e2437a29c0934b7ecf80 (diff)
Patches to fix ld's abort on xtensa
Also while there, fix the naming (some patches ended up with two sequence numbers somehow). Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'packages')
-rw-r--r--packages/binutils/2.23.2/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.23.2/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.23.2/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.23.2/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.24/0003-ld_makefile_patch.patch (renamed from packages/binutils/2.24/0003-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.24/0004-check_ldrunpath_length.patch (renamed from packages/binutils/2.24/0004-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.25.1/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.25.1/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.25.1/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.25.1/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.26.1/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.26.1/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.26.1/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.26.1/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.27/0002-ld_makefile_patch.patch (renamed from packages/binutils/2.27/0002-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.27/0003-check_ldrunpath_length.patch (renamed from packages/binutils/2.27/0003-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.28.1/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.28.1/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.28.1/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.28.1/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.29.1/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.30/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.29.1/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.29.1/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.30/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.29.1/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.30/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.30/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.31.1/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.31.1/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.31.1/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.31.1/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.31.1/0009-xtensa-fix-relaxation-of-undefined-weak-references-i.patch43
-rw-r--r--packages/binutils/2.31.1/0010-xtensa-move-dynamic-relocations-sections-consistency.patch85
20 files changed, 128 insertions, 0 deletions
diff --git a/packages/binutils/2.23.2/0001-001_ld_makefile_patch.patch b/packages/binutils/2.23.2/0001-ld_makefile_patch.patch
index 3992be3..3992be3 100644
--- a/packages/binutils/2.23.2/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.23.2/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.23.2/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.23.2/0002-check_ldrunpath_length.patch
index a24df5e..a24df5e 100644
--- a/packages/binutils/2.23.2/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.23.2/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.24/0003-001_ld_makefile_patch.patch b/packages/binutils/2.24/0003-ld_makefile_patch.patch
index ab6a74f..ab6a74f 100644
--- a/packages/binutils/2.24/0003-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.24/0003-ld_makefile_patch.patch
diff --git a/packages/binutils/2.24/0004-012_check_ldrunpath_length.patch b/packages/binutils/2.24/0004-check_ldrunpath_length.patch
index ce28120..ce28120 100644
--- a/packages/binutils/2.24/0004-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.24/0004-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.25.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.25.1/0001-ld_makefile_patch.patch
index c47d7d1..c47d7d1 100644
--- a/packages/binutils/2.25.1/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.25.1/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.25.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.25.1/0002-check_ldrunpath_length.patch
index 712eb19..712eb19 100644
--- a/packages/binutils/2.25.1/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.25.1/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.26.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.26.1/0001-ld_makefile_patch.patch
index d2e1cd9..d2e1cd9 100644
--- a/packages/binutils/2.26.1/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.26.1/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.26.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.26.1/0002-check_ldrunpath_length.patch
index e3d6508..e3d6508 100644
--- a/packages/binutils/2.26.1/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.26.1/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.27/0002-001_ld_makefile_patch.patch b/packages/binutils/2.27/0002-ld_makefile_patch.patch
index 79c4719..79c4719 100644
--- a/packages/binutils/2.27/0002-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.27/0002-ld_makefile_patch.patch
diff --git a/packages/binutils/2.27/0003-012_check_ldrunpath_length.patch b/packages/binutils/2.27/0003-check_ldrunpath_length.patch
index 7433351..7433351 100644
--- a/packages/binutils/2.27/0003-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.27/0003-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.28.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.28.1/0001-ld_makefile_patch.patch
index 36940de..36940de 100644
--- a/packages/binutils/2.28.1/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.28.1/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.28.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.28.1/0002-check_ldrunpath_length.patch
index 78f05ae..78f05ae 100644
--- a/packages/binutils/2.28.1/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.28.1/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.30/0001-001_ld_makefile_patch.patch b/packages/binutils/2.29.1/0001-ld_makefile_patch.patch
index 4623653..4623653 100644
--- a/packages/binutils/2.30/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.29.1/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.29.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.29.1/0002-check_ldrunpath_length.patch
index 9bdc413..9bdc413 100644
--- a/packages/binutils/2.29.1/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.29.1/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.29.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.30/0001-ld_makefile_patch.patch
index 4623653..4623653 100644
--- a/packages/binutils/2.29.1/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.30/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.30/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.30/0002-check_ldrunpath_length.patch
index 026f279..026f279 100644
--- a/packages/binutils/2.30/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.30/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.31.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.31.1/0001-ld_makefile_patch.patch
index f73ff26..f73ff26 100644
--- a/packages/binutils/2.31.1/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.31.1/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.31.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.31.1/0002-check_ldrunpath_length.patch
index c0803d6..c0803d6 100644
--- a/packages/binutils/2.31.1/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.31.1/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.31.1/0009-xtensa-fix-relaxation-of-undefined-weak-references-i.patch b/packages/binutils/2.31.1/0009-xtensa-fix-relaxation-of-undefined-weak-references-i.patch
new file mode 100644
index 0000000..2c70bd2
--- /dev/null
+++ b/packages/binutils/2.31.1/0009-xtensa-fix-relaxation-of-undefined-weak-references-i.patch
@@ -0,0 +1,43 @@
+From 5d3a462f05cba5b0c0c96de899b84fb84155c760 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 22 Jul 2018 13:52:28 -0700
+Subject: [PATCH] xtensa: fix relaxation of undefined weak references in
+ shared objects
+
+The change c451bb34ae8b ("xtensa: don't emit dynamic relocation for weak
+undefined symbol") didn't properly handle shrinking of relocation
+sections due to coalescing of references to a dynamic undefined weak
+symbol in a shared object, which resulted in the following assertion
+failure in ld when linking uClibc-ng libthread_db for xtensa:
+
+ BFD (GNU Binutils) 2.31 internal error, aborting at elf32-xtensa.c:3269
+ in elf_xtensa_finish_dynamic_sections
+
+Shrink dynamic relocations section for dynamic undefined weak symbols
+when linking a shared object.
+
+bfd/
+2018-07-23 Max Filippov <jcmvbkbc@gmail.com>
+
+ * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
+ relocations section for dynamic undefined weak symbols when
+ linking a shared object.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+Backported from: 5d3a462f05cba5b0c0c96de899b84fb84155c760
+---
+ bfd/elf32-xtensa.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -10022,7 +10022,8 @@
+ if ((r_type == R_XTENSA_32 || r_type == R_XTENSA_PLT)
+ && (input_section->flags & SEC_ALLOC) != 0
+ && (dynamic_symbol || bfd_link_pic (info))
+- && (!h || h->root.type != bfd_link_hash_undefweak))
++ && (!h || h->root.type != bfd_link_hash_undefweak
++ || (dynamic_symbol && bfd_link_dll (info))))
+ {
+ asection *srel;
+ bfd_boolean is_plt = FALSE;
diff --git a/packages/binutils/2.31.1/0010-xtensa-move-dynamic-relocations-sections-consistency.patch b/packages/binutils/2.31.1/0010-xtensa-move-dynamic-relocations-sections-consistency.patch
new file mode 100644
index 0000000..710d368
--- /dev/null
+++ b/packages/binutils/2.31.1/0010-xtensa-move-dynamic-relocations-sections-consistency.patch
@@ -0,0 +1,85 @@
+From f82863d797e461b936dff2b659a3aa65088ee87e Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 22 Jul 2018 18:59:11 -0700
+Subject: [PATCH] xtensa: move dynamic relocations sections consistency
+ check
+
+The function elf_xtensa_finish_dynamic_sections checks that sizes of
+sections .rela.dyn and .rela.plt match number of corresponding relocation
+records, but the check is only done when .rela.plt is non-empty, so, e.g.
+it is never run for the static PIE.
+Rearrange the test so that .rela.dyn and .rela.plt are checked always.
+
+bfd/
+2018-07-23 Max Filippov <jcmvbkbc@gmail.com>
+
+ * elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Move
+ relocation sections consistency check to always check both
+ .rela.dyn and .rela.plt when they exist. Rearrange variable
+ definition and assignment places.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+Backported from: f82863d797e461b936dff2b659a3aa65088ee87e
+---
+ bfd/elf32-xtensa.c | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -3156,7 +3156,7 @@
+ {
+ struct elf_xtensa_link_hash_table *htab;
+ bfd *dynobj;
+- asection *sdyn, *srelplt, *sgot, *sxtlit, *sgotloc;
++ asection *sdyn, *srelplt, *srelgot, *sgot, *sxtlit, *sgotloc;
+ Elf32_External_Dyn *dyncon, *dynconend;
+ int num_xtlit_entries = 0;
+
+@@ -3186,15 +3186,15 @@
+ }
+
+ srelplt = htab->elf.srelplt;
++ srelgot = htab->elf.srelgot;
+ if (srelplt && srelplt->size != 0)
+ {
+- asection *sgotplt, *srelgot, *spltlittbl;
++ asection *sgotplt, *spltlittbl;
+ int chunk, plt_chunks, plt_entries;
+ Elf_Internal_Rela irela;
+ bfd_byte *loc;
+ unsigned rtld_reloc;
+
+- srelgot = htab->elf.srelgot;
+ spltlittbl = htab->spltlittbl;
+ BFD_ASSERT (srelgot != NULL && spltlittbl != NULL);
+
+@@ -3260,14 +3260,6 @@
+ spltlittbl->contents + (chunk * 8) + 4);
+ }
+
+- /* All the dynamic relocations have been emitted at this point.
+- Make sure the relocation sections are the correct size. */
+- if (srelgot->size != (sizeof (Elf32_External_Rela)
+- * srelgot->reloc_count)
+- || srelplt->size != (sizeof (Elf32_External_Rela)
+- * srelplt->reloc_count))
+- abort ();
+-
+ /* The .xt.lit.plt section has just been modified. This must
+ happen before the code below which combines adjacent literal
+ table entries, and the .xt.lit.plt contents have to be forced to
+@@ -3282,6 +3274,14 @@
+ spltlittbl->flags &= ~SEC_HAS_CONTENTS;
+ }
+
++ /* All the dynamic relocations have been emitted at this point.
++ Make sure the relocation sections are the correct size. */
++ if ((srelgot && srelgot->size != (sizeof (Elf32_External_Rela)
++ * srelgot->reloc_count))
++ || (srelplt && srelplt->size != (sizeof (Elf32_External_Rela)
++ * srelplt->reloc_count)))
++ abort ();
++
+ /* Combine adjacent literal table entries. */
+ BFD_ASSERT (! bfd_link_relocatable (info));
+ sxtlit = bfd_get_section_by_name (output_bfd, ".xt.lit");