From 6639261126702aa1b91174fd95e48e4f4359a892 Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Fri, 7 May 2021 11:40:01 +0200 Subject: [PATCH] binutils: augment equally-named sections again Revert GNU ld to the old behavior where sections with the same name in multiple ld scripts are merged. Binutils 2.36.1 creates two sections with the same name. Fixes #4126 --- repos/ports/ports/binutils.hash | 2 +- .../binutils/patches/merge_sections.patch | 17 +++++++++++++++++ .../ports/src/noux-pkg/binutils/patches/series | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 repos/ports/src/noux-pkg/binutils/patches/merge_sections.patch diff --git a/repos/ports/ports/binutils.hash b/repos/ports/ports/binutils.hash index b9f661f04c..8e6254ac25 100644 --- a/repos/ports/ports/binutils.hash +++ b/repos/ports/ports/binutils.hash @@ -1 +1 @@ -41f7e5a393d8f8b8c7471efc366e74695a8d7694 +6c84c45b94d27bedf4b79d37f4703594e74458eb diff --git a/repos/ports/src/noux-pkg/binutils/patches/merge_sections.patch b/repos/ports/src/noux-pkg/binutils/patches/merge_sections.patch new file mode 100644 index 0000000000..b345704de0 --- /dev/null +++ b/repos/ports/src/noux-pkg/binutils/patches/merge_sections.patch @@ -0,0 +1,17 @@ +Revert to old behavior where sections with the same name are augmented + +Sebastian Sumpf + +diff --git a/ld/ldlang.c b/ld/ldlang.c +index 8cbeda6..10ccc98 100644 +--- a/ld/ldlang.c ++++ b/ld/ldlang.c +@@ -7414,7 +7414,7 @@ lang_enter_output_section_statement (const char *output_section_statement_name, + lang_output_section_statement_type *os; + + os = lang_output_section_statement_lookup (output_section_statement_name, +- constraint, 2); ++ constraint, 1); + current_section = os; + + if (os->addr_tree == NULL) diff --git a/repos/ports/src/noux-pkg/binutils/patches/series b/repos/ports/src/noux-pkg/binutils/patches/series index 80ed00421b..b4d92b5827 100644 --- a/repos/ports/src/noux-pkg/binutils/patches/series +++ b/repos/ports/src/noux-pkg/binutils/patches/series @@ -1,3 +1,4 @@ bfd.patch +merge_sections.patch arm.patch riscv.patch