branch-updates
authorMatthias Klose <doko@debian.org>
Sun, 25 Aug 2024 15:32:28 +0000 (17:32 +0200)
committerMatthias Klose <doko@debian.org>
Sun, 25 Aug 2024 15:32:28 +0000 (17:32 +0200)
# DP: updates from the binutils-2.43 branch

# DP: updates from the binutils-2.43 branch

# git diff beb2cdbcda911764b2bed5e57921fe90493260bd 2d37b890e569330a29181ec3bd34b5cc1c354cbc

Gbp-Pq: Name branch-updates.diff

bfd/development.sh
bfd/version.h
ld/testsuite/ld-plugin/common-1.c [new file with mode: 0644]
ld/testsuite/ld-plugin/common-2a.c [new file with mode: 0644]
ld/testsuite/ld-plugin/common-2b.c [new file with mode: 0644]
ld/testsuite/ld-plugin/definition-1.c [new file with mode: 0644]
ld/testsuite/ld-plugin/lto.exp

index ad74927b5cb1a919472e1f60728d8ac174e84a67..8503914896c44bb87a1350e57b500196eb49c9b2 100644 (file)
@@ -16,7 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Controls whether to enable development-mode features by default.
-development=false
+development=true
 
 # Indicate whether this is a release branch.
 experimental=false
index c9a311b12669588b1465c7d1bf02dd523724cd93..cf2676cf1392f9f1359ce149f0925cab52cf7cd8 100644 (file)
@@ -16,7 +16,7 @@
 
    In releases, the date is not included in either version strings or
    sonames.  */
-#define BFD_VERSION_DATE 20240817
+#define BFD_VERSION_DATE 20240822
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/ld/testsuite/ld-plugin/common-1.c b/ld/testsuite/ld-plugin/common-1.c
new file mode 100644 (file)
index 0000000..b4f616a
--- /dev/null
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+int foo;
+
+int main()
+{
+  if (foo == 1)
+    printf ("PASS\n");
+
+  return 0;
+}
diff --git a/ld/testsuite/ld-plugin/common-2a.c b/ld/testsuite/ld-plugin/common-2a.c
new file mode 100644 (file)
index 0000000..fccfca7
--- /dev/null
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+int foo;
+
+int main()
+{
+  if (foo == 0)
+    printf ("PASS\n");
+
+  return 0;
+}
diff --git a/ld/testsuite/ld-plugin/common-2b.c b/ld/testsuite/ld-plugin/common-2b.c
new file mode 100644 (file)
index 0000000..c014c67
--- /dev/null
@@ -0,0 +1,6 @@
+int foo;
+
+void
+func (void)
+{
+}
diff --git a/ld/testsuite/ld-plugin/definition-1.c b/ld/testsuite/ld-plugin/definition-1.c
new file mode 100644 (file)
index 0000000..a244740
--- /dev/null
@@ -0,0 +1 @@
+int foo = 1;
index 604dc8c284d172fbd385c0348e947a6b9d2abb44..602d94ed7b37fdd9eb039d7821c6aedd4e9d8676 100644 (file)
@@ -231,6 +231,30 @@ set lto_link_tests [list \
    "$plug_opt" "-flto $lto_no_fat -fcommon" \
    {pr26389.c} \
    [list [list "nm" "$plug_opt" "pr26389.d"]]] \
+  [list "Build libdefinition-1.a" \
+   "$plug_opt" \
+   "-O2 -fcommon -flto $lto_no_fat" \
+   {definition-1.c} \
+   {} \
+   "libdefinition-1.a" \
+  ] \
+  [list \
+   "Build common-2a.o" \
+   "" \
+   "-O2 -fcommon -flto $lto_no_fat" \
+   {common-2a.c} \
+   {} \
+   "" \
+   "c" \
+  ] \
+  [list \
+   "Build libcommon-2.a" \
+   "$plug_opt" \
+   "-O2 -fcommon -flto $lto_no_fat" \
+   {common-2b.c} \
+   {} \
+   "libcommon-2.a" \
+  ] \
 ]
 
 if { [at_least_gcc_version 10 0] && [check_lto_shared_available] } {
@@ -763,6 +787,17 @@ set lto_run_tests [list \
    {pr26262a.c} "pr26262b" "pass.out" \
    "-flto -O2" "c" "" \
    ""] \
+  [list "Run common-1" \
+   "-O2 -flto" \
+   "" \
+   {common-1.c} \
+   "common-1" \
+   "pass.out" \
+   "-O2 -fcommon -flto $lto_no_fat" \
+   "c" \
+   "" \
+   "tmpdir/libdefinition-1.a" \
+  ] \
 ]
 
 if { [at_least_gcc_version 4 7] } {
@@ -862,6 +897,26 @@ run_cc_link_tests $lto_link_tests
 # by some elf tests besides shared libs tests.  So, always compile them.
 run_cc_link_tests $lto_compile_elf_tests
 
+# Xfail PR ld/32083 test for GCC without the fix:
+#
+# commit a98dd536b1017c2b814a3465206c6c01b2890998
+# Author: H.J. Lu <hjl.tools@gmail.com>
+# Date:   Wed Aug 21 07:25:25 2024 -0700
+#
+#    Update LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook
+#
+set exec_output [run_host_cmd "$CC_FOR_TARGET" \
+                             "-O2 -fcommon -flto -o tmpdir/common-2 \
+                              tmpdir/common-2a.o tmpdir/libcommon-2.a \
+                              tmpdir/libcommon-2.a"]
+if [string match "" $exec_output] then {
+    pass "PR ld/32083"
+} elseif { [ regexp "lto1: fatal error: multiple prevailing defs for 'func'" $exec_output ] } {
+    xfail "PR ld/32083"
+} else {
+    fail "PR ld/32083"
+}
+
 # Restrict these to ELF targets that support shared libs and PIC.
 if { [is_elf_format] && [check_lto_shared_available] } {
     run_cc_link_tests $lto_link_elf_tests