* [Buildroot] [PATCH] package/binutils: xtensa: fix shrink_dynamic_reloc_sections
@ 2019-03-29 1:51 Max Filippov
2019-03-29 7:02 ` Peter Korsgaard
2019-04-05 15:28 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Max Filippov @ 2019-03-29 1:51 UTC (permalink / raw)
To: buildroot
This fixes the following build error caused by link-time relaxation
removing copies of literals that reference undefined weak symbols with
PLT entries created due to -rdynamic option passed to g++ link command:
ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at
elf32-xtensa.c:3292 in elf_xtensa_finish_dynamic_sections
Fixes:
http://autobuild.buildroot.net/results/d41/d41aae8a448c316187f9fbde40f1d077182bb244/
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
...fix-shrink_dynamic_reloc_sections-for-exp.patch | 41 ++++++++++++++++++++++
...fix-shrink_dynamic_reloc_sections-for-exp.patch | 41 ++++++++++++++++++++++
2 files changed, 82 insertions(+)
create mode 100644 package/binutils/2.31.1/0015-bfd-xtensa-fix-shrink_dynamic_reloc_sections-for-exp.patch
create mode 100644 package/binutils/2.32/0003-bfd-xtensa-fix-shrink_dynamic_reloc_sections-for-exp.patch
diff --git a/package/binutils/2.31.1/0015-bfd-xtensa-fix-shrink_dynamic_reloc_sections-for-exp.patch b/package/binutils/2.31.1/0015-bfd-xtensa-fix-shrink_dynamic_reloc_sections-for-exp.patch
new file mode 100644
index 000000000000..b80e1fa7ce06
--- /dev/null
+++ b/package/binutils/2.31.1/0015-bfd-xtensa-fix-shrink_dynamic_reloc_sections-for-exp.patch
@@ -0,0 +1,41 @@
+From 278989f23735aa501be1052e085540c75c126dbb Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 28 Mar 2019 17:03:57 -0700
+Subject: [PATCH] bfd: xtensa: fix shrink_dynamic_reloc_sections for
+ export-dynamic
+
+shrink_dynamic_reloc_sections must remove PLT entry that was created for
+an undefined weak symbol in the presence of --export-dynamic option when
+relaxation coalesces literals pointing to that symbol. This fixes the
+following assertion:
+
+ ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at
+ elf32-xtensa.c:3292 in elf_xtensa_finish_dynamic_sections
+
+2019-03-28 Max Filippov <jcmvbkbc@gmail.com>
+bfd/
+ * elf32-xtensa.c (shrink_dynamic_reloc_sections): Add
+ info->export_dynamic to the conditional.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ bfd/elf32-xtensa.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index c3df3d6db756..37ea200eea74 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -10083,7 +10083,8 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info,
+ && (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))))
++ || (dynamic_symbol
++ && (bfd_link_dll (info) || info->export_dynamic))))
+ {
+ asection *srel;
+ bfd_boolean is_plt = FALSE;
+--
+2.11.0
+
diff --git a/package/binutils/2.32/0003-bfd-xtensa-fix-shrink_dynamic_reloc_sections-for-exp.patch b/package/binutils/2.32/0003-bfd-xtensa-fix-shrink_dynamic_reloc_sections-for-exp.patch
new file mode 100644
index 000000000000..b80e1fa7ce06
--- /dev/null
+++ b/package/binutils/2.32/0003-bfd-xtensa-fix-shrink_dynamic_reloc_sections-for-exp.patch
@@ -0,0 +1,41 @@
+From 278989f23735aa501be1052e085540c75c126dbb Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 28 Mar 2019 17:03:57 -0700
+Subject: [PATCH] bfd: xtensa: fix shrink_dynamic_reloc_sections for
+ export-dynamic
+
+shrink_dynamic_reloc_sections must remove PLT entry that was created for
+an undefined weak symbol in the presence of --export-dynamic option when
+relaxation coalesces literals pointing to that symbol. This fixes the
+following assertion:
+
+ ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at
+ elf32-xtensa.c:3292 in elf_xtensa_finish_dynamic_sections
+
+2019-03-28 Max Filippov <jcmvbkbc@gmail.com>
+bfd/
+ * elf32-xtensa.c (shrink_dynamic_reloc_sections): Add
+ info->export_dynamic to the conditional.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ bfd/elf32-xtensa.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index c3df3d6db756..37ea200eea74 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -10083,7 +10083,8 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info,
+ && (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))))
++ || (dynamic_symbol
++ && (bfd_link_dll (info) || info->export_dynamic))))
+ {
+ asection *srel;
+ bfd_boolean is_plt = FALSE;
+--
+2.11.0
+
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] package/binutils: xtensa: fix shrink_dynamic_reloc_sections
2019-03-29 1:51 [Buildroot] [PATCH] package/binutils: xtensa: fix shrink_dynamic_reloc_sections Max Filippov
@ 2019-03-29 7:02 ` Peter Korsgaard
2019-04-05 15:28 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2019-03-29 7:02 UTC (permalink / raw)
To: buildroot
>>>>> "Max" == Max Filippov <jcmvbkbc@gmail.com> writes:
> This fixes the following build error caused by link-time relaxation
> removing copies of literals that reference undefined weak symbols with
> PLT entries created due to -rdynamic option passed to g++ link command:
> ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at
> elf32-xtensa.c:3292 in elf_xtensa_finish_dynamic_sections
> Fixes:
> http://autobuild.buildroot.net/results/d41/d41aae8a448c316187f9fbde40f1d077182bb244/
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] package/binutils: xtensa: fix shrink_dynamic_reloc_sections
2019-03-29 1:51 [Buildroot] [PATCH] package/binutils: xtensa: fix shrink_dynamic_reloc_sections Max Filippov
2019-03-29 7:02 ` Peter Korsgaard
@ 2019-04-05 15:28 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2019-04-05 15:28 UTC (permalink / raw)
To: buildroot
>>>>> "Max" == Max Filippov <jcmvbkbc@gmail.com> writes:
> This fixes the following build error caused by link-time relaxation
> removing copies of literals that reference undefined weak symbols with
> PLT entries created due to -rdynamic option passed to g++ link command:
> ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at
> elf32-xtensa.c:3292 in elf_xtensa_finish_dynamic_sections
> Fixes:
> http://autobuild.buildroot.net/results/d41/d41aae8a448c316187f9fbde40f1d077182bb244/
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Committed to 2019.02.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-05 15:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-29 1:51 [Buildroot] [PATCH] package/binutils: xtensa: fix shrink_dynamic_reloc_sections Max Filippov
2019-03-29 7:02 ` Peter Korsgaard
2019-04-05 15:28 ` 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.