All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/binutils: fix assertion failure in xtensa ld
@ 2020-03-06  3:58 Max Filippov
  2020-03-08 16:40 ` Peter Korsgaard
  2020-03-15 10:53 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Max Filippov @ 2020-03-06  3:58 UTC (permalink / raw)
  To: buildroot

xtensa ld fails with the following message

  ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at
  elf32-xtensa.c:3283 in elf_xtensa_finish_dynamic_sections

during domoticz package build. It happens because of mismatch between
the size allocated for dynamic relocations in the executable image and
the number of PLT relocations actually written to the image. The
mismatch is caused by the fact that undefined weak symbol is treated as
dynamic (and thus needing PLT relocation), but xtensa linker not
expecting that.

Fixes: http://autobuild.buildroot.net/results/7885705f1b1c0f31cf21b464150f5509929c1906/
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Backported from: e15a8da9c71336b06cb5f2706c3f6b7e6ddd95a3
---
 .../0018-bfd-xtensa-fix-PR-ld-25630.patch     | 37 +++++++++++++++++++
 .../0007-bfd-xtensa-fix-PR-ld-25630.patch     | 37 +++++++++++++++++++
 .../0004-bfd-xtensa-fix-PR-ld-25630.patch     | 37 +++++++++++++++++++
 3 files changed, 111 insertions(+)
 create mode 100644 package/binutils/2.31.1/0018-bfd-xtensa-fix-PR-ld-25630.patch
 create mode 100644 package/binutils/2.32/0007-bfd-xtensa-fix-PR-ld-25630.patch
 create mode 100644 package/binutils/2.33.1/0004-bfd-xtensa-fix-PR-ld-25630.patch

diff --git a/package/binutils/2.31.1/0018-bfd-xtensa-fix-PR-ld-25630.patch b/package/binutils/2.31.1/0018-bfd-xtensa-fix-PR-ld-25630.patch
new file mode 100644
index 000000000000..f499426b708c
--- /dev/null
+++ b/package/binutils/2.31.1/0018-bfd-xtensa-fix-PR-ld-25630.patch
@@ -0,0 +1,37 @@
+From 85dcca5997cf3822d6456a5c9c59c46b56adfbb8 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Wed, 4 Mar 2020 14:54:27 -0800
+Subject: [PATCH] bfd: xtensa: fix PR ld/25630
+
+bfd/
+2020-03-05  Max Filippov  <jcmvbkbc@gmail.com>
+
+	* elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
+	relocation sections for any removed reference to a dynamic symbol.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ bfd/elf32-xtensa.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index 12ff9f772aaf..65e14d87940c 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -10148,10 +10148,9 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info,
+ 
+   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
+-	  || (dynamic_symbol
+-	      && (bfd_link_dll (info) || info->export_dynamic))))
++      && (dynamic_symbol
++	  || (bfd_link_pic (info)
++	      && (!h || h->root.type != bfd_link_hash_undefweak))))
+     {
+       asection *srel;
+       bfd_boolean is_plt = FALSE;
+-- 
+2.20.1
+
diff --git a/package/binutils/2.32/0007-bfd-xtensa-fix-PR-ld-25630.patch b/package/binutils/2.32/0007-bfd-xtensa-fix-PR-ld-25630.patch
new file mode 100644
index 000000000000..f499426b708c
--- /dev/null
+++ b/package/binutils/2.32/0007-bfd-xtensa-fix-PR-ld-25630.patch
@@ -0,0 +1,37 @@
+From 85dcca5997cf3822d6456a5c9c59c46b56adfbb8 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Wed, 4 Mar 2020 14:54:27 -0800
+Subject: [PATCH] bfd: xtensa: fix PR ld/25630
+
+bfd/
+2020-03-05  Max Filippov  <jcmvbkbc@gmail.com>
+
+	* elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
+	relocation sections for any removed reference to a dynamic symbol.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ bfd/elf32-xtensa.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index 12ff9f772aaf..65e14d87940c 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -10148,10 +10148,9 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info,
+ 
+   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
+-	  || (dynamic_symbol
+-	      && (bfd_link_dll (info) || info->export_dynamic))))
++      && (dynamic_symbol
++	  || (bfd_link_pic (info)
++	      && (!h || h->root.type != bfd_link_hash_undefweak))))
+     {
+       asection *srel;
+       bfd_boolean is_plt = FALSE;
+-- 
+2.20.1
+
diff --git a/package/binutils/2.33.1/0004-bfd-xtensa-fix-PR-ld-25630.patch b/package/binutils/2.33.1/0004-bfd-xtensa-fix-PR-ld-25630.patch
new file mode 100644
index 000000000000..f499426b708c
--- /dev/null
+++ b/package/binutils/2.33.1/0004-bfd-xtensa-fix-PR-ld-25630.patch
@@ -0,0 +1,37 @@
+From 85dcca5997cf3822d6456a5c9c59c46b56adfbb8 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Wed, 4 Mar 2020 14:54:27 -0800
+Subject: [PATCH] bfd: xtensa: fix PR ld/25630
+
+bfd/
+2020-03-05  Max Filippov  <jcmvbkbc@gmail.com>
+
+	* elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
+	relocation sections for any removed reference to a dynamic symbol.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ bfd/elf32-xtensa.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index 12ff9f772aaf..65e14d87940c 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -10148,10 +10148,9 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info,
+ 
+   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
+-	  || (dynamic_symbol
+-	      && (bfd_link_dll (info) || info->export_dynamic))))
++      && (dynamic_symbol
++	  || (bfd_link_pic (info)
++	      && (!h || h->root.type != bfd_link_hash_undefweak))))
+     {
+       asection *srel;
+       bfd_boolean is_plt = FALSE;
+-- 
+2.20.1
+
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] package/binutils: fix assertion failure in xtensa ld
  2020-03-06  3:58 [Buildroot] [PATCH] package/binutils: fix assertion failure in xtensa ld Max Filippov
@ 2020-03-08 16:40 ` Peter Korsgaard
  2020-03-15 10:53 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2020-03-08 16:40 UTC (permalink / raw)
  To: buildroot

>>>>> "Max" == Max Filippov <jcmvbkbc@gmail.com> writes:

 > xtensa ld fails with the following message
 >   ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at
 >   elf32-xtensa.c:3283 in elf_xtensa_finish_dynamic_sections

 > during domoticz package build. It happens because of mismatch between
 > the size allocated for dynamic relocations in the executable image and
 > the number of PLT relocations actually written to the image. The
 > mismatch is caused by the fact that undefined weak symbol is treated as
 > dynamic (and thus needing PLT relocation), but xtensa linker not
 > expecting that.

 > Fixes: http://autobuild.buildroot.net/results/7885705f1b1c0f31cf21b464150f5509929c1906/
 > Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
 > Backported from: e15a8da9c71336b06cb5f2706c3f6b7e6ddd95a3

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] package/binutils: fix assertion failure in xtensa ld
  2020-03-06  3:58 [Buildroot] [PATCH] package/binutils: fix assertion failure in xtensa ld Max Filippov
  2020-03-08 16:40 ` Peter Korsgaard
@ 2020-03-15 10:53 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2020-03-15 10:53 UTC (permalink / raw)
  To: buildroot

>>>>> "Max" == Max Filippov <jcmvbkbc@gmail.com> writes:

 > xtensa ld fails with the following message
 >   ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at
 >   elf32-xtensa.c:3283 in elf_xtensa_finish_dynamic_sections

 > during domoticz package build. It happens because of mismatch between
 > the size allocated for dynamic relocations in the executable image and
 > the number of PLT relocations actually written to the image. The
 > mismatch is caused by the fact that undefined weak symbol is treated as
 > dynamic (and thus needing PLT relocation), but xtensa linker not
 > expecting that.

 > Fixes: http://autobuild.buildroot.net/results/7885705f1b1c0f31cf21b464150f5509929c1906/
 > Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
 > Backported from: e15a8da9c71336b06cb5f2706c3f6b7e6ddd95a3
 > ---
 >  .../0018-bfd-xtensa-fix-PR-ld-25630.patch     | 37 +++++++++++++++++++
 >  .../0007-bfd-xtensa-fix-PR-ld-25630.patch     | 37 +++++++++++++++++++
 >  .../0004-bfd-xtensa-fix-PR-ld-25630.patch     | 37 +++++++++++++++++++
 >  3 files changed, 111 insertions(+)
 >  create mode 100644 package/binutils/2.31.1/0018-bfd-xtensa-fix-PR-ld-25630.patch
 >  create mode 100644 package/binutils/2.32/0007-bfd-xtensa-fix-PR-ld-25630.patch
 >  create mode 100644 package/binutils/2.33.1/0004-bfd-xtensa-fix-PR-ld-25630.patch

Committed (for the versions supported) to 2019.02.x and 2019.11.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-15 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06  3:58 [Buildroot] [PATCH] package/binutils: fix assertion failure in xtensa ld Max Filippov
2020-03-08 16:40 ` Peter Korsgaard
2020-03-15 10:53 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.