Rebase to GNU Binutils 2.41.

This commit is contained in:
Nick Clifton 2023-08-16 08:05:23 +01:00
parent b6cd5a80bd
commit 0b1c8753b9
12 changed files with 956 additions and 1923 deletions

1
.gitignore vendored
View File

@ -70,3 +70,4 @@ stamp-*
/binutils-2.38.tar.xz /binutils-2.38.tar.xz
/binutils-2.39.tar.xz /binutils-2.39.tar.xz
/binutils-2.40.tar.xz /binutils-2.40.tar.xz
/binutils-2.41.tar.xz

View File

@ -1,20 +0,0 @@
--- binutils.orig/bfd/elf.c 2023-04-17 16:26:08.720347439 +0100
+++ binutils-2.40/bfd/elf.c 2023-04-17 16:28:03.286317601 +0100
@@ -9050,6 +9050,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd
bfd_set_error (bfd_error_file_too_big);
goto error_return_verdef;
}
+ if (amt == 0)
+ goto error_return_verdef;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return_verdef;
@@ -9153,6 +9155,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd
bfd_set_error (bfd_error_file_too_big);
goto error_return;
}
+ if (amt == 0)
+ goto error_return;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return;

View File

@ -1,127 +0,0 @@
diff -rup binutils.orig/binutils/readelf.c binutils-2.40/binutils/readelf.c
--- binutils.orig/binutils/readelf.c 2023-02-13 14:38:44.081029276 +0000
+++ binutils-2.40/binutils/readelf.c 2023-02-13 14:38:56.201022315 +0000
@@ -22858,46 +22858,53 @@ process_file (char * file_name)
Filedata * filedata = NULL;
struct stat statbuf;
char armag[SARMAG];
- bool ret = true;
+ bool ret = false;
+ char * name;
+ char * saved_program_name;
+
+ /* Overload program_name to include file_name. Doing this means
+ that warning/error messages will positively identify the file
+ concerned even when multiple instances of readelf are running. */
+ name = xmalloc (strlen (program_name) + strlen (file_name) + 3);
+ sprintf (name, "%s: %s", program_name, file_name);
+ saved_program_name = program_name;
+ program_name = name;
if (stat (file_name, &statbuf) < 0)
{
if (errno == ENOENT)
- error (_("'%s': No such file\n"), file_name);
+ error (_("No such file\n"));
else
- error (_("Could not locate '%s'. System error message: %s\n"),
- file_name, strerror (errno));
- return false;
+ error (_("Could not locate file. System error message: %s\n"),
+ strerror (errno));
+ goto done;
}
if (! S_ISREG (statbuf.st_mode))
{
- error (_("'%s' is not an ordinary file\n"), file_name);
- return false;
+ error (_("Not an ordinary file\n"));
+ goto done;
}
filedata = calloc (1, sizeof * filedata);
if (filedata == NULL)
{
error (_("Out of memory allocating file data structure\n"));
- return false;
+ goto done;
}
filedata->file_name = file_name;
filedata->handle = fopen (file_name, "rb");
if (filedata->handle == NULL)
{
- error (_("Input file '%s' is not readable.\n"), file_name);
- free (filedata);
- return false;
+ error (_("Not readable\n"));
+ goto done;
}
if (fread (armag, SARMAG, 1, filedata->handle) != 1)
{
- error (_("%s: Failed to read file's magic number\n"), file_name);
- fclose (filedata->handle);
- free (filedata);
- return false;
+ error (_("Failed to read file's magic number\n"));
+ goto done;
}
filedata->file_size = statbuf.st_size;
@@ -22905,33 +22912,39 @@ process_file (char * file_name)
if (memcmp (armag, ARMAG, SARMAG) == 0)
{
- if (! process_archive (filedata, false))
- ret = false;
+ if (process_archive (filedata, false))
+ ret = true;
}
else if (memcmp (armag, ARMAGT, SARMAG) == 0)
{
- if ( ! process_archive (filedata, true))
- ret = false;
+ if (process_archive (filedata, true))
+ ret = true;
}
else
{
if (do_archive_index && !check_all)
- error (_("File %s is not an archive so its index cannot be displayed.\n"),
- file_name);
+ error (_("Not an archive so its index cannot be displayed.\n"));
rewind (filedata->handle);
filedata->archive_file_size = filedata->archive_file_offset = 0;
- if (! process_object (filedata))
- ret = false;
+ if (process_object (filedata))
+ ret = true;
}
- fclose (filedata->handle);
- free (filedata->section_headers);
- free (filedata->program_headers);
- free (filedata->string_table);
- free (filedata->dump.dump_sects);
- free (filedata);
+ done:
+ if (filedata)
+ {
+ if (filedata->handle != NULL)
+ fclose (filedata->handle);
+ free (filedata->section_headers);
+ free (filedata->program_headers);
+ free (filedata->string_table);
+ free (filedata->dump.dump_sects);
+ free (filedata);
+ }
+ free (program_name);
+ program_name = saved_program_name;
free (ba_cache.strtab);
ba_cache.strtab = NULL;
Only in binutils-2.40/binutils: readelf.c.orig

View File

@ -1,330 +0,0 @@
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 13:33:21.979627285 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 13:40:26.911199033 +0000
@@ -34,5 +34,6 @@ hook called: claim_file tmpdir/libtext.a
hook called: all symbols read.
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:33:21.980627277 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:41:30.189692800 +0000
@@ -23,5 +23,3 @@ hook called: claim_file tmpdir/main.o \[
hook called: claim_file .*/ld/testsuite/ld-plugin/func.c \[@0/.* CLAIMED
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
-.*main.c.*: undefined reference to `\.?func'
-#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-14.d binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-14.d 2019-02-15 13:33:21.977627301 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d 2019-02-15 13:42:03.598430960 +0000
@@ -27,7 +27,6 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
hook called: all symbols read.
-.*: tmpdir/main.o: in function `main':
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-15.d binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-15.d 2019-02-15 13:33:21.980627277 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d 2019-02-15 13:42:28.014239600 +0000
@@ -28,7 +28,6 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
hook called: all symbols read.
-.*: tmpdir/main.o: in function `main':
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-16.d binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-16.d 2019-02-15 13:33:21.977627301 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d 2019-02-15 13:43:21.309821910 +0000
@@ -30,9 +30,8 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
hook called: all symbols read.
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
-.*: tmpdir/main.o: in function `main':
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-17.d binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-17.d 2019-02-15 13:33:21.977627301 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d 2019-02-15 13:43:54.925558451 +0000
@@ -31,7 +31,8 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
hook called: all symbols read.
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-20.d binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-20.d 2019-02-15 13:33:21.980627277 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d 2019-02-15 13:49:20.091010016 +0000
@@ -2,6 +2,5 @@ hook called: all symbols read.
Input: func.c \(tmpdir/libfunc.a\)
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
-.*: tmpdir/main.o: in function `main':
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-21.d binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-21.d 2019-02-15 13:33:21.978627293 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d 2019-02-15 13:49:34.506897033 +0000
@@ -2,6 +2,5 @@ hook called: all symbols read.
Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\)
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
-.*: tmpdir/main.o: in function `main':
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-22.d binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-22.d 2019-02-15 13:33:21.980627277 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d 2019-02-15 13:50:00.409694022 +0000
@@ -2,6 +2,5 @@ Claimed: tmpdir/libfunc.a \[@.*
hook called: all symbols read.
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
-.*: tmpdir/main.o: in function `main':
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-23.d binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-23.d 2019-02-15 13:33:21.979627285 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d 2019-02-15 13:50:14.938580156 +0000
@@ -2,6 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func.
hook called: all symbols read.
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
-.*: tmpdir/main.o: in function `main':
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-24.d binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-24.d 2019-02-15 13:33:21.980627277 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d 2019-02-15 13:49:46.346804240 +0000
@@ -2,4 +2,5 @@ hook called: all symbols read.
Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\)
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
+#...
hook called: cleanup.
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-25.d binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-25.d 2019-02-15 13:33:21.978627293 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d 2019-02-15 13:50:29.322467422 +0000
@@ -2,4 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func.
hook called: all symbols read.
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
+#...
hook called: cleanup.
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 13:33:21.977627301 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 13:45:05.343006557 +0000
@@ -1 +1,3 @@
.*: error: Error
+#...
+
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-29.d binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-29.d 2019-02-15 13:33:21.978627293 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d 2019-02-15 13:45:22.764870016 +0000
@@ -1 +1,2 @@
.*: warning: Warning
+#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-30.d binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-30.d 2019-02-15 13:33:21.976627309 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d 2019-02-15 13:48:57.067190464 +0000
@@ -24,3 +24,4 @@ hook called: claim_file tmpdir/main.o \[
hook called: claim_file tmpdir/func.o \[@0/.* not claimed
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
hook called: claim_file tmpdir/libempty.a \[@.* not claimed
+#pass
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-6.d binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-6.d 2019-02-15 13:33:21.979627285 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d 2019-02-15 13:37:14.672749977 +0000
@@ -27,7 +27,6 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
hook called: all symbols read.
-.*: tmpdir/main.o: in function `main':
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-7.d binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-7.d 2019-02-15 13:33:21.977627301 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d 2019-02-15 13:37:58.000400421 +0000
@@ -28,7 +28,6 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
hook called: all symbols read.
-.*: tmpdir/main.o: in function `main':
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 13:33:21.980627277 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 13:38:34.096109209 +0000
@@ -32,7 +32,6 @@ hook called: claim_file tmpdir/text.o \[
hook called: all symbols read.
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
-.*: tmpdir/main.o: in function `main':
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-9.d binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-9.d 2019-02-15 13:33:21.977627301 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d 2019-02-15 13:39:52.655475403 +0000
@@ -31,7 +31,8 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
hook called: all symbols read.
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/pr20070.d binutils-2.32/ld/testsuite/ld-plugin/pr20070.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/pr20070.d 2019-02-15 13:33:21.976627309 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/pr20070.d 2019-02-15 13:50:56.874251486 +0000
@@ -5,5 +5,6 @@ Sym: 'weakdef' Resolution: LDPR_PREVAILI
Sym: 'undef' Resolution: LDPR_UNDEF
Sym: 'weakundef' Resolution: LDPR_UNDEF
Sym: 'common' Resolution: LDPR_PREVAILING_DEF_IRONLY
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-srec/srec.exp binutils-2.32/ld/testsuite/ld-srec/srec.exp
--- binutils-2.32.orig/ld/testsuite/ld-srec/srec.exp 2019-02-15 13:33:21.938627615 +0000
+++ binutils-2.32/ld/testsuite/ld-srec/srec.exp 2019-02-15 13:53:58.744814006 +0000
@@ -21,6 +21,8 @@
# Get the offset from an S-record line to the start of the data.
+return
+
proc srec_off { l } {
if [string match "S1*" $l] {
return 8
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:10:59.038709514 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:13:53.532300721 +0000
@@ -32,7 +32,7 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/libtext.a \[@.* not claimed
#...
hook called: all symbols read.
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
#...
hook called: cleanup.
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-11.d binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-11.d 2019-02-15 14:10:59.041709490 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d 2019-02-15 14:14:50.061844322 +0000
@@ -35,8 +35,9 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED
#...
hook called: all symbols read.
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF
+Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:10:58.942710289 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:15:20.030602369 +0000
@@ -32,7 +32,8 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/libtext.a \[@.* not claimed
#...
hook called: all symbols read.
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-19.d binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-19.d 2019-02-15 14:10:59.024709627 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d 2019-02-15 14:15:54.926320633 +0000
@@ -35,8 +35,9 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED
#...
hook called: all symbols read.
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF
+Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY
+#...
hook called: cleanup.
#...
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 14:10:58.998709837 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 14:12:19.856057024 +0000
@@ -1,3 +1,2 @@
.*: error: Error
#...
-
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 14:10:59.074709224 +0000
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 14:11:48.144313048 +0000
@@ -30,7 +30,7 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
hook called: all symbols read.
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
#...
hook called: cleanup.
diff -rup binutils.orig/ld/testsuite/ld-elfvers/vers24.rd binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd
--- binutils.orig/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 09:45:44.013108697 +0100
+++ binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 12:06:17.287425232 +0100
@@ -7,9 +7,9 @@ Symbol table '.dynsym' contains [0-9]+ e
# And ensure the dynamic symbol table contains at least x@VERS.0
# and foo@@VERS.0 symbols
#...
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.*
#...
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.*
#...
Symbol table '.symtab' contains [0-9]+ entries:
#pass
diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin.exp binutils-2.30/ld/testsuite/ld-plugin/plugin.exp
--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 09:45:44.023108605 +0100
+++ binutils-2.30/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 11:18:53.997202105 +0100
@@ -118,6 +118,12 @@ if { $can_compile && !$failed_compile }
}
}
+# I do not know why, but the underscore prefix test is going
+# wrong on ppc64le targets. So override it here.
+if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] } {
+ set _ ""
+}
+
set testobjfiles "tmpdir/main.o tmpdir/func.o tmpdir/text.o"
set testobjfiles_notext "tmpdir/main.o tmpdir/func.o"
set testsrcfiles "tmpdir/main.o $srcdir/$subdir/func.c tmpdir/text.o"

View File

@ -1,158 +0,0 @@
From a0b911576eb49e06a457ebf757b42543d2c7e548 Mon Sep 17 00:00:00 2001
From: Luca Boccassi <luca.boccassi@microsoft.com>
Date: Wed, 21 Jul 2021 14:32:03 +0100
Subject: [PATCH] Allows linker scripts to set the SEC_READONLY flag.
* ld.texi: Document new output section type.
* ldgram.y: Add new token.
* ldlang.c: Handle the new flag.
* ldlang.h: Add readonly_section to list of section types.
* ldlex.l: Add a new identifier.
* testsuite/ld-scripts/output-section-types.t: New example linker script.
* testsuite/ld-scripts/output-section-types.d: Test driver.
* testsyute/ld-scripts/script.exp: Run the new test.
(cherry picked from commit 6b86da53d5ee2022b9065f445d23356190380746)
---
ld/ld.texi | 2 ++
ld/ldgram.y | 2 ++
ld/ldlang.c | 6 ++++++
ld/ldlang.h | 3 ++-
ld/ldlex.l | 1 +
ld/testsuite/ld-scripts/output-section-types.d | 13 +++++++++++++
ld/testsuite/ld-scripts/output-section-types.t | 7 +++++++
ld/testsuite/ld-scripts/script.exp | 1 +
8 files changed, 34 insertions(+), 1 deletion(-)
create mode 100644 ld/testsuite/ld-scripts/output-section-types.d
create mode 100644 ld/testsuite/ld-scripts/output-section-types.t
diff --git a/ld/ld.texi b/ld/ld.texi
index dd8f571d4e4..cf1e637adbf 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -5456,6 +5456,8 @@ parentheses. The following types are defined:
@item NOLOAD
The section should be marked as not loadable, so that it will not be
loaded into memory when the program is run.
+@item READONLY
+The section should be marked as read-only.
@item DSECT
@itemx COPY
@itemx INFO
diff --git a/ld/ldgram.y b/ld/ldgram.y
index dd911f46169..31e0071c6fc 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -139,6 +139,7 @@ static int error_index;
%token REGION_ALIAS
%token LD_FEATURE
%token NOLOAD DSECT COPY INFO OVERLAY
+%token READONLY
%token DEFINED TARGET_K SEARCH_DIR MAP ENTRY
%token <integer> NEXT
%token SIZEOF ALIGNOF ADDR LOADADDR MAX_K MIN_K
@@ -1123,6 +1124,7 @@ type:
| COPY { sectype = noalloc_section; }
| INFO { sectype = noalloc_section; }
| OVERLAY { sectype = noalloc_section; }
+ | READONLY { sectype = readonly_section; }
;
atype:
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 37b64c89ee1..2610be995ca 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -2639,6 +2639,9 @@ lang_add_section (lang_statement_list_type *ptr,
case noalloc_section:
flags &= ~SEC_ALLOC;
break;
+ case readonly_section:
+ flags |= SEC_READONLY;
+ break;
case noload_section:
flags &= ~SEC_LOAD;
flags |= SEC_NEVER_LOAD;
@@ -4232,6 +4235,9 @@ map_input_to_output_sections
case noalloc_section:
flags = SEC_HAS_CONTENTS;
break;
+ case readonly_section:
+ flags |= SEC_READONLY;
+ break;
case noload_section:
if (bfd_get_flavour (link_info.output_bfd)
== bfd_target_elf_flavour)
diff --git a/ld/ldlang.h b/ld/ldlang.h
index 6fbe16d97d9..f68ae27b409 100644
--- a/ld/ldlang.h
+++ b/ld/ldlang.h
@@ -121,7 +121,8 @@ enum section_type
first_overlay_section,
overlay_section,
noload_section,
- noalloc_section
+ noalloc_section,
+ readonly_section
};
/* This structure holds a list of program headers describing
diff --git a/ld/ldlex.l b/ld/ldlex.l
index c1b15263587..25b4bcaae01 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -294,6 +294,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
<BOTH,SCRIPT>"SORT_BY_INIT_PRIORITY" { RTOKEN(SORT_BY_INIT_PRIORITY); }
<BOTH,SCRIPT>"SORT_NONE" { RTOKEN(SORT_NONE); }
<EXPRESSION,BOTH,SCRIPT>"NOLOAD" { RTOKEN(NOLOAD);}
+<EXPRESSION,BOTH,SCRIPT>"READONLY" { RTOKEN(READONLY);}
<EXPRESSION,BOTH,SCRIPT>"DSECT" { RTOKEN(DSECT);}
<EXPRESSION,BOTH,SCRIPT>"COPY" { RTOKEN(COPY);}
<EXPRESSION,BOTH,SCRIPT>"INFO" { RTOKEN(INFO);}
diff --git a/ld/testsuite/ld-scripts/output-section-types.d b/ld/testsuite/ld-scripts/output-section-types.d
new file mode 100644
index 00000000000..ab124fa4dd7
--- /dev/null
+++ b/ld/testsuite/ld-scripts/output-section-types.d
@@ -0,0 +1,13 @@
+#ld: -Toutput-section-types.t
+#source: align2a.s
+#objdump: -h
+#target: [is_elf_format]
+
+#...
+ . \.rom.*
+[ ]+ALLOC, READONLY
+ . \.ro.*
+[ ]+CONTENTS, ALLOC, LOAD, READONLY, DATA
+ . \.over.*
+[ ]+CONTENTS, READONLY
+#pass
diff --git a/ld/testsuite/ld-scripts/output-section-types.t b/ld/testsuite/ld-scripts/output-section-types.t
new file mode 100644
index 00000000000..d8fdfda1a03
--- /dev/null
+++ b/ld/testsuite/ld-scripts/output-section-types.t
@@ -0,0 +1,7 @@
+SECTIONS {
+ .rom (NOLOAD) : { LONG(1234); }
+ .ro (READONLY) : { LONG(5678); }
+ .over (OVERLAY) : { LONG(0123); }
+ /DISCARD/ : { *(*) }
+
+}
diff --git a/ld/testsuite/ld-scripts/script.exp b/ld/testsuite/ld-scripts/script.exp
index 961cd08c4b1..ff50199b3ae 100644
--- a/ld/testsuite/ld-scripts/script.exp
+++ b/ld/testsuite/ld-scripts/script.exp
@@ -229,6 +229,7 @@ foreach test_script $test_script_list {
run_dump_test "align-with-input"
run_dump_test "pr20302"
+run_dump_test "output-section-types"
run_dump_test "segment-start" {{name (default)}}
run_dump_test "segment-start" {{name (overridden)} \
--
2.30.2

View File

@ -1,44 +0,0 @@
--- binutils.orig/binutils/objcopy.c 2023-01-16 12:15:46.405649346 +0000
+++ binutils-2.39/binutils/objcopy.c 2023-01-16 12:16:48.892667868 +0000
@@ -2383,6 +2383,8 @@ merge_gnu_build_notes (bfd * ab
other note then if they are both of the same type (open
or func) then they can be merged and one deleted. If
they are of different types then they cannot be merged. */
+ objcopy_internal_note * prev_note = NULL;
+
for (pnote = pnotes; pnote < pnotes_end; pnote ++)
{
/* Skip already deleted notes.
@@ -2404,7 +2406,9 @@ merge_gnu_build_notes (bfd * ab
objcopy_internal_note * back;
/* Rule 2: Check to see if there is an identical previous note. */
- for (iter = 0, back = pnote - 1; back >= pnotes; back --)
+ for (iter = 0, back = prev_note ? prev_note : pnote - 1;
+ back >= pnotes;
+ back --)
{
if (is_deleted_note (back))
continue;
@@ -2466,11 +2470,18 @@ merge_gnu_build_notes (bfd * ab
break;
}
}
-#if DEBUG_MERGE
+
+
if (! is_deleted_note (pnote))
- merge_debug ("Unable to do anything with note at %#08lx\n",
- (pnote->note.namedata - (char *) contents) - 12);
+ {
+ /* Keep a pointer to this note, so that we can
+ start the next search for rule 2 matches here. */
+ prev_note = pnote;
+#if DEBUG_MERGE
+ merge_debug ("Unable to do anything with note at %#08lx\n",
+ (pnote->note.namedata - (char *) contents) - 12);
#endif
+ }
}
/* Resort the notes. */

View File

@ -1,35 +0,0 @@
--- binutils.orig/binutils/readelf.c 2020-07-24 15:08:30.317597020 +0100
+++ binutils-2.35/binutils/readelf.c 2020-07-24 15:09:39.029155552 +0100
@@ -12069,11 +12069,13 @@ print_dynamic_symbol (Filedata *filedata
unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
printf (" %-7s", get_symbol_visibility (vis));
+#if 0
/* Check to see if any other bits in the st_other field are set.
Note - displaying this information disrupts the layout of the
table being generated, but for the moment this case is very rare. */
if (psym->st_other ^ vis)
printf (" [%s] ", get_symbol_other (filedata, psym->st_other ^ vis));
+#endif
}
printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx));
@@ -12112,7 +12114,17 @@ print_dynamic_symbol (Filedata *filedata
version_string);
}
- putchar ('\n');
+#if 1
+ {
+ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
+
+ /* Check to see if any other bits in the st_other field are set. */
+ if (psym->st_other ^ vis)
+ printf (" \t[%s]", get_symbol_other (filedata, psym->st_other ^ vis));
+ }
+#endif
+
+ putchar ('\n');
if (ELF_ST_BIND (psym->st_info) == STB_LOCAL
&& section != NULL

View File

@ -1,50 +0,0 @@
--- binutils.orig/bfd/elf.c 2023-03-30 10:01:40.824181703 +0100
+++ binutils-2.40/bfd/elf.c 2023-03-30 10:02:23.103135337 +0100
@@ -3877,21 +3877,23 @@ assign_section_numbers (bfd *abfd, struc
{
case SHT_REL:
case SHT_RELA:
- /* A reloc section which we are treating as a normal BFD
- section. sh_link is the section index of the symbol
- table. sh_info is the section index of the section to
- which the relocation entries apply. We assume that an
- allocated reloc section uses the dynamic symbol table
- if there is one. Otherwise we guess the normal symbol
- table. FIXME: How can we be sure? */
- if (d->this_hdr.sh_link == 0 && (sec->flags & SEC_ALLOC) != 0)
+ /* sh_link is the section index of the symbol table.
+ sh_info is the section index of the section to which the
+ relocation entries apply. */
+ if (d->this_hdr.sh_link == 0)
{
- s = bfd_get_section_by_name (abfd, ".dynsym");
- if (s != NULL)
- d->this_hdr.sh_link = elf_section_data (s)->this_idx;
+ /* FIXME maybe: If this is a reloc section which we are
+ treating as a normal section then we likely should
+ not be assuming its sh_link is .dynsym or .symtab. */
+ if ((sec->flags & SEC_ALLOC) != 0)
+ {
+ s = bfd_get_section_by_name (abfd, ".dynsym");
+ if (s != NULL)
+ d->this_hdr.sh_link = elf_section_data (s)->this_idx;
+ }
+ else
+ d->this_hdr.sh_link = elf_onesymtab (abfd);
}
- if (d->this_hdr.sh_link == 0)
- d->this_hdr.sh_link = elf_onesymtab (abfd);
s = elf_get_reloc_section (sec);
if (s != NULL)
--- binutils.orig/binutils/objcopy.c 2023-03-30 10:01:41.063181441 +0100
+++ binutils-2.40/binutils/objcopy.c 2023-03-30 12:25:41.439108276 +0100
@@ -2256,7 +2256,7 @@ merge_gnu_build_notes (bfd * ab
{
if (pnote->note.namedata[4] == '2')
++ version_2_seen;
- else if (pnote->note.namedata[4] == '3')
+ else if (pnote->note.namedata[4] == '3' || pnote->note.namedata[4] == '4')
++ version_3_seen;
else
{

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,31 @@
diff -rup binutils.orig/ld/ld.1 binutils-2.38/ld/ld.1 diff -rup binutils.orig/ld/ld.1 binutils-2.41/ld/ld.1
--- binutils.orig/ld/ld.1 2022-05-27 10:56:44.937044892 +0100 --- binutils.orig/ld/ld.1 2023-08-03 12:47:14.427004953 +0100
+++ binutils-2.38/ld/ld.1 2022-05-27 11:10:50.311802310 +0100 +++ binutils-2.41/ld/ld.1 2023-08-03 12:49:10.672145873 +0100
@@ -2595,7 +2595,7 @@ systems may not understand them. If you @@ -2669,7 +2669,7 @@ systems may not understand them. If you
\&\fB\-\-enable\-new\-dtags\fR, the new dynamic tags will be created as needed \&\fB\-\-enable\-new\-dtags\fR, the new dynamic tags will be created as needed
and older dynamic tags will be omitted. and older dynamic tags will be omitted.
If you specify \fB\-\-disable\-new\-dtags\fR, no new dynamic tags will be If you specify \fB\-\-disable\-new\-dtags\fR, no new dynamic tags will be
-created. By default, the new dynamic tags are not created. Note that -created. By default, the new dynamic tags are not created. Note that
+created. By default, the new dynamic tags are created. Note that +created. By default, the new dynamic tags are created. Note that
those options are only available for \s-1ELF\s0 systems. those options are only available for ELF systems.
.IP "\fB\-\-hash\-size=\fR\fInumber\fR" 4 .IP \fB\-\-hash\-size=\fR\fInumber\fR 4
.IX Item "--hash-size=number" .IX Item "--hash-size=number"
diff -rup binutils.orig/ld/ld.info binutils-2.38/ld/ld.info diff -rup binutils.orig/ld/ld.info binutils-2.41/ld/ld.info
--- binutils.orig/ld/ld.info 2022-05-27 11:01:12.286346357 +0100 --- binutils.orig/ld/ld.info 2023-08-03 12:47:14.427004953 +0100
+++ binutils-2.38/ld/ld.info 2022-05-27 11:11:24.585709176 +0100 +++ binutils-2.41/ld/ld.info 2023-08-03 12:49:58.829204257 +0100
@@ -2236,7 +2236,7 @@ GNU linker: @@ -2366,7 +2366,7 @@ GNU linker:
'--enable-new-dtags', the new dynamic tags will be created as --enable-new-dtags, the new dynamic tags will be created as
needed and older dynamic tags will be omitted. If you specify needed and older dynamic tags will be omitted. If you specify
'--disable-new-dtags', no new dynamic tags will be created. By --disable-new-dtags, no new dynamic tags will be created. By
- default, the new dynamic tags are not created. Note that those - default, the new dynamic tags are not created. Note that those
+ default, the new dynamic tags are created. Note that those + default, the new dynamic tags are created. Note that those
options are only available for ELF systems. options are only available for ELF systems.
'--hash-size=NUMBER' --hash-size=NUMBER
diff -rup binutils.orig/ld/ld.texi binutils-2.38/ld/ld.texi diff -rup binutils.orig/ld/ld.texi binutils-2.41/ld/ld.texi
--- binutils.orig/ld/ld.texi 2022-05-27 11:01:24.081314960 +0100 --- binutils.orig/ld/ld.texi 2023-08-03 12:50:58.176276215 +0100
+++ binutils-2.38/ld/ld.texi 2022-05-27 11:10:05.608923798 +0100 +++ binutils-2.41/ld/ld.texi 2023-08-03 12:41:11.902610960 +0100
@@ -2796,7 +2796,7 @@ systems may not understand them. If you @@ -2946,7 +2946,7 @@ systems may not understand them. If you
@option{--enable-new-dtags}, the new dynamic tags will be created as needed @option{--enable-new-dtags}, the new dynamic tags will be created as needed
and older dynamic tags will be omitted. and older dynamic tags will be omitted.
If you specify @option{--disable-new-dtags}, no new dynamic tags will be If you specify @option{--disable-new-dtags}, no new dynamic tags will be

View File

@ -1,8 +1,8 @@
Summary: A GNU collection of binary utilities Summary: A GNU collection of binary utilities
Name: binutils%{?_with_debug:-debug} Name: binutils%{?_with_debug:-debug}
Version: 2.40 Version: 2.41
Release: 13%{?dist} Release: 1%{?dist}
License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later LGPL-2.1-or-later AND LGPL-2.0-or-later License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later LGPL-2.1-or-later AND LGPL-2.0-or-later
URL: https://sourceware.org/binutils URL: https://sourceware.org/binutils
@ -187,103 +187,66 @@ Patch03: binutils-export-demangle.h.patch
# order. # order.
Patch04: binutils-no-config-h-check.patch Patch04: binutils-no-config-h-check.patch
# Purpose: Include the filename concerned in readelf error and warning
# messages. This helps when readelf is run with multiple
# input files or when multiple instances of readelf are
# running at the same time.
# Lifetime: Permanent. This patch changes the format of readelf's output,
# making it better (IMHO) but also potentially breaking tools that
# depend upon readelf's current output format. cf/ Patch07.
# It also tends to break parts of the binutils own
# testsuite. Hence the patch remains local for now.
Patch05: binutils-filename-in-readelf-messages.patch
# Purpose: Disable an x86/x86_64 optimization that moves functions from the # Purpose: Disable an x86/x86_64 optimization that moves functions from the
# PLT into the GOTPLT for faster access. This optimization is # PLT into the GOTPLT for faster access. This optimization is
# problematic for tools that want to intercept PLT entries, such # problematic for tools that want to intercept PLT entries, such
# as ltrace and LD_AUDIT. See BZs 1452111 and 1333481. # as ltrace and LD_AUDIT. See BZs 1452111 and 1333481.
# Lifetime: Permanent. But it should not be. # Lifetime: Permanent. But it should not be.
# FIXME: Replace with a configure time option. # FIXME: Replace with a configure time option.
Patch06: binutils-revert-PLT-elision.patch Patch05: binutils-revert-PLT-elision.patch
# Purpose: Changes readelf so that when it displays extra information about
# a symbol, this information is placed at the end of the line.
# Lifetime: Permanent. cf/ Patch05.
# FIXME: The proper fix would be to update the scripts that are expecting
# a fixed output from readelf. But it seems that some of them are
# no longer being maintained.
Patch07: binutils-readelf-other-sym-info.patch
# Purpose: Do not create PLT entries for AARCH64 IFUNC symbols referenced in # Purpose: Do not create PLT entries for AARCH64 IFUNC symbols referenced in
# debug sections. # debug sections.
# Lifetime: Permanent. # Lifetime: Permanent.
# FIXME: Find related bug. Decide on permanency. # FIXME: Find related bug. Decide on permanency.
Patch08: binutils-2.27-aarch64-ifunc.patch Patch06: binutils-2.27-aarch64-ifunc.patch
# Purpose: Stop the binutils from statically linking with libstdc++. # Purpose: Stop the binutils from statically linking with libstdc++.
# Lifetime: Permanent. # Lifetime: Permanent.
Patch09: binutils-do-not-link-with-static-libstdc++.patch Patch07: binutils-do-not-link-with-static-libstdc++.patch
# Purpose: Allow OS specific sections in section groups. # Purpose: Allow OS specific sections in section groups.
# Lifetime: Fixed in 2.39 (maybe) # Lifetime: Fixed in 2.42 (maybe)
Patch10: binutils-special-sections-in-groups.patch Patch08: binutils-special-sections-in-groups.patch
# Purpose: Fix linker testsuite failures.
# Lifetime: Fixed in 2.39 (maybe)
Patch11: binutils-fix-testsuite-failures.patch
# Purpose: Stop gold from aborting when input sections with the same name # Purpose: Stop gold from aborting when input sections with the same name
# have different flags. # have different flags.
# Lifetime: Fixed in 2.39 (maybe) # Lifetime: Fixed in 2.42 (maybe)
Patch12: binutils-gold-mismatched-section-flags.patch Patch09: binutils-gold-mismatched-section-flags.patch
# Purpose: Change the gold configuration script to only warn about # Purpose: Change the gold configuration script to only warn about
# unsupported targets. This allows the binutils to be built with # unsupported targets. This allows the binutils to be built with
# BPF support enabled. # BPF support enabled.
# Lifetime: Permanent. # Lifetime: Permanent.
Patch13: binutils-gold-warn-unsupported.patch Patch10: binutils-gold-warn-unsupported.patch
# Purpose: Enable the creation of .note.gnu.property sections by the GOLD # Purpose: Enable the creation of .note.gnu.property sections by the GOLD
# linker for x86 binaries. # linker for x86 binaries.
# Lifetime: Permanent. # Lifetime: Permanent.
Patch14: binutils-gold-i386-gnu-property-notes.patch Patch11: binutils-gold-i386-gnu-property-notes.patch
# Purpose: Allow the binutils to be configured with any (recent) version of # Purpose: Allow the binutils to be configured with any (recent) version of
# autoconf. # autoconf.
# Lifetime: Fixed in 2.39 (maybe ?) # Lifetime: Fixed in 2.42 (maybe ?)
Patch15: binutils-autoconf-version.patch Patch12: binutils-autoconf-version.patch
# Purpose: Stop libtool from inserting useless runpaths into binaries. # Purpose: Stop libtool from inserting useless runpaths into binaries.
# Lifetime: Who knows. # Lifetime: Who knows.
Patch16: binutils-libtool-no-rpath.patch Patch13: binutils-libtool-no-rpath.patch
%if %{enable_new_dtags} %if %{enable_new_dtags}
# Purpose: Change ld man page so that it says that --enable-new-dtags is the default. # Purpose: Change ld man page so that it says that --enable-new-dtags is the default.
# Lifetime: Permanent # Lifetime: Permanent
Patch17: binutils-update-linker-manual.patch Patch14: binutils-update-linker-manual.patch
%endif %endif
# Purpose: Speed up objcopy's note merging algorithm.
# Lifetime: Fixed in 2.41
Patch18: binutils-objcopy-note-merge-speedup.patch
# Purpose: Fix testsuite failures due to the patches applied here.
# Lifetime: Permanent, but varying with each new rebase.
Patch19: binutils-testsuite-fixes.patch
# Purpose: Stop the linker from associating allocated reloc sections with
# the .symtab section , which prevents it from being stripped.
# Lifetime: Fixed in 2.41
Patch20: binutils-reloc-symtab.patch
# Purpose: Stop an illegal memory access in the BFD library when loading
# a file with corrupt symbol version information.
# Lifetime: Fixed in 2.41
Patch21: binutils-CVE-2023-1972.patch
# Purpose: Stop an abort when using dwp to process a file with no dwo links. # Purpose: Stop an abort when using dwp to process a file with no dwo links.
# Lifetime: Fixed in 2.41 (maybe) # Lifetime: Fixed in 2.42 (maybe)
Patch22: binutils-gold-empty-dwp.patch Patch15: binutils-gold-empty-dwp.patch
# Purpose: Fix binutils testsuite failures.
# Lifetime: Permanent, but varies with each rebase.
Patch16: binutils-testsuite-fixes.patch
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@ -983,11 +946,11 @@ install_binutils()
%set_build_flags %set_build_flags
%make_build -s CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C libsframe %make_build -s CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C libsframe
install -m 644 bfd/libbfd.a $local_libdir install -m 644 bfd/.libs/libbfd.a $local_libdir
install -m 644 libiberty/libiberty.a $local_libdir install -m 644 libiberty/libiberty.a $local_libdir
install -m 644 ../include/libiberty.h $local_incdir install -m 644 ../include/libiberty.h $local_incdir
install -m 644 opcodes/libopcodes.a $local_libdir install -m 644 opcodes/.libs/libopcodes.a $local_libdir
install -m 644 libsframe/.libs/libsframe.a $local_libdir install -m 644 libsframe/.libs/libsframe.a $local_libdir
# Remove Windows/Novell only man pages # Remove Windows/Novell only man pages
rm -f $local_mandir/{dlltool,nlmconv,windres,windmc}* rm -f $local_mandir/{dlltool,nlmconv,windres,windmc}*
@ -1207,6 +1170,7 @@ exit 0
%{_infodir}/as.info.* %{_infodir}/as.info.*
%{_infodir}/binutils.info.* %{_infodir}/binutils.info.*
%{_infodir}/ld.info.* %{_infodir}/ld.info.*
%{_infodir}/ldint.info.*
%{_infodir}/bfd.info.* %{_infodir}/bfd.info.*
%{_infodir}/ctf-spec.info.* %{_infodir}/ctf-spec.info.*
%{_infodir}/gprof.info.* %{_infodir}/gprof.info.*
@ -1283,6 +1247,16 @@ exit 0
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
%changelog %changelog
* Thu Aug 03 2023 Nick Clifton <nickc@redhat.com> - 2.41-1
- Rebase to GNU Binutils 2.41
# Patch05: binutils-filename-in-readelf-messages.patch
# Patch07: binutils-readelf-other-sym-info.patch
# Patch11: binutils-fix-testsuite-failures.patch
# Patch18: binutils-objcopy-note-merge-speedup.patch
# Patch19: binutils-testsuite-fixes.patch
# Patch20: binutils-reloc-symtab.patch
# Patch21: binutils-CVE-2023-1972.patch
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.40-13 * Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.40-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

View File

@ -1,2 +1 @@
SHA512 (binutils-2.40.tar.xz) = a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925 SHA512 (binutils-2.41.tar.xz) = 5df45d0bd6ddabdce4f35878c041e46a92deef01e7dea5facc97fd65cc06b59abc6fba0eb454b68e571c7e14038dc823fe7f2263843e6e627b7444eaf0fe9374
SHA512 (binutils-2.19.50.0.1-output-format.sed) = 2f8686b0c8af13c98cda056824c2820416f6e2d003f70b78ccf5314525b9ee3684d421dfa83e638a2d42d06ea4d4bdaf5226b64d6ec26f7ff59c44ffb2a23dd2