Compare commits
18 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df9930c499 | ||
|
|
60770ef640 | ||
|
|
9453e052cb | ||
|
|
d5e26557c0 | ||
|
|
cb2a69bec8 | ||
|
|
24c7b32b54 | ||
|
|
7618a617e4 | ||
|
|
194ce4587a | ||
|
|
e2ebfdec9c | ||
|
|
fbb1ff01e1 | ||
|
|
da7aec4303 | ||
|
|
e133a50bdb | ||
|
|
1102847cef | ||
|
|
ec0a641b82 | ||
|
|
9da135ced5 | ||
|
|
2b38102265 | ||
|
|
cc5aeae8c4 | ||
|
|
baf7bf2038 |
78 changed files with 69834 additions and 3917 deletions
10
.gitignore
vendored
10
.gitignore
vendored
|
|
@ -1,8 +1,6 @@
|
|||
*.diff
|
||||
*.orig
|
||||
*.rej
|
||||
*.sed
|
||||
*.xz
|
||||
|
||||
*~
|
||||
.#*
|
||||
|
|
@ -63,8 +61,8 @@ stamp-*
|
|||
/mpc*
|
||||
/gmp*
|
||||
/isl*
|
||||
/binutils-2.34.0-5dfc0c955dbe912cd328fc2688e5fceb3239ac2a.tar.xz
|
||||
/binutils-2.19.50.0.1-output-format.sed
|
||||
/binutils-2.44.50-13.fc43.src.rpm
|
||||
/binutils-with-gold-2.45.50-be970c68891.tar.gz
|
||||
/binutils-with-gold-2.45.50-ba5838a98fb.tar.gz
|
||||
/binutils-2.47.50-1.fc46.src.rpm
|
||||
/binutils-2.35.tar.xz
|
||||
/binutils-2.35.1.tar.xz
|
||||
/binutils-2.35.2.tar.xz
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
diff -rup binutils.orig/bfd/Makefile.am binutils-2.38/bfd/Makefile.am
|
||||
--- binutils.orig/bfd/Makefile.am 2022-02-09 14:10:42.659300681 +0000
|
||||
+++ binutils-2.38/bfd/Makefile.am 2022-02-09 14:12:40.562532916 +0000
|
||||
@@ -977,8 +977,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
|
||||
--- binutils-2.26.orig/bfd/Makefile.am 2016-01-25 10:11:33.505289018 +0000
|
||||
+++ binutils-2.26/bfd/Makefile.am 2016-01-25 10:13:23.489964145 +0000
|
||||
@@ -1043,8 +1043,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
|
||||
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
|
||||
$(AM_V_GEN)\
|
||||
bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
@echo "creating $@"
|
||||
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
- bfd_version_string="\"$(VERSION)\"" ;\
|
||||
- bfd_soversion="$(VERSION)" ;\
|
||||
+ bfd_version_string="\"$(VERSION)-%{release}\"" ;\
|
||||
|
|
@ -12,7 +11,7 @@ diff -rup binutils.orig/bfd/Makefile.am binutils-2.38/bfd/Makefile.am
|
|||
bfd_version_package="\"$(PKGVERSION)\"" ;\
|
||||
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
|
||||
. $(srcdir)/development.sh ;\
|
||||
@@ -989,7 +989,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
@@ -1055,7 +1055,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
fi ;\
|
||||
$(SED) -e "s,@bfd_version@,$$bfd_version," \
|
||||
-e "s,@bfd_version_string@,$$bfd_version_string," \
|
||||
|
|
@ -21,13 +20,12 @@ diff -rup binutils.orig/bfd/Makefile.am binutils-2.38/bfd/Makefile.am
|
|||
-e "s,@report_bugs_to@,$$report_bugs_to," \
|
||||
< $(srcdir)/version.h > $@; \
|
||||
echo "$${bfd_soversion}" > libtool-soversion
|
||||
diff -rup binutils.orig/bfd/Makefile.in binutils-2.38/bfd/Makefile.in
|
||||
--- binutils.orig/bfd/Makefile.in 2022-02-09 14:10:42.653300720 +0000
|
||||
+++ binutils-2.38/bfd/Makefile.in 2022-02-09 14:19:03.362040188 +0000
|
||||
@@ -2094,8 +2094,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC
|
||||
--- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:11:33.505289018 +0000
|
||||
+++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:14:17.818297941 +0000
|
||||
@@ -2111,8 +2111,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
|
||||
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
|
||||
$(AM_V_GEN)\
|
||||
bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
@echo "creating $@"
|
||||
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
- bfd_version_string="\"$(VERSION)\"" ;\
|
||||
- bfd_soversion="$(VERSION)" ;\
|
||||
+ bfd_version_string="\"$(VERSION)-%{release}\"" ;\
|
||||
|
|
@ -35,7 +33,7 @@ diff -rup binutils.orig/bfd/Makefile.in binutils-2.38/bfd/Makefile.in
|
|||
bfd_version_package="\"$(PKGVERSION)\"" ;\
|
||||
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
|
||||
. $(srcdir)/development.sh ;\
|
||||
@@ -2106,7 +2106,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
@@ -2123,7 +2123,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
fi ;\
|
||||
$(SED) -e "s,@bfd_version@,$$bfd_version," \
|
||||
-e "s,@bfd_version_string@,$$bfd_version_string," \
|
||||
145
binutils-2.29-filename-in-error-messages.patch
Normal file
145
binutils-2.29-filename-in-error-messages.patch
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
--- binutils.orig/binutils/readelf.c 2020-07-24 14:55:25.163647522 +0100
|
||||
+++ binutils-2.35/binutils/readelf.c 2020-07-24 15:02:39.613851369 +0100
|
||||
@@ -20729,79 +20729,92 @@ process_file (char * file_name)
|
||||
Filedata * filedata = NULL;
|
||||
struct stat statbuf;
|
||||
char armag[SARMAG];
|
||||
- bfd_boolean ret = TRUE;
|
||||
+ bfd_boolean 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);
|
||||
+ error (_("Failed to read file's magic number\n"));
|
||||
fclose (filedata->handle);
|
||||
- free (filedata);
|
||||
- return FALSE;
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
filedata->file_size = (bfd_size_type) statbuf.st_size;
|
||||
|
||||
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)
|
||||
+ {
|
||||
+ 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;
|
||||
--- binutils.orig/binutils/readelf.c 2021-01-07 12:59:35.802994842 +0000
|
||||
+++ binutils-2.35.1/binutils/readelf.c 2021-01-07 13:02:36.591754005 +0000
|
||||
@@ -20818,7 +20818,8 @@ process_file (char * file_name)
|
||||
done:
|
||||
if (filedata)
|
||||
{
|
||||
- fclose (filedata->handle);
|
||||
+ if (filedata->handle != NULL)
|
||||
+ fclose (filedata->handle);
|
||||
free (filedata->section_headers);
|
||||
free (filedata->program_headers);
|
||||
free (filedata->string_table);
|
||||
--- binutils.orig/binutils/readelf.c 2021-01-08 17:01:23.573093204 +0000
|
||||
+++ binutils-2.35.1/binutils/readelf.c 2021-01-08 17:02:23.095677242 +0000
|
||||
@@ -20787,7 +20787,6 @@ process_file (char * file_name)
|
||||
if (fread (armag, SARMAG, 1, filedata->handle) != 1)
|
||||
{
|
||||
error (_("Failed to read file's magic number\n"));
|
||||
- fclose (filedata->handle);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
|
@ -67,6 +67,18 @@ diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.29.1/ld/tes
|
|||
#...
|
||||
+0x[0-9a-f]+ +\(PLTREL.*
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 13:32:39.405064420 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 15:06:53.694623801 +0000
|
||||
@@ -1,7 +1,4 @@
|
||||
-#...
|
||||
-Disassembly of section .plt.got:
|
||||
|
||||
-[a-f0-9]+ <[a-z_]+@plt>:
|
||||
-[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <.*>
|
||||
+#...
|
||||
[ ]*[a-f0-9]+: 90 nop
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 13:32:39.407064397 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 15:06:17.244054423 +0000
|
||||
|
|
@ -123,6 +135,82 @@ diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.29.1/ld
|
|||
0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 13:32:39.408064384 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 15:19:48.097433680 +0000
|
||||
@@ -19,7 +19,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 13:32:39.401064469 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 15:10:56.077760324 +0000
|
||||
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 13:32:39.405064420 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 15:10:42.828916844 +0000
|
||||
@@ -19,6 +19,7 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
+#pass
|
||||
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 13:32:39.416064288 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 15:11:11.550577531 +0000
|
||||
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 13:32:39.411064348 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 15:09:52.664509478 +0000
|
||||
@@ -19,7 +19,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 13:32:39.413064324 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 15:11:22.975442559 +0000
|
||||
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 13:32:39.417064276 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 15:05:02.950932110 +0000
|
||||
|
|
@ -165,3 +253,13 @@ diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.29.1/ld/tes
|
|||
0+18 00000010 0000001c FDE cie=00000000 pc=00000128..00000133
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2020-07-24 14:55:25.370646189 +0100
|
||||
+++ binutils-2.35/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2020-07-24 15:06:58.124189348 +0100
|
||||
@@ -1,7 +1,3 @@
|
||||
#...
|
||||
-Disassembly of section .plt.got:
|
||||
-
|
||||
-[a-f0-9]+ <[_a-z]+@plt>:
|
||||
[ ]*[a-f0-9]+: f3 0f 1e fa endbr64
|
||||
-[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <.*>
|
||||
#pass
|
||||
13035
binutils-2.35.1-update.patch
Normal file
13035
binutils-2.35.1-update.patch
Normal file
File diff suppressed because it is too large
Load diff
15
binutils-CVE-2019-1010204.patch
Normal file
15
binutils-CVE-2019-1010204.patch
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
--- binutils.orig/gold/fileread.cc 2019-08-06 14:22:08.669313110 +0100
|
||||
+++ binutils-2.32/gold/fileread.cc 2019-08-06 14:22:28.799177543 +0100
|
||||
@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_
|
||||
ssize_t bytes;
|
||||
if (this->whole_file_view_ != NULL)
|
||||
{
|
||||
+ // See PR 23765 for an example of a testcase that triggers this error.
|
||||
+ if (((ssize_t) start) < 0)
|
||||
+ gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
|
||||
+ this->filename().c_str(),
|
||||
+ static_cast<long long>(start));
|
||||
+
|
||||
bytes = this->size_ - start;
|
||||
if (static_cast<section_size_type>(bytes) >= size)
|
||||
{
|
||||
53
binutils-CVE-2020-35448.patch
Normal file
53
binutils-CVE-2020-35448.patch
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
diff -rup binutils.orig/bfd/elf.c binutils-2.35/bfd/elf.c
|
||||
--- binutils.orig/bfd/elf.c 2021-04-19 10:49:21.757290990 +0100
|
||||
+++ binutils-2.35/bfd/elf.c 2021-04-19 10:50:28.309839285 +0100
|
||||
@@ -12534,7 +12534,9 @@ _bfd_elf_slurp_secondary_reloc_section (
|
||||
Elf_Internal_Shdr * hdr = & elf_section_data (relsec)->this_hdr;
|
||||
|
||||
if (hdr->sh_type == SHT_SECONDARY_RELOC
|
||||
- && hdr->sh_info == (unsigned) elf_section_data (sec)->this_idx)
|
||||
+ && hdr->sh_info == (unsigned) elf_section_data (sec)->this_idx
|
||||
+ && (hdr->sh_entsize == ebd->s->sizeof_rel
|
||||
+ || hdr->sh_entsize == ebd->s->sizeof_rela))
|
||||
{
|
||||
bfd_byte * native_relocs;
|
||||
bfd_byte * native_reloc;
|
||||
diff -rup binutils.orig/bfd/elfcode.h binutils-2.35/bfd/elfcode.h
|
||||
--- binutils.orig/bfd/elfcode.h 2021-04-19 10:49:21.767290922 +0100
|
||||
+++ binutils-2.35/bfd/elfcode.h 2021-04-19 10:52:22.196066303 +0100
|
||||
@@ -568,7 +568,7 @@ elf_object_p (bfd *abfd)
|
||||
|
||||
/* If this is a relocatable file and there is no section header
|
||||
table, then we're hosed. */
|
||||
- if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_type == ET_REL)
|
||||
+ if (i_ehdrp->e_shoff < sizeof (x_ehdr) && i_ehdrp->e_type == ET_REL)
|
||||
goto got_wrong_format_error;
|
||||
|
||||
/* As a simple sanity check, verify that what BFD thinks is the
|
||||
@@ -578,7 +578,7 @@ elf_object_p (bfd *abfd)
|
||||
goto got_wrong_format_error;
|
||||
|
||||
/* Further sanity check. */
|
||||
- if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_shnum != 0)
|
||||
+ if (i_ehdrp->e_shoff < sizeof (x_ehdr) && i_ehdrp->e_shnum != 0)
|
||||
goto got_wrong_format_error;
|
||||
|
||||
ebd = get_elf_backend_data (abfd);
|
||||
@@ -615,7 +615,7 @@ elf_object_p (bfd *abfd)
|
||||
&& ebd->elf_osabi != ELFOSABI_NONE)
|
||||
goto got_wrong_format_error;
|
||||
|
||||
- if (i_ehdrp->e_shoff != 0)
|
||||
+ if (i_ehdrp->e_shoff >= sizeof (x_ehdr))
|
||||
{
|
||||
file_ptr where = (file_ptr) i_ehdrp->e_shoff;
|
||||
|
||||
@@ -807,7 +807,7 @@ elf_object_p (bfd *abfd)
|
||||
}
|
||||
}
|
||||
|
||||
- if (i_ehdrp->e_shstrndx != 0 && i_ehdrp->e_shoff != 0)
|
||||
+ if (i_ehdrp->e_shstrndx != 0 && i_ehdrp->e_shoff >= sizeof (x_ehdr))
|
||||
{
|
||||
unsigned int num_sec;
|
||||
|
||||
1310
binutils-CVE-2021-20197.patch
Normal file
1310
binutils-CVE-2021-20197.patch
Normal file
File diff suppressed because it is too large
Load diff
58
binutils-CVE-2021-20284.patch
Normal file
58
binutils-CVE-2021-20284.patch
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.35.1/bfd/elf-bfd.h
|
||||
--- binutils.orig/bfd/elf-bfd.h 2021-03-12 12:20:04.495125388 +0000
|
||||
+++ binutils-2.35.1/bfd/elf-bfd.h 2021-03-12 12:21:25.696583280 +0000
|
||||
@@ -1562,7 +1562,7 @@ struct elf_backend_data
|
||||
const char *, unsigned int);
|
||||
|
||||
/* Called when after loading the normal relocs for a section. */
|
||||
- bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **);
|
||||
+ bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **, bfd_boolean);
|
||||
|
||||
/* Called after writing the normal relocs for a section. */
|
||||
bfd_boolean (*write_secondary_relocs) (bfd *, asection *);
|
||||
@@ -2909,7 +2909,7 @@ extern bfd_boolean is_debuginfo_file (bf
|
||||
extern bfd_boolean _bfd_elf_init_secondary_reloc_section
|
||||
(bfd *, Elf_Internal_Shdr *, const char *, unsigned int);
|
||||
extern bfd_boolean _bfd_elf_slurp_secondary_reloc_section
|
||||
- (bfd *, asection *, asymbol **);
|
||||
+(bfd *, asection *, asymbol **, bfd_boolean);
|
||||
extern bfd_boolean _bfd_elf_copy_special_section_fields
|
||||
(const bfd *, bfd *, const Elf_Internal_Shdr *, Elf_Internal_Shdr *);
|
||||
extern bfd_boolean _bfd_elf_write_secondary_reloc_section
|
||||
diff -rup binutils.orig/bfd/elf.c binutils-2.35.1/bfd/elf.c
|
||||
--- binutils.orig/bfd/elf.c 2021-03-12 12:20:04.496125381 +0000
|
||||
+++ binutils-2.35.1/bfd/elf.c 2021-03-12 12:20:46.032848074 +0000
|
||||
@@ -12513,7 +12513,8 @@ _bfd_elf_init_secondary_reloc_section (b
|
||||
bfd_boolean
|
||||
_bfd_elf_slurp_secondary_reloc_section (bfd * abfd,
|
||||
asection * sec,
|
||||
- asymbol ** symbols)
|
||||
+ asymbol ** symbols,
|
||||
+ bfd_boolean dynamic)
|
||||
{
|
||||
const struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
|
||||
asection * relsec;
|
||||
@@ -12590,7 +12591,10 @@ _bfd_elf_slurp_secondary_reloc_section (
|
||||
continue;
|
||||
}
|
||||
|
||||
- symcount = bfd_get_symcount (abfd);
|
||||
+ if (dynamic)
|
||||
+ symcount = bfd_get_dynamic_symcount (abfd);
|
||||
+ else
|
||||
+ symcount = bfd_get_symcount (abfd);
|
||||
|
||||
for (i = 0, internal_reloc = internal_relocs,
|
||||
native_reloc = native_relocs;
|
||||
diff -rup binutils.orig/bfd/elfcode.h binutils-2.35.1/bfd/elfcode.h
|
||||
--- binutils.orig/bfd/elfcode.h 2021-03-12 12:20:04.533125134 +0000
|
||||
+++ binutils-2.35.1/bfd/elfcode.h 2021-03-12 12:21:59.568357132 +0000
|
||||
@@ -1591,7 +1591,7 @@ elf_slurp_reloc_table (bfd *abfd,
|
||||
symbols, dynamic))
|
||||
return FALSE;
|
||||
|
||||
- if (!bed->slurp_secondary_relocs (abfd, asect, symbols))
|
||||
+ if (!bed->slurp_secondary_relocs (abfd, asect, symbols, dynamic))
|
||||
return FALSE;
|
||||
|
||||
asect->relocation = relents;
|
||||
34
binutils-CVE-2021-3487.patch
Normal file
34
binutils-CVE-2021-3487.patch
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
--- binutils.orig/bfd/dwarf2.c 2021-04-09 16:59:18.345187116 +0100
|
||||
+++ binutils-2.35/bfd/dwarf2.c 2021-04-09 17:02:03.614064723 +0100
|
||||
@@ -539,6 +539,8 @@ read_section (bfd * abfd,
|
||||
/* The section may have already been read. */
|
||||
if (contents == NULL)
|
||||
{
|
||||
+ ufile_ptr filesize;
|
||||
+
|
||||
msec = bfd_get_section_by_name (abfd, section_name);
|
||||
if (! msec)
|
||||
{
|
||||
@@ -554,10 +556,20 @@ read_section (bfd * abfd,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
- *section_size = msec->rawsize ? msec->rawsize : msec->size;
|
||||
+ amt = bfd_get_section_limit_octets (abfd, msec);
|
||||
+ filesize = bfd_get_file_size (abfd);
|
||||
+ if (amt >= filesize)
|
||||
+ {
|
||||
+ /* PR 26946 */
|
||||
+ _bfd_error_handler (_("DWARF error: section %s is larger than its filesize! (0x%lx vs 0x%lx)"),
|
||||
+ section_name, (long) amt, (long) filesize);
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ *section_size = amt;
|
||||
/* Paranoia - alloc one extra so that we can make sure a string
|
||||
section is NUL terminated. */
|
||||
- amt = *section_size + 1;
|
||||
+ amt += 1;
|
||||
if (amt == 0)
|
||||
{
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
24
binutils-DWARF-5-line-number-parsing.patch
Normal file
24
binutils-DWARF-5-line-number-parsing.patch
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
--- binutils.orig/bfd/dwarf2.c 2021-01-25 11:26:26.761405305 +0000
|
||||
+++ binutils-2.35.1/bfd/dwarf2.c 2021-01-25 11:28:51.838572824 +0000
|
||||
@@ -3252,9 +3252,11 @@ read_rnglists (struct comp_unit *unit, s
|
||||
low_pc = base_address;
|
||||
low_pc += _bfd_safe_read_leb128 (abfd, rngs_ptr, &bytes_read,
|
||||
FALSE, rngs_end);
|
||||
+ rngs_ptr += bytes_read;
|
||||
high_pc = base_address;
|
||||
high_pc += _bfd_safe_read_leb128 (abfd, rngs_ptr, &bytes_read,
|
||||
FALSE, rngs_end);
|
||||
+ rngs_ptr += bytes_read;
|
||||
break;
|
||||
|
||||
case DW_RLE_start_end:
|
||||
@@ -3274,9 +3276,6 @@ read_rnglists (struct comp_unit *unit, s
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
- if ((low_pc == 0 && high_pc == 0) || low_pc == high_pc)
|
||||
- return FALSE;
|
||||
-
|
||||
if (!arange_add (unit, arange, low_pc, high_pc))
|
||||
return FALSE;
|
||||
}
|
||||
2148
binutils-LTO-fix.patch
Normal file
2148
binutils-LTO-fix.patch
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,154 +0,0 @@
|
|||
From 3221c470f0765886a49a1a3d2ec602e4104a377b Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Fri, 2 Aug 2024 19:52:00 -0700
|
||||
Subject: [PATCH] LTO: Restore the wrapper symbol check for standard function
|
||||
|
||||
Call unwrap_hash_lookup to restore the wrapper symbol check for standard
|
||||
function since reference to standard function may not show up in LTO
|
||||
symbol table:
|
||||
|
||||
[hjl@gnu-tgl-3 pr31956-3]$ nm foo.o
|
||||
00000000 T main
|
||||
U __real_malloc
|
||||
00000000 T __wrap_malloc
|
||||
[hjl@gnu-tgl-3 pr31956-3]$ lto-dump -list foo.o
|
||||
Type Visibility Size Name
|
||||
function default 0 malloc
|
||||
function default 0 __real_malloc
|
||||
function default 3 main
|
||||
function default 5 __wrap_malloc
|
||||
[hjl@gnu-tgl-3 pr31956-3]$ make
|
||||
gcc -O2 -flto -Wall -c -o foo.o foo.c
|
||||
gcc -Wl,--wrap=malloc -O2 -flto -Wall -o x foo.o
|
||||
/usr/local/bin/ld: /tmp/ccsPW0a9.ltrans0.ltrans.o: in function `main':
|
||||
<artificial>:(.text.startup+0xa): undefined reference to `__wrap_malloc'
|
||||
collect2: error: ld returned 1 exit status
|
||||
make: *** [Makefile:22: x] Error 1
|
||||
[hjl@gnu-tgl-3 pr31956-3]$
|
||||
|
||||
Also add a test to verify that the unused wrapper is removed.
|
||||
|
||||
PR ld/31956
|
||||
* plugin.c (get_symbols): Restore the wrapper symbol check for
|
||||
standard function.
|
||||
* testsuite/ld-plugin/lto.exp: Run the malloc test and the
|
||||
unused test.
|
||||
* testsuite/ld-plugin/pr31956c.c: New file.
|
||||
* testsuite/ld-plugin/pr31956d.c: New file.
|
||||
* testsuite/ld-plugin/pr31956d.d: New file.
|
||||
|
||||
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
||||
---
|
||||
ld/plugin.c | 14 ++++++++++++--
|
||||
ld/testsuite/ld-plugin/lto.exp | 16 ++++++++++++++++
|
||||
ld/testsuite/ld-plugin/pr31956c.c | 19 +++++++++++++++++++
|
||||
ld/testsuite/ld-plugin/pr31956d.c | 7 +++++++
|
||||
ld/testsuite/ld-plugin/pr31956d.d | 4 ++++
|
||||
5 files changed, 58 insertions(+), 2 deletions(-)
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr31956c.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr31956d.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr31956d.d
|
||||
|
||||
diff --git a/ld/plugin.c b/ld/plugin.c
|
||||
index 03ee9880d10..51c4765cc5b 100644
|
||||
--- a/ld/plugin.c
|
||||
+++ b/ld/plugin.c
|
||||
@@ -778,8 +778,18 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms,
|
||||
{
|
||||
blhe = h;
|
||||
/* Check if a symbol is a wrapper symbol. */
|
||||
- if (blhe && blhe->wrapper_symbol)
|
||||
- wrap_status = wrapper;
|
||||
+ if (blhe)
|
||||
+ {
|
||||
+ if (blhe->wrapper_symbol)
|
||||
+ wrap_status = wrapper;
|
||||
+ else if (link_info.wrap_hash != NULL)
|
||||
+ {
|
||||
+ struct bfd_link_hash_entry *unwrap
|
||||
+ = unwrap_hash_lookup (&link_info, (bfd *) abfd, blhe);
|
||||
+ if (unwrap != NULL && unwrap != h)
|
||||
+ wrap_status = wrapper;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
|
||||
index ad59e2abd61..1a8c3736307 100644
|
||||
--- a/ld/testsuite/ld-plugin/lto.exp
|
||||
+++ b/ld/testsuite/ld-plugin/lto.exp
|
||||
@@ -546,6 +546,22 @@ set lto_link_elf_tests [list \
|
||||
{} \
|
||||
"pr31956b" \
|
||||
] \
|
||||
+ [list \
|
||||
+ "PR ld/31956 (malloc)" \
|
||||
+ "-Wl,--wrap=malloc" \
|
||||
+ "-O2 -flto" \
|
||||
+ {pr31956c.c} \
|
||||
+ {} \
|
||||
+ "pr31956c" \
|
||||
+ ] \
|
||||
+ [list \
|
||||
+ "PR ld/31956 (unused)" \
|
||||
+ "-Wl,--wrap=parse_line" \
|
||||
+ "-O2 -flto" \
|
||||
+ {pr31956d.c} \
|
||||
+ {{"nm" {} "pr31956d.d"}} \
|
||||
+ "pr31956d" \
|
||||
+ ] \
|
||||
[list \
|
||||
"Build pr30281.so" \
|
||||
"-shared -Wl,--version-script,pr30281.t \
|
||||
diff --git a/ld/testsuite/ld-plugin/pr31956c.c b/ld/testsuite/ld-plugin/pr31956c.c
|
||||
new file mode 100644
|
||||
index 00000000000..4a46b2b49a8
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr31956c.c
|
||||
@@ -0,0 +1,19 @@
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+extern void *__real_malloc (size_t);
|
||||
+
|
||||
+void *
|
||||
+__wrap_malloc (size_t n)
|
||||
+{
|
||||
+ if (n == 0)
|
||||
+ return NULL;
|
||||
+ else
|
||||
+ return __real_malloc (n);
|
||||
+};
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ void *ptr = malloc (30);
|
||||
+ return ptr == NULL ? 1 : 0;
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr31956d.c b/ld/testsuite/ld-plugin/pr31956d.c
|
||||
new file mode 100644
|
||||
index 00000000000..cb7f2d50643
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr31956d.c
|
||||
@@ -0,0 +1,7 @@
|
||||
+void __wrap_parse_line(void) {};
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr31956d.d b/ld/testsuite/ld-plugin/pr31956d.d
|
||||
new file mode 100644
|
||||
index 00000000000..b579cdc7353
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr31956d.d
|
||||
@@ -0,0 +1,4 @@
|
||||
+#failif
|
||||
+#...
|
||||
+[0-9a-f]+ T .*parse_line
|
||||
+#...
|
||||
--
|
||||
2.45.2
|
||||
|
||||
5925
binutils-Power10-fixes.patch
Normal file
5925
binutils-Power10-fixes.patch
Normal file
File diff suppressed because it is too large
Load diff
223
binutils-SHF_LINK_ORDER.patch
Normal file
223
binutils-SHF_LINK_ORDER.patch
Normal file
|
|
@ -0,0 +1,223 @@
|
|||
diff -rup binutils.orig/bfd/bfd-in2.h binutils-2.35.1/bfd/bfd-in2.h
|
||||
--- binutils.orig/bfd/bfd-in2.h 2021-01-04 13:18:10.234368481 +0000
|
||||
+++ binutils-2.35.1/bfd/bfd-in2.h 2021-01-04 13:18:20.596301287 +0000
|
||||
@@ -1177,6 +1177,9 @@ typedef struct bfd_section
|
||||
struct bfd_symbol *symbol;
|
||||
struct bfd_symbol **symbol_ptr_ptr;
|
||||
|
||||
+ /* The matching section name pattern in linker script. */
|
||||
+ const char *pattern;
|
||||
+
|
||||
/* Early in the link process, map_head and map_tail are used to build
|
||||
a list of input sections attached to an output section. Later,
|
||||
output sections use these fields for a list of bfd_link_order
|
||||
@@ -1370,8 +1373,8 @@ discarded_section (const asection *sec)
|
||||
/* target_index, used_by_bfd, constructor_chain, owner, */ \
|
||||
0, NULL, NULL, NULL, \
|
||||
\
|
||||
- /* symbol, symbol_ptr_ptr, */ \
|
||||
- (struct bfd_symbol *) SYM, &SEC.symbol, \
|
||||
+ /* symbol, symbol_ptr_ptr, pattern, */ \
|
||||
+ (struct bfd_symbol *) SYM, &SEC.symbol, NULL, \
|
||||
\
|
||||
/* map_head, map_tail, already_assigned */ \
|
||||
{ NULL }, { NULL }, NULL \
|
||||
diff -rup binutils.orig/bfd/elflink.c binutils-2.35.1/bfd/elflink.c
|
||||
--- binutils.orig/bfd/elflink.c 2021-01-04 13:18:10.223368552 +0000
|
||||
+++ binutils-2.35.1/bfd/elflink.c 2021-01-04 13:18:20.599301268 +0000
|
||||
@@ -11662,8 +11662,21 @@ compare_link_order (const void *a, const
|
||||
const struct bfd_link_order *blo = *(const struct bfd_link_order **) b;
|
||||
asection *asec = elf_linked_to_section (alo->u.indirect.section);
|
||||
asection *bsec = elf_linked_to_section (blo->u.indirect.section);
|
||||
- bfd_vma apos = asec->output_section->lma + asec->output_offset;
|
||||
- bfd_vma bpos = bsec->output_section->lma + bsec->output_offset;
|
||||
+ bfd_vma apos, bpos;
|
||||
+
|
||||
+ /* Check if any sections are unordered. */
|
||||
+ if (asec == NULL || bsec == NULL)
|
||||
+ {
|
||||
+ /* Place ordered sections before unordered sections. */
|
||||
+ if (bsec != NULL)
|
||||
+ return 1;
|
||||
+ else if (asec != NULL)
|
||||
+ return -1;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ apos = asec->output_section->lma + asec->output_offset;
|
||||
+ bpos = bsec->output_section->lma + bsec->output_offset;
|
||||
|
||||
if (apos < bpos)
|
||||
return -1;
|
||||
@@ -11698,14 +11711,14 @@ compare_link_order (const void *a, const
|
||||
sections. Ideally we'd do this in the linker proper. */
|
||||
|
||||
static bfd_boolean
|
||||
-elf_fixup_link_order (bfd *abfd, asection *o)
|
||||
+elf_fixup_link_order (struct bfd_link_info *info, bfd *abfd, asection *o)
|
||||
{
|
||||
size_t seen_linkorder;
|
||||
size_t seen_other;
|
||||
size_t n;
|
||||
struct bfd_link_order *p;
|
||||
bfd *sub;
|
||||
- struct bfd_link_order **sections;
|
||||
+ struct bfd_link_order **sections, **indirect_sections;
|
||||
asection *other_sec, *linkorder_sec;
|
||||
bfd_vma offset; /* Octets. */
|
||||
|
||||
@@ -11736,7 +11749,9 @@ elf_fixup_link_order (bfd *abfd, asectio
|
||||
else
|
||||
seen_other++;
|
||||
|
||||
- if (seen_other && seen_linkorder)
|
||||
+ /* Allow mixed ordered and unordered input sections for
|
||||
+ non-relocatable link. */
|
||||
+ if (bfd_link_relocatable (info) && seen_other && seen_linkorder)
|
||||
{
|
||||
if (other_sec && linkorder_sec)
|
||||
_bfd_error_handler
|
||||
@@ -11756,6 +11771,10 @@ elf_fixup_link_order (bfd *abfd, asectio
|
||||
if (!seen_linkorder)
|
||||
return TRUE;
|
||||
|
||||
+ /* Non-relocatable output can have both ordered and unordered input
|
||||
+ sections. */
|
||||
+ seen_linkorder += seen_other;
|
||||
+
|
||||
sections = bfd_malloc (seen_linkorder * sizeof (*sections));
|
||||
if (sections == NULL)
|
||||
return FALSE;
|
||||
@@ -11764,22 +11783,51 @@ elf_fixup_link_order (bfd *abfd, asectio
|
||||
for (p = o->map_head.link_order; p != NULL; p = p->next)
|
||||
sections[seen_linkorder++] = p;
|
||||
|
||||
- /* Sort the input sections in the order of their linked section. */
|
||||
- qsort (sections, seen_linkorder, sizeof (*sections), compare_link_order);
|
||||
+ for (indirect_sections = sections, n = 0; n < seen_linkorder;)
|
||||
+ {
|
||||
+ /* Find the first bfd_indirect_link_order section. */
|
||||
+ if (indirect_sections[0]->type == bfd_indirect_link_order)
|
||||
+ {
|
||||
+ /* Count the consecutive bfd_indirect_link_order sections
|
||||
+ with the same pattern. */
|
||||
+ size_t i, n_indirect;
|
||||
+ const char *pattern
|
||||
+ = indirect_sections[0]->u.indirect.section->pattern;
|
||||
+ for (i = n + 1; i < seen_linkorder; i++)
|
||||
+ if (sections[i]->type != bfd_indirect_link_order
|
||||
+ || sections[i]->u.indirect.section->pattern != pattern)
|
||||
+ break;
|
||||
+ n_indirect = i - n;
|
||||
+ /* Sort the bfd_indirect_link_order sections in the order of
|
||||
+ their linked section. */
|
||||
+ qsort (indirect_sections, n_indirect, sizeof (*sections),
|
||||
+ compare_link_order);
|
||||
+ indirect_sections += n_indirect;
|
||||
+ n += n_indirect;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ indirect_sections++;
|
||||
+ n++;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- /* Change the offsets of the sections. */
|
||||
+ /* Change the offsets of the bfd_indirect_link_order sections. */
|
||||
offset = 0;
|
||||
for (n = 0; n < seen_linkorder; n++)
|
||||
- {
|
||||
- bfd_vma mask;
|
||||
- asection *s = sections[n]->u.indirect.section;
|
||||
- unsigned int opb = bfd_octets_per_byte (abfd, s);
|
||||
-
|
||||
- mask = ~(bfd_vma) 0 << s->alignment_power * opb;
|
||||
- offset = (offset + ~mask) & mask;
|
||||
- sections[n]->offset = s->output_offset = offset / opb;
|
||||
- offset += sections[n]->size;
|
||||
- }
|
||||
+ if (sections[n]->type == bfd_indirect_link_order)
|
||||
+ {
|
||||
+ bfd_vma mask;
|
||||
+ asection *s = sections[n]->u.indirect.section;
|
||||
+ unsigned int opb = bfd_octets_per_byte (abfd, s);
|
||||
+
|
||||
+ mask = ~(bfd_vma) 0 << s->alignment_power * opb;
|
||||
+ offset = (offset + ~mask) & mask;
|
||||
+ sections[n]->offset = s->output_offset = offset / opb;
|
||||
+ offset += sections[n]->size;
|
||||
+ }
|
||||
+ else
|
||||
+ offset = sections[n]->offset + sections[n]->size;
|
||||
|
||||
free (sections);
|
||||
return TRUE;
|
||||
@@ -12408,7 +12456,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
|
||||
/* Reorder SHF_LINK_ORDER sections. */
|
||||
for (o = abfd->sections; o != NULL; o = o->next)
|
||||
{
|
||||
- if (!elf_fixup_link_order (abfd, o))
|
||||
+ if (!elf_fixup_link_order (info, abfd, o))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
diff -rup binutils.orig/bfd/section.c binutils-2.35.1/bfd/section.c
|
||||
--- binutils.orig/bfd/section.c 2021-01-04 13:18:10.233368487 +0000
|
||||
+++ binutils-2.35.1/bfd/section.c 2021-01-04 13:18:20.599301268 +0000
|
||||
@@ -541,6 +541,9 @@ CODE_FRAGMENT
|
||||
. struct bfd_symbol *symbol;
|
||||
. struct bfd_symbol **symbol_ptr_ptr;
|
||||
.
|
||||
+. {* The matching section name pattern in linker script. *}
|
||||
+. const char *pattern;
|
||||
+.
|
||||
. {* Early in the link process, map_head and map_tail are used to build
|
||||
. a list of input sections attached to an output section. Later,
|
||||
. output sections use these fields for a list of bfd_link_order
|
||||
@@ -734,8 +737,8 @@ CODE_FRAGMENT
|
||||
. {* target_index, used_by_bfd, constructor_chain, owner, *} \
|
||||
. 0, NULL, NULL, NULL, \
|
||||
. \
|
||||
-. {* symbol, symbol_ptr_ptr, *} \
|
||||
-. (struct bfd_symbol *) SYM, &SEC.symbol, \
|
||||
+. {* symbol, symbol_ptr_ptr, pattern, *} \
|
||||
+. (struct bfd_symbol *) SYM, &SEC.symbol, NULL, \
|
||||
. \
|
||||
. {* map_head, map_tail, already_assigned *} \
|
||||
. { NULL }, { NULL }, NULL \
|
||||
diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.35.1/gas/config/obj-elf.c
|
||||
--- binutils.orig/gas/config/obj-elf.c 2021-01-04 13:18:09.942370375 +0000
|
||||
+++ binutils-2.35.1/gas/config/obj-elf.c 2021-01-04 13:18:20.599301268 +0000
|
||||
@@ -659,7 +659,9 @@ obj_elf_change_section (const char *name
|
||||
}
|
||||
}
|
||||
|
||||
- if (old_sec == NULL && ((attr & ~(SHF_MASKOS | SHF_MASKPROC))
|
||||
+ if (old_sec == NULL && ((attr & ~(SHF_LINK_ORDER
|
||||
+ | SHF_MASKOS
|
||||
+ | SHF_MASKPROC))
|
||||
& ~ssect->attr) != 0)
|
||||
{
|
||||
/* As a GNU extension, we permit a .note section to be
|
||||
diff -rup binutils.orig/ld/ldlang.c binutils-2.35.1/ld/ldlang.c
|
||||
--- binutils.orig/ld/ldlang.c 2021-01-04 13:18:09.691372002 +0000
|
||||
+++ binutils-2.35.1/ld/ldlang.c 2021-01-04 13:18:20.600301261 +0000
|
||||
@@ -7421,7 +7421,7 @@ lang_reset_memory_regions (void)
|
||||
|
||||
static void
|
||||
gc_section_callback (lang_wild_statement_type *ptr,
|
||||
- struct wildcard_list *sec ATTRIBUTE_UNUSED,
|
||||
+ struct wildcard_list *sec,
|
||||
asection *section,
|
||||
struct flag_info *sflag_info ATTRIBUTE_UNUSED,
|
||||
lang_input_statement_type *file ATTRIBUTE_UNUSED,
|
||||
@@ -7431,6 +7431,8 @@ gc_section_callback (lang_wild_statement
|
||||
should be as well. */
|
||||
if (ptr->keep_sections)
|
||||
section->flags |= SEC_KEEP;
|
||||
+ if (sec)
|
||||
+ section->pattern = sec->spec.name;
|
||||
}
|
||||
|
||||
/* Iterate over sections marking them against GC. */
|
||||
93
binutils-aarch64-condbranch-relocs.patch
Normal file
93
binutils-aarch64-condbranch-relocs.patch
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.35/bfd/elfnn-aarch64.c
|
||||
--- binutils.orig/bfd/elfnn-aarch64.c 2020-09-10 17:03:31.738458044 +0100
|
||||
+++ binutils-2.35/bfd/elfnn-aarch64.c 2020-09-10 17:04:03.643344898 +0100
|
||||
@@ -5445,7 +5445,6 @@ elfNN_aarch64_final_link_relocate (reloc
|
||||
bfd_vma orig_value = value;
|
||||
bfd_boolean resolved_to_zero;
|
||||
bfd_boolean abs_symbol_p;
|
||||
- bfd_boolean via_plt_p;
|
||||
|
||||
globals = elf_aarch64_hash_table (info);
|
||||
|
||||
@@ -5467,8 +5466,6 @@ elfNN_aarch64_final_link_relocate (reloc
|
||||
: bfd_is_und_section (sym_sec));
|
||||
abs_symbol_p = h != NULL && bfd_is_abs_symbol (&h->root);
|
||||
|
||||
- via_plt_p = (globals->root.splt != NULL && h != NULL
|
||||
- && h->plt.offset != (bfd_vma) - 1);
|
||||
|
||||
/* Since STT_GNU_IFUNC symbol must go through PLT, we handle
|
||||
it here if it is defined in a non-shared object. */
|
||||
@@ -5805,23 +5802,12 @@ elfNN_aarch64_final_link_relocate (reloc
|
||||
value += signed_addend;
|
||||
break;
|
||||
|
||||
- case BFD_RELOC_AARCH64_BRANCH19:
|
||||
- case BFD_RELOC_AARCH64_TSTBR14:
|
||||
- /* A conditional branch to an undefined weak symbol is converted to a
|
||||
- branch to itself. */
|
||||
- if (weak_undef_p && !via_plt_p)
|
||||
- {
|
||||
- value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type,
|
||||
- place, value,
|
||||
- signed_addend,
|
||||
- weak_undef_p);
|
||||
- break;
|
||||
- }
|
||||
- /* Fall through. */
|
||||
case BFD_RELOC_AARCH64_CALL26:
|
||||
case BFD_RELOC_AARCH64_JUMP26:
|
||||
{
|
||||
asection *splt = globals->root.splt;
|
||||
+ bfd_boolean via_plt_p =
|
||||
+ splt != NULL && h != NULL && h->plt.offset != (bfd_vma) - 1;
|
||||
|
||||
/* A call to an undefined weak symbol is converted to a jump to
|
||||
the next instruction unless a PLT entry will be created.
|
||||
@@ -5902,6 +5888,23 @@ elfNN_aarch64_final_link_relocate (reloc
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return bfd_reloc_notsupported;
|
||||
}
|
||||
+ value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type,
|
||||
+ place, value,
|
||||
+ signed_addend,
|
||||
+ weak_undef_p);
|
||||
+ break;
|
||||
+
|
||||
+ case BFD_RELOC_AARCH64_BRANCH19:
|
||||
+ case BFD_RELOC_AARCH64_TSTBR14:
|
||||
+ if (h && h->root.type == bfd_link_hash_undefined)
|
||||
+ {
|
||||
+ _bfd_error_handler
|
||||
+ /* xgettext:c-format */
|
||||
+ (_("%pB: conditional branch to undefined symbol `%s' "
|
||||
+ "not allowed"), input_bfd, h->root.root.string);
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ return bfd_reloc_notsupported;
|
||||
+ }
|
||||
/* Fall through. */
|
||||
|
||||
case BFD_RELOC_AARCH64_16:
|
||||
@@ -7967,8 +7970,6 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
|
||||
break;
|
||||
}
|
||||
|
||||
- case BFD_RELOC_AARCH64_BRANCH19:
|
||||
- case BFD_RELOC_AARCH64_TSTBR14:
|
||||
case BFD_RELOC_AARCH64_CALL26:
|
||||
case BFD_RELOC_AARCH64_JUMP26:
|
||||
/* If this is a local symbol then we resolve it
|
||||
Only in binutils-2.35/bfd: elfnn-aarch64.c.orig
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/emit-relocs-560.d binutils-2.35/ld/testsuite/ld-aarch64/emit-relocs-560.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/emit-relocs-560.d 2020-09-10 17:03:31.067460424 +0100
|
||||
+++ binutils-2.35/ld/testsuite/ld-aarch64/emit-relocs-560.d 2020-09-10 17:04:03.644344895 +0100
|
||||
@@ -1,8 +1,3 @@
|
||||
#source: emit-relocs-560.s
|
||||
#ld: -shared
|
||||
-#readelf: -r
|
||||
-
|
||||
-Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 2 entries:
|
||||
- Offset Info Type Sym. Value Sym. Name \+ Addend
|
||||
-[0-9a-f]+ 000100000402 R_AARCH64_JUMP_SL 0000000000000000 baz \+ 0
|
||||
-[0-9a-f]+ 000200000402 R_AARCH64_JUMP_SL 0000000000000000 bar \+ 0
|
||||
+#error: .*: conditional branch to undefined symbol `bar' not allowed
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
--- binutils.orig/bfd/elfnn-aarch64.c 2025-02-07 13:42:20.961333141 +0000
|
||||
+++ binutils-with-gold-2.44/bfd/elfnn-aarch64.c 2025-02-07 13:42:29.781353740 +0000
|
||||
@@ -10162,7 +10162,8 @@ elfNN_aarch64_init_small_plt0_entry (bfd
|
||||
/* PR 26312: Explicitly set the sh_entsize to 0 so that
|
||||
consumers do not think that the section contains fixed
|
||||
sized objects. */
|
||||
- elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0;
|
||||
+ if (elf_section_data (htab->root.splt->output_section) != NULL)
|
||||
+ elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0;
|
||||
|
||||
plt_got_2nd_ent = (htab->root.sgotplt->output_section->vma
|
||||
+ htab->root.sgotplt->output_offset
|
||||
1981
binutils-add-sym-cache-to-elf-link-hash.patch
Normal file
1981
binutils-add-sym-cache-to-elf-link-hash.patch
Normal file
File diff suppressed because it is too large
Load diff
70
binutils-attach-to-group.patch
Normal file
70
binutils-attach-to-group.patch
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.34/gas/config/obj-elf.c
|
||||
--- binutils.orig/gas/config/obj-elf.c 2020-02-02 11:34:11.858321477 +0000
|
||||
+++ binutils-2.34/gas/config/obj-elf.c 2020-02-02 11:34:30.099247619 +0000
|
||||
@@ -78,9 +78,11 @@ static void obj_elf_gnu_attribute (int);
|
||||
static void obj_elf_tls_common (int);
|
||||
static void obj_elf_lcomm (int);
|
||||
static void obj_elf_struct (int);
|
||||
+static void obj_elf_attach_to_group (int);
|
||||
|
||||
static const pseudo_typeS elf_pseudo_table[] =
|
||||
{
|
||||
+ {"attach_to_group", obj_elf_attach_to_group, 0},
|
||||
{"comm", obj_elf_common, 0},
|
||||
{"common", obj_elf_common, 1},
|
||||
{"ident", obj_elf_ident, 0},
|
||||
@@ -1003,6 +1005,27 @@ obj_elf_section_name (void)
|
||||
return name;
|
||||
}
|
||||
|
||||
+static void
|
||||
+obj_elf_attach_to_group (int dummy ATTRIBUTE_UNUSED)
|
||||
+{
|
||||
+ const char * gname = obj_elf_section_name ();
|
||||
+
|
||||
+ if (gname == NULL)
|
||||
+ {
|
||||
+ as_warn ("group name not parseable");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (elf_group_name (now_seg))
|
||||
+ {
|
||||
+ as_warn ("already has a group");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ elf_group_name (now_seg) = xstrdup (gname);
|
||||
+ elf_section_flags (now_seg) |= SHF_GROUP;
|
||||
+}
|
||||
+
|
||||
void
|
||||
obj_elf_section (int push)
|
||||
{
|
||||
Only in binutils-2.34/gas/config: obj-elf.c.orig
|
||||
diff -rup binutils.orig/gas/doc/as.texi binutils-2.34/gas/doc/as.texi
|
||||
--- binutils.orig/gas/doc/as.texi 2020-02-02 11:34:11.850321509 +0000
|
||||
+++ binutils-2.34/gas/doc/as.texi 2020-02-02 11:35:11.359080560 +0000
|
||||
@@ -4359,6 +4359,7 @@ Some machine configurations provide addi
|
||||
* Altmacro:: @code{.altmacro}
|
||||
* Ascii:: @code{.ascii "@var{string}"}@dots{}
|
||||
* Asciz:: @code{.asciz "@var{string}"}@dots{}
|
||||
+* Attach_to_group:: @code{.attach_to_group @var{name}}
|
||||
* Balign:: @code{.balign [@var{abs-expr}[, @var{abs-expr}]]}
|
||||
* Bundle directives:: @code{.bundle_align_mode @var{abs-expr}}, etc
|
||||
* Byte:: @code{.byte @var{expressions}}
|
||||
@@ -4656,6 +4657,12 @@ trailing zero byte) into consecutive add
|
||||
@code{.asciz} is just like @code{.ascii}, but each string is followed by
|
||||
a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''.
|
||||
|
||||
+@node Attach_to_group
|
||||
+@section @code{.attach_to_group @var{name}}
|
||||
+Attaches the current section to the named group. This is like declaring
|
||||
+the section with the @code{G} attribute, but can be done after the section
|
||||
+has been created.
|
||||
+
|
||||
@node Balign
|
||||
@section @code{.balign[wl] [@var{abs-expr}[, @var{abs-expr}[, @var{abs-expr}]]]}
|
||||
|
||||
Only in binutils-2.34/gas/doc: as.texi.orig
|
||||
Only in binutils-2.34/gas/doc: as.texi.rej
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- binutils.orig/config/override.m4 2021-08-31 14:20:17.275574804 +0100
|
||||
+++ binutils-2.37/config/override.m4 2021-08-31 14:36:37.793954247 +0100
|
||||
@@ -41,7 +41,7 @@ dnl Or for updating the whole tree at on
|
||||
AC_DEFUN([_GCC_AUTOCONF_VERSION_CHECK],
|
||||
[m4_if(m4_defn([_GCC_AUTOCONF_VERSION]),
|
||||
m4_defn([m4_PACKAGE_VERSION]), [],
|
||||
- [m4_fatal([Please use exactly Autoconf ]_GCC_AUTOCONF_VERSION[ instead of ]m4_defn([m4_PACKAGE_VERSION])[.])])
|
||||
+ [])
|
||||
])
|
||||
m4_define([AC_INIT], m4_defn([AC_INIT])[
|
||||
_GCC_AUTOCONF_VERSION_CHECK
|
||||
44
binutils-config.patch
Normal file
44
binutils-config.patch
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
diff -Nrup a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
|
||||
--- a/libiberty/aclocal.m4 2019-01-19 09:01:34.000000000 -0700
|
||||
+++ b/libiberty/aclocal.m4 2020-01-09 22:00:27.183312982 -0700
|
||||
@@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
|
||||
-[AC_TRY_RUN([find_stack_direction ()
|
||||
+[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction ()
|
||||
{
|
||||
static char *addr = 0;
|
||||
auto char dummy;
|
||||
diff --git a/config/intdiv0.m4 b/config/intdiv0.m4
|
||||
index 55dddcf1..ba906efc 100644
|
||||
--- a/config/intdiv0.m4
|
||||
+++ b/config/intdiv0.m4
|
||||
@@ -31,10 +31,10 @@ sigfpe_handler (sig) int sig;
|
||||
exit (sig != SIGFPE);
|
||||
}
|
||||
|
||||
-int x = 1;
|
||||
-int y = 0;
|
||||
-int z;
|
||||
-int nan;
|
||||
+volatile int x = 1;
|
||||
+volatile int y = 0;
|
||||
+volatile int z;
|
||||
+volatile int nan;
|
||||
|
||||
int main ()
|
||||
{
|
||||
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
|
||||
index f1ce7601..fc20d228 100644
|
||||
--- a/libiberty/configure.ac
|
||||
+++ b/libiberty/configure.ac
|
||||
@@ -661,7 +661,7 @@ if test -z "${setobjs}"; then
|
||||
for v in $vars; do
|
||||
AC_MSG_CHECKING([for $v])
|
||||
AC_CACHE_VAL(libiberty_cv_var_$v,
|
||||
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])],
|
||||
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[__attribute__ ((used)) int *p;]],[[extern int $v []; p = $v;]])],
|
||||
[eval "libiberty_cv_var_$v=yes"],
|
||||
[eval "libiberty_cv_var_$v=no"])])
|
||||
if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
diff -rup binutils.orig/configure binutils-2.40/configure
|
||||
--- binutils.orig/configure 2023-02-13 14:43:00.728877170 +0000
|
||||
+++ binutils-2.40/configure 2023-02-13 14:43:13.671864892 +0000
|
||||
@@ -5442,49 +5442,6 @@ if test -z "$LD"; then
|
||||
diff -rup binutils.orig/configure binutils-2.30/configure
|
||||
--- binutils.orig/configure 2018-09-24 17:50:06.967172922 +0100
|
||||
+++ binutils-2.30/configure 2018-09-24 17:51:16.648624865 +0100
|
||||
@@ -4996,49 +4996,6 @@ if test -z "$LD"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
@ -51,9 +51,10 @@ diff -rup binutils.orig/configure binutils-2.40/configure
|
|||
|
||||
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
--- binutils.orig/configure.ac 2024-11-26 15:08:50.162328683 +0000
|
||||
+++ binutils-2.43.50-1686dc7079f/configure.ac 2024-11-26 15:08:56.929374527 +0000
|
||||
@@ -1410,26 +1410,6 @@ if test -z "$LD"; then
|
||||
diff -rup binutils.orig/configure.ac binutils-2.30/configure.ac
|
||||
--- binutils.orig/configure.ac 2018-09-24 17:50:07.241170767 +0100
|
||||
+++ binutils-2.30/configure.ac 2018-09-24 17:50:29.908992486 +0100
|
||||
@@ -1288,26 +1288,6 @@ if test -z "$LD"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
@ -78,5 +79,5 @@ diff -rup binutils.orig/configure binutils-2.40/configure
|
|||
-fi
|
||||
-
|
||||
ACX_PROG_GNAT
|
||||
ACX_PROG_GDC
|
||||
ACX_PROG_CARGO
|
||||
ACX_PROG_CMP_IGNORE_INITIAL
|
||||
|
||||
|
|
|
|||
34
binutils-duplicate-sections.patch
Normal file
34
binutils-duplicate-sections.patch
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
diff -rup binutils.orig/ld/ldlang.c binutils-2.35.1/ld/ldlang.c
|
||||
--- binutils.orig/ld/ldlang.c 2021-01-04 15:20:32.901498036 +0000
|
||||
+++ binutils-2.35.1/ld/ldlang.c 2021-01-04 15:22:03.151916333 +0000
|
||||
@@ -1529,6 +1529,8 @@ lang_output_section_statement_lookup (co
|
||||
|
||||
entry->s.output_section_statement.name = name;
|
||||
entry->s.output_section_statement.constraint = constraint;
|
||||
+ entry->s.output_section_statement.dup_output = (create == 2
|
||||
+ || constraint == SPECIAL);
|
||||
return &entry->s.output_section_statement;
|
||||
}
|
||||
|
||||
@@ -2390,7 +2392,7 @@ init_os (lang_output_section_statement_t
|
||||
if (strcmp (s->name, DISCARD_SECTION_NAME) == 0)
|
||||
einfo (_("%F%P: illegal use of `%s' section\n"), DISCARD_SECTION_NAME);
|
||||
|
||||
- if (s->constraint != SPECIAL)
|
||||
+ if (!s->dup_output)
|
||||
s->bfd_section = bfd_get_section_by_name (link_info.output_bfd, s->name);
|
||||
if (s->bfd_section == NULL)
|
||||
s->bfd_section = bfd_make_section_anyway_with_flags (link_info.output_bfd,
|
||||
diff -rup binutils.orig/ld/ldlang.h binutils-2.35.1/ld/ldlang.h
|
||||
--- binutils.orig/ld/ldlang.h 2021-01-04 15:20:32.627499830 +0000
|
||||
+++ binutils-2.35.1/ld/ldlang.h 2021-01-04 15:21:06.688277003 +0000
|
||||
@@ -173,6 +173,9 @@ typedef struct lang_output_section_state
|
||||
unsigned int after_end : 1;
|
||||
/* If this section uses the alignment of its input sections. */
|
||||
unsigned int align_lma_with_input : 1;
|
||||
+ /* If script has duplicate output section statements of the same name
|
||||
+ create duplicate output sections. */
|
||||
+ unsigned int dup_output : 1;
|
||||
} lang_output_section_statement_type;
|
||||
|
||||
typedef struct
|
||||
186
binutils-dwarf-5-dir0.patch
Normal file
186
binutils-dwarf-5-dir0.patch
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
diff -rup binutils.orig/gas/dwarf2dbg.c binutils-2.35.2/gas/dwarf2dbg.c
|
||||
--- binutils.orig/gas/dwarf2dbg.c 2021-08-09 17:50:48.324447191 +0100
|
||||
+++ binutils-2.35.2/gas/dwarf2dbg.c 2021-08-09 17:51:03.308359865 +0100
|
||||
@@ -616,7 +616,22 @@ get_directory_table_entry (const char *
|
||||
if (can_use_zero)
|
||||
{
|
||||
if (dirs == NULL || dirs[0] == NULL)
|
||||
- d = 0;
|
||||
+ {
|
||||
+ const char * pwd = getpwd ();
|
||||
+
|
||||
+ if (dwarf_level >= 5 && strcmp (dirname, pwd) != 0)
|
||||
+ {
|
||||
+ /* In DWARF-5 the 0 entry in the directory table is expected to be
|
||||
+ the same as the DW_AT_comp_dir (which is set to the current build
|
||||
+ directory). Since we are about to create a directory entry that
|
||||
+ is not the same, allocate the current directory first.
|
||||
+ FIXME: Alternatively we could generate an error message here. */
|
||||
+ (void) get_directory_table_entry (pwd, strlen (pwd), TRUE);
|
||||
+ d = 1;
|
||||
+ }
|
||||
+ else
|
||||
+ d = 0;
|
||||
+ }
|
||||
}
|
||||
else if (d == 0)
|
||||
d = 1;
|
||||
@@ -624,8 +639,8 @@ get_directory_table_entry (const char *
|
||||
if (d >= dirs_allocated)
|
||||
{
|
||||
unsigned int old = dirs_allocated;
|
||||
-
|
||||
- dirs_allocated = d + 32;
|
||||
+#define DIR_TABLE_INCREMENT 32
|
||||
+ dirs_allocated = d + DIR_TABLE_INCREMENT;
|
||||
dirs = XRESIZEVEC (char *, dirs, dirs_allocated);
|
||||
memset (dirs + old, 0, (dirs_allocated - old) * sizeof (char *));
|
||||
}
|
||||
@@ -820,7 +835,7 @@ allocate_filename_to_slot (const char *
|
||||
dirlen = strlen (dirname);
|
||||
file = filename;
|
||||
}
|
||||
-
|
||||
+
|
||||
d = get_directory_table_entry (dirname, dirlen, num == 0);
|
||||
i = num;
|
||||
|
||||
@@ -2062,7 +2077,12 @@ out_dir_and_file_list (segT line_seg, in
|
||||
Otherwise use pwd as main file directory. */
|
||||
if (dirs_in_use > 0 && dirs != NULL && dirs[0] != NULL)
|
||||
dir = remap_debug_filename (dirs[0]);
|
||||
- else if (dirs_in_use > 1 && dirs != NULL && dirs[1] != NULL)
|
||||
+ else if (dirs_in_use > 1
|
||||
+ && dirs != NULL
|
||||
+ && dirs[1] != NULL
|
||||
+ /* DWARF-5 directory tables expect dir[0] to be the same as
|
||||
+ DW_AT_comp_dir, which is the same as pwd. */
|
||||
+ && dwarf_level < 5)
|
||||
dir = remap_debug_filename (dirs[1]);
|
||||
else
|
||||
dir = remap_debug_filename (getpwd ());
|
||||
@@ -2165,8 +2185,8 @@ out_dir_and_file_list (segT line_seg, in
|
||||
uses slot zero, but that is only set explicitly using a
|
||||
.file 0 directive. If that isn't used, but file 1 is,
|
||||
then use that as main file name. */
|
||||
- if (DWARF2_LINE_VERSION >= 5 && i == 0 && files_in_use >= 1)
|
||||
- files[0].filename = files[1].filename;
|
||||
+ if (DWARF2_LINE_VERSION >= 5 && i == 0 && files_in_use >= 1 && files[0].filename == NULL)
|
||||
+ files[0].filename = files[1].filename;
|
||||
else
|
||||
files[i].filename = "";
|
||||
if (DWARF2_LINE_VERSION < 5 || i != 0)
|
||||
Only in binutils-2.35.2/gas/: dwarf2dbg.c.orig
|
||||
Only in binutils-2.35.2/gas/: dwarf2dbg.c.rej
|
||||
diff -rup binutils.orig/gas/testsuite/gas/elf/dwarf-5-file0.d binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-file0.d
|
||||
--- binutils.orig/gas/testsuite/gas/elf/dwarf-5-file0.d 2021-08-09 17:50:48.394446783 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-file0.d 2021-08-09 17:53:36.567466668 +0100
|
||||
@@ -3,17 +3,18 @@
|
||||
#readelf: -wl
|
||||
|
||||
#...
|
||||
- The Directory Table \(offset 0x.*, lines 3, columns 1\):
|
||||
+ The Directory Table \(offset 0x.*, lines 4, columns 1\):
|
||||
Entry Name
|
||||
- 0 \(indirect line string, offset: 0x.*\): master directory
|
||||
- 1 \(indirect line string, offset: 0x.*\): secondary directory
|
||||
- 2 \(indirect line string, offset: 0x.*\): /tmp
|
||||
+#...
|
||||
+ 1 \(indirect line string, offset: 0x.*\): master directory
|
||||
+ 2 \(indirect line string, offset: 0x.*\): secondary directory
|
||||
+ 3 \(indirect line string, offset: 0x.*\): /tmp
|
||||
|
||||
The File Name Table \(offset 0x.*, lines 3, columns 3\):
|
||||
Entry Dir MD5 Name
|
||||
- 0 0 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): master source file
|
||||
- 1 1 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): secondary source file
|
||||
- 2 2 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c
|
||||
+ 0 1 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): master source file
|
||||
+ 1 2 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): secondary source file
|
||||
+ 2 3 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c
|
||||
#pass
|
||||
|
||||
|
||||
Only in binutils-2.35.2/gas/testsuite/gas/elf: dwarf-5-file0.d.orig
|
||||
Only in binutils-2.35.2/gas/testsuite/gas/elf: dwarf-5-file0.d.rej
|
||||
diff -rup binutils.orig/gas/testsuite/gas/elf/elf.exp binutils-2.35.2/gas/testsuite/gas/elf/elf.exp
|
||||
--- binutils.orig/gas/testsuite/gas/elf/elf.exp 2021-08-09 17:50:48.395446778 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/elf/elf.exp 2021-08-09 17:51:03.308359865 +0100
|
||||
@@ -274,6 +274,7 @@ if { [is_elf_format] } then {
|
||||
run_dump_test "dwarf2-18" $dump_opts
|
||||
run_dump_test "dwarf2-19" $dump_opts
|
||||
run_dump_test "dwarf-5-file0" $dump_opts
|
||||
+ run_dump_test "dwarf-5-dir0" $dump_opts
|
||||
run_dump_test "dwarf-4-cu" $dump_opts
|
||||
run_dump_test "dwarf-5-cu" $dump_opts
|
||||
run_dump_test "dwarf-5-nop-for-line-table" $dump_opts
|
||||
Only in binutils-2.35.2/gas/testsuite/gas/elf: elf.exp.orig
|
||||
diff -rup binutils.orig/gas/testsuite/gas/i386/dwarf5-line-1.d binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-1.d
|
||||
--- binutils.orig/gas/testsuite/gas/i386/dwarf5-line-1.d 2021-08-09 17:50:48.363446964 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-1.d 2021-08-09 17:51:03.308359865 +0100
|
||||
@@ -33,7 +33,7 @@ Raw dump of debug contents of section \.
|
||||
|
||||
The Directory Table \(offset 0x.*, lines 2, columns 1\):
|
||||
Entry Name
|
||||
- 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386
|
||||
+ 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite
|
||||
1 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386
|
||||
|
||||
The File Name Table \(offset 0x.*, lines 2, columns 3\):
|
||||
diff -rup binutils.orig/gas/testsuite/gas/i386/dwarf5-line-2.d binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-2.d
|
||||
--- binutils.orig/gas/testsuite/gas/i386/dwarf5-line-2.d 2021-08-09 17:50:48.365446953 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-2.d 2021-08-09 17:51:03.308359865 +0100
|
||||
@@ -33,7 +33,7 @@ Raw dump of debug contents of section \.
|
||||
|
||||
The Directory Table \(offset 0x.*, lines 2, columns 1\):
|
||||
Entry Name
|
||||
- 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386
|
||||
+ 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite
|
||||
1 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386
|
||||
|
||||
The File Name Table \(offset 0x.*, lines 1, columns 3\):
|
||||
--- /dev/null 2021-08-09 07:51:33.817495606 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-dir0.s 2021-08-09 17:55:06.745941103 +0100
|
||||
@@ -0,0 +1,19 @@
|
||||
+ .section .debug_info,"",%progbits
|
||||
+ .4byte 0x8a
|
||||
+ .2byte 0x2
|
||||
+ .4byte .Ldebug_abbrev0
|
||||
+ .byte 0x4
|
||||
+ .uleb128 0x1
|
||||
+
|
||||
+ .file 0 "../not-the-build-directory/master-source-file.c"
|
||||
+ .line 1
|
||||
+ .text
|
||||
+ .octa 0x12345678901234567890123456789012
|
||||
+
|
||||
+ .file 1 "secondary directory/secondary source file"
|
||||
+ .line 2
|
||||
+ .word 2
|
||||
+
|
||||
+ .file 2 "/tmp" "foo.c" md5 0x95828e8bc4f7404dbf7526fb7bd0f192
|
||||
+ .line 5
|
||||
+ .word 6
|
||||
--- /dev/null 2021-08-09 07:51:33.817495606 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-dir0.d 2021-08-09 17:55:06.745941103 +0100
|
||||
@@ -0,0 +1,20 @@
|
||||
+#as: --gdwarf-5
|
||||
+#name: DWARF5 dir[0]
|
||||
+#readelf: -wl
|
||||
+
|
||||
+#...
|
||||
+ The Directory Table \(offset 0x.*, lines 4, columns 1\):
|
||||
+ Entry Name
|
||||
+ 0 \(indirect line string, offset: 0x0\): .*/gas/testsuite
|
||||
+ 1 \(indirect line string, offset: 0x.*\): ../not-the-build-directory
|
||||
+ 2 \(indirect line string, offset: 0x.*\): secondary directory
|
||||
+ 3 \(indirect line string, offset: 0x.*\): /tmp
|
||||
+
|
||||
+ The File Name Table \(offset 0x.*, lines 3, columns 3\):
|
||||
+ Entry Dir MD5 Name
|
||||
+ 0 1 0x0 \(indirect line string, offset: 0x.*\): master-source-file.c
|
||||
+ 1 2 0x0 \(indirect line string, offset: 0x.*\): secondary source file
|
||||
+ 2 3 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c
|
||||
+#pass
|
||||
+
|
||||
+
|
||||
34
binutils-dwarf-DW_FORM_ref8.patch
Normal file
34
binutils-dwarf-DW_FORM_ref8.patch
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
|
||||
index 5807744729..cf68ebaff7 100644
|
||||
--- a/binutils/dwarf.c
|
||||
+++ b/binutils/dwarf.c
|
||||
@@ -2025,6 +2025,21 @@ skip_attr_bytes (unsigned long form,
|
||||
break;
|
||||
|
||||
case DW_FORM_ref8:
|
||||
+ {
|
||||
+ dwarf_vma high_bits;
|
||||
+
|
||||
+ SAFE_BYTE_GET64 (data, &high_bits, &uvalue, end);
|
||||
+ data += 8;
|
||||
+ if (sizeof (uvalue) > 4)
|
||||
+ uvalue += high_bits << 32;
|
||||
+ else if (high_bits != 0)
|
||||
+ {
|
||||
+ /* FIXME: What to do ? */
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
case DW_FORM_data8:
|
||||
case DW_FORM_ref_sig8:
|
||||
data += 8;
|
||||
@@ -2115,6 +2130,7 @@ get_type_abbrev_from_form (unsigned long form,
|
||||
case DW_FORM_ref1:
|
||||
case DW_FORM_ref2:
|
||||
case DW_FORM_ref4:
|
||||
+ case DW_FORM_ref8:
|
||||
case DW_FORM_ref_udata:
|
||||
if (uvalue + cu_offset > section->size)
|
||||
{
|
||||
142
binutils-dwarf-type-sign-2.patch
Normal file
142
binutils-dwarf-type-sign-2.patch
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
--- binutils.orig/binutils/dwarf.c 2020-11-03 17:10:15.182386267 +0000
|
||||
+++ binutils-2.35.1/binutils/dwarf.c 2020-11-03 17:14:38.660411672 +0000
|
||||
@@ -876,6 +876,7 @@ typedef struct abbrev_list
|
||||
{
|
||||
abbrev_entry * first_abbrev;
|
||||
abbrev_entry * last_abbrev;
|
||||
+ dwarf_vma abbrev_base;
|
||||
dwarf_vma abbrev_offset;
|
||||
struct abbrev_list * next;
|
||||
unsigned char * start_of_next_abbrevs;
|
||||
@@ -955,10 +956,11 @@ free_all_abbrevs (void)
|
||||
}
|
||||
|
||||
static abbrev_list *
|
||||
-new_abbrev_list (dwarf_vma abbrev_offset)
|
||||
+new_abbrev_list (dwarf_vma abbrev_base, dwarf_vma abbrev_offset)
|
||||
{
|
||||
abbrev_list * list = (abbrev_list *) xcalloc (sizeof * list, 1);
|
||||
|
||||
+ list->abbrev_base = abbrev_base;
|
||||
list->abbrev_offset = abbrev_offset;
|
||||
|
||||
list->next = abbrev_lists;
|
||||
@@ -968,12 +970,14 @@ new_abbrev_list (dwarf_vma abbrev_offset
|
||||
}
|
||||
|
||||
static abbrev_list *
|
||||
-find_abbrev_list_by_abbrev_offset (dwarf_vma abbrev_offset)
|
||||
+find_abbrev_list_by_abbrev_offset (dwarf_vma abbrev_base,
|
||||
+ dwarf_vma abbrev_offset)
|
||||
{
|
||||
abbrev_list * list;
|
||||
|
||||
for (list = abbrev_lists; list != NULL; list = list->next)
|
||||
- if (list->abbrev_offset == abbrev_offset)
|
||||
+ if (list->abbrev_base == abbrev_base
|
||||
+ && list->abbrev_offset == abbrev_offset)
|
||||
return list;
|
||||
|
||||
return NULL;
|
||||
@@ -2415,10 +2419,10 @@ read_and_display_attr_value (unsigned lo
|
||||
case DW_FORM_ref_addr:
|
||||
if (dwarf_version == 2)
|
||||
SAFE_BYTE_GET_AND_INC (uvalue, data, pointer_size, end);
|
||||
- else if (dwarf_version == 3 || dwarf_version == 4)
|
||||
+ else if (dwarf_version > 2)
|
||||
SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end);
|
||||
else
|
||||
- error (_("Internal error: DWARF version is not 2, 3 or 4.\n"));
|
||||
+ error (_("Internal error: DW_FORM_ref_addr is not supported in DWARF version 1.\n"));
|
||||
break;
|
||||
|
||||
case DW_FORM_addr:
|
||||
@@ -3455,6 +3459,8 @@ process_debug_info (struct dwarf_section
|
||||
{
|
||||
DWARF2_Internal_CompUnit compunit;
|
||||
unsigned char * hdrptr;
|
||||
+ dwarf_vma abbrev_base;
|
||||
+ size_t abbrev_size;
|
||||
dwarf_vma cu_offset;
|
||||
unsigned int offset_size;
|
||||
unsigned int initial_length_size;
|
||||
@@ -3499,25 +3505,25 @@ process_debug_info (struct dwarf_section
|
||||
|
||||
SAFE_BYTE_GET_AND_INC (compunit.cu_abbrev_offset, hdrptr, offset_size, end);
|
||||
|
||||
- list = find_abbrev_list_by_abbrev_offset (compunit.cu_abbrev_offset);
|
||||
+ if (this_set == NULL)
|
||||
+ {
|
||||
+ abbrev_base = 0;
|
||||
+ abbrev_size = debug_displays [abbrev_sec].section.size;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ abbrev_base = this_set->section_offsets [DW_SECT_ABBREV];
|
||||
+ abbrev_size = this_set->section_sizes [DW_SECT_ABBREV];
|
||||
+ }
|
||||
+
|
||||
+ list = find_abbrev_list_by_abbrev_offset (abbrev_base,
|
||||
+ compunit.cu_abbrev_offset);
|
||||
if (list == NULL)
|
||||
{
|
||||
- dwarf_vma abbrev_base;
|
||||
- size_t abbrev_size;
|
||||
unsigned char * next;
|
||||
|
||||
- if (this_set == NULL)
|
||||
- {
|
||||
- abbrev_base = 0;
|
||||
- abbrev_size = debug_displays [abbrev_sec].section.size;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- abbrev_base = this_set->section_offsets [DW_SECT_ABBREV];
|
||||
- abbrev_size = this_set->section_sizes [DW_SECT_ABBREV];
|
||||
- }
|
||||
-
|
||||
- list = new_abbrev_list (compunit.cu_abbrev_offset);
|
||||
+ list = new_abbrev_list (abbrev_base,
|
||||
+ compunit.cu_abbrev_offset);
|
||||
next = process_abbrev_set
|
||||
(((unsigned char *) debug_displays [abbrev_sec].section.start
|
||||
+ abbrev_base + compunit.cu_abbrev_offset),
|
||||
@@ -3734,12 +3740,14 @@ process_debug_info (struct dwarf_section
|
||||
(unsigned long) debug_displays [abbrev_sec].section.size);
|
||||
else
|
||||
{
|
||||
- list = find_abbrev_list_by_abbrev_offset (compunit.cu_abbrev_offset);
|
||||
+ list = find_abbrev_list_by_abbrev_offset (abbrev_base,
|
||||
+ compunit.cu_abbrev_offset);
|
||||
if (list == NULL)
|
||||
{
|
||||
unsigned char * next;
|
||||
|
||||
- list = new_abbrev_list (compunit.cu_abbrev_offset);
|
||||
+ list = new_abbrev_list (abbrev_base,
|
||||
+ compunit.cu_abbrev_offset);
|
||||
next = process_abbrev_set
|
||||
(((unsigned char *) debug_displays [abbrev_sec].section.start
|
||||
+ abbrev_base + compunit.cu_abbrev_offset),
|
||||
@@ -5304,7 +5312,7 @@ display_debug_lines_decoded (struct dwar
|
||||
else
|
||||
{
|
||||
newFileName = (char *) xmalloc (fileNameLength + 1);
|
||||
- strcpy (newFileName, fileName);
|
||||
+ strncpy (newFileName, fileName, fileNameLength + 1);
|
||||
}
|
||||
|
||||
if (!do_wide || (fileNameLength <= MAX_FILENAME_LENGTH))
|
||||
@@ -6029,10 +6037,10 @@ display_debug_abbrev (struct dwarf_secti
|
||||
dwarf_vma offset;
|
||||
|
||||
offset = start - section->start;
|
||||
- list = find_abbrev_list_by_abbrev_offset (offset);
|
||||
+ list = find_abbrev_list_by_abbrev_offset (0, offset);
|
||||
if (list == NULL)
|
||||
{
|
||||
- list = new_abbrev_list (offset);
|
||||
+ list = new_abbrev_list (0, offset);
|
||||
start = process_abbrev_set (start, end, list);
|
||||
list->start_of_next_abbrevs = start;
|
||||
}
|
||||
931
binutils-dwarf-type-sign.patch
Normal file
931
binutils-dwarf-type-sign.patch
Normal file
|
|
@ -0,0 +1,931 @@
|
|||
--- binutils.orig/binutils/dwarf.c 2020-10-21 14:15:47.101351869 +0100
|
||||
+++ binutils-2.35.1/binutils/dwarf.c 2020-10-21 14:17:44.608585923 +0100
|
||||
@@ -1868,7 +1868,7 @@ skip_attr_bytes (unsigned long
|
||||
case DW_FORM_ref_addr:
|
||||
if (dwarf_version == 2)
|
||||
SAFE_BYTE_GET_AND_INC (uvalue, data, pointer_size, end);
|
||||
- else if (dwarf_version == 3 || dwarf_version == 4)
|
||||
+ else if (dwarf_version > 2)
|
||||
SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end);
|
||||
else
|
||||
return NULL;
|
||||
@@ -1920,6 +1920,7 @@ skip_attr_bytes (unsigned long
|
||||
|
||||
case DW_FORM_ref8:
|
||||
case DW_FORM_data8:
|
||||
+ case DW_FORM_ref_sig8:
|
||||
data += 8;
|
||||
break;
|
||||
|
||||
@@ -1934,6 +1935,7 @@ skip_attr_bytes (unsigned long
|
||||
case DW_FORM_block:
|
||||
case DW_FORM_exprloc:
|
||||
READ_ULEB (uvalue, data, end);
|
||||
+ data += uvalue;
|
||||
break;
|
||||
|
||||
case DW_FORM_block1:
|
||||
@@ -1951,12 +1953,12 @@ skip_attr_bytes (unsigned long
|
||||
data += 4 + uvalue;
|
||||
break;
|
||||
|
||||
- case DW_FORM_ref_sig8:
|
||||
- data += 8;
|
||||
- break;
|
||||
-
|
||||
case DW_FORM_indirect:
|
||||
- /* FIXME: Handle this form. */
|
||||
+ READ_ULEB (form, data, end);
|
||||
+ if (form == DW_FORM_implicit_const)
|
||||
+ SKIP_ULEB (data, end);
|
||||
+ return skip_attr_bytes (form, data, end, pointer_size, offset_size, dwarf_version, value_return);
|
||||
+
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@@ -1978,7 +1980,7 @@ get_type_signedness (unsigned char *
|
||||
dwarf_vma offset_size,
|
||||
int dwarf_version,
|
||||
bfd_boolean * is_signed,
|
||||
- bfd_boolean is_nested)
|
||||
+ unsigned int nesting)
|
||||
{
|
||||
unsigned long abbrev_number;
|
||||
abbrev_entry * entry;
|
||||
@@ -1997,6 +1999,14 @@ get_type_signedness (unsigned char *
|
||||
/* FIXME: Issue a warning ? */
|
||||
return;
|
||||
|
||||
+#define MAX_NESTING 20
|
||||
+ if (nesting > MAX_NESTING)
|
||||
+ {
|
||||
+ /* FIXME: Warn - or is this expected ?
|
||||
+ NB/ We need to avoid infinite recursion. */
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
for (attr = entry->first_attr;
|
||||
attr != NULL && attr->attribute;
|
||||
attr = attr->next)
|
||||
@@ -2019,16 +2029,12 @@ get_type_signedness (unsigned char *
|
||||
#endif
|
||||
case DW_AT_type:
|
||||
/* Recurse. */
|
||||
- if (is_nested)
|
||||
- {
|
||||
- /* FIXME: Warn - or is this expected ?
|
||||
- NB/ We need to avoid infinite recursion. */
|
||||
- return;
|
||||
- }
|
||||
if (uvalue >= (size_t) (end - start))
|
||||
return;
|
||||
- get_type_signedness (start, start + uvalue, end, pointer_size,
|
||||
- offset_size, dwarf_version, is_signed, TRUE);
|
||||
+ /* We cannot correctly process DW_FORM_ref_addr at the moment. */
|
||||
+ if (attr->form != DW_FORM_ref_addr)
|
||||
+ get_type_signedness (start, start + uvalue, end, pointer_size,
|
||||
+ offset_size, dwarf_version, is_signed, nesting + 1);
|
||||
break;
|
||||
|
||||
case DW_AT_encoding:
|
||||
@@ -2206,7 +2212,6 @@ read_and_display_attr_value (unsigned lo
|
||||
SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end);
|
||||
else
|
||||
error (_("Internal error: DWARF version is not 2, 3 or 4.\n"));
|
||||
-
|
||||
break;
|
||||
|
||||
case DW_FORM_addr:
|
||||
@@ -2246,8 +2251,8 @@ read_and_display_attr_value (unsigned lo
|
||||
uvalue = svalue;
|
||||
break;
|
||||
|
||||
- case DW_FORM_GNU_str_index:
|
||||
case DW_FORM_ref_udata:
|
||||
+ case DW_FORM_GNU_str_index:
|
||||
case DW_FORM_udata:
|
||||
case DW_FORM_GNU_addr_index:
|
||||
READ_ULEB (uvalue, data, end);
|
||||
@@ -2663,8 +2668,10 @@ read_and_display_attr_value (unsigned lo
|
||||
{
|
||||
bfd_boolean is_signed = FALSE;
|
||||
|
||||
- get_type_signedness (start, start + uvalue, end, pointer_size,
|
||||
- offset_size, dwarf_version, & is_signed, FALSE);
|
||||
+ /* We cannot correctly process DW_FORM_ref_addr at the moment. */
|
||||
+ if (form != DW_FORM_ref_addr)
|
||||
+ get_type_signedness (start, start + uvalue, end, pointer_size,
|
||||
+ offset_size, dwarf_version, & is_signed, 0);
|
||||
level_type_signed[level] = is_signed;
|
||||
}
|
||||
break;
|
||||
diff -rup binutils.orig/binutils/dwarf.c binutils-2.35.1/binutils/dwarf.c
|
||||
--- binutils.orig/binutils/dwarf.c 2020-10-27 16:24:29.489636820 +0000
|
||||
+++ binutils-2.35.1/binutils/dwarf.c 2020-10-27 16:24:44.507568083 +0000
|
||||
@@ -849,101 +849,204 @@ fetch_indexed_value (dwarf_vma offset, d
|
||||
/* FIXME: There are better and more efficient ways to handle
|
||||
these structures. For now though, I just want something that
|
||||
is simple to implement. */
|
||||
+/* Records a single attribute in an abbrev. */
|
||||
typedef struct abbrev_attr
|
||||
{
|
||||
- unsigned long attribute;
|
||||
- unsigned long form;
|
||||
- bfd_signed_vma implicit_const;
|
||||
- struct abbrev_attr *next;
|
||||
+ unsigned long attribute;
|
||||
+ unsigned long form;
|
||||
+ bfd_signed_vma implicit_const;
|
||||
+ struct abbrev_attr * next;
|
||||
}
|
||||
abbrev_attr;
|
||||
|
||||
+/* Records a single abbrev. */
|
||||
typedef struct abbrev_entry
|
||||
{
|
||||
- unsigned long entry;
|
||||
- unsigned long tag;
|
||||
- int children;
|
||||
- struct abbrev_attr *first_attr;
|
||||
- struct abbrev_attr *last_attr;
|
||||
- struct abbrev_entry *next;
|
||||
+ unsigned long number;
|
||||
+ unsigned long tag;
|
||||
+ int children;
|
||||
+ struct abbrev_attr * first_attr;
|
||||
+ struct abbrev_attr * last_attr;
|
||||
+ struct abbrev_entry * next;
|
||||
}
|
||||
abbrev_entry;
|
||||
|
||||
-static abbrev_entry *first_abbrev = NULL;
|
||||
-static abbrev_entry *last_abbrev = NULL;
|
||||
+/* Records a set of abbreviations. */
|
||||
+typedef struct abbrev_list
|
||||
+{
|
||||
+ abbrev_entry * first_abbrev;
|
||||
+ abbrev_entry * last_abbrev;
|
||||
+ dwarf_vma abbrev_offset;
|
||||
+ struct abbrev_list * next;
|
||||
+ unsigned char * start_of_next_abbrevs;
|
||||
+}
|
||||
+abbrev_list;
|
||||
+
|
||||
+/* Records all the abbrevs found so far. */
|
||||
+static struct abbrev_list * abbrev_lists = NULL;
|
||||
+
|
||||
+typedef struct abbrev_map
|
||||
+{
|
||||
+ dwarf_vma start;
|
||||
+ dwarf_vma end;
|
||||
+ abbrev_list * list;
|
||||
+} abbrev_map;
|
||||
+
|
||||
+/* Maps between CU offsets and abbrev sets. */
|
||||
+static abbrev_map * cu_abbrev_map = NULL;
|
||||
+static unsigned long num_abbrev_map_entries = 0;
|
||||
+static unsigned long next_free_abbrev_map_entry = 0;
|
||||
+
|
||||
+#define INITIAL_NUM_ABBREV_MAP_ENTRIES 8
|
||||
+#define ABBREV_MAP_ENTRIES_INCREMENT 8
|
||||
+
|
||||
+static void
|
||||
+record_abbrev_list_for_cu (dwarf_vma start, dwarf_vma end, abbrev_list * list)
|
||||
+{
|
||||
+ if (cu_abbrev_map == NULL)
|
||||
+ {
|
||||
+ num_abbrev_map_entries = INITIAL_NUM_ABBREV_MAP_ENTRIES;
|
||||
+ cu_abbrev_map = xmalloc (num_abbrev_map_entries * sizeof (* cu_abbrev_map));
|
||||
+ }
|
||||
+ else if (next_free_abbrev_map_entry == num_abbrev_map_entries)
|
||||
+ {
|
||||
+ num_abbrev_map_entries += ABBREV_MAP_ENTRIES_INCREMENT;
|
||||
+ cu_abbrev_map = xrealloc (cu_abbrev_map, num_abbrev_map_entries * sizeof (* cu_abbrev_map));
|
||||
+ }
|
||||
+
|
||||
+ cu_abbrev_map[next_free_abbrev_map_entry].start = start;
|
||||
+ cu_abbrev_map[next_free_abbrev_map_entry].end = end;
|
||||
+ cu_abbrev_map[next_free_abbrev_map_entry].list = list;
|
||||
+ next_free_abbrev_map_entry ++;
|
||||
+}
|
||||
|
||||
static void
|
||||
-free_abbrevs (void)
|
||||
+free_all_abbrevs (void)
|
||||
{
|
||||
- abbrev_entry *abbrv;
|
||||
+ abbrev_list * list;
|
||||
|
||||
- for (abbrv = first_abbrev; abbrv;)
|
||||
+ for (list = abbrev_lists; list != NULL;)
|
||||
{
|
||||
- abbrev_entry *next_abbrev = abbrv->next;
|
||||
- abbrev_attr *attr;
|
||||
+ abbrev_list * next = list->next;
|
||||
+ abbrev_entry * abbrv;
|
||||
|
||||
- for (attr = abbrv->first_attr; attr;)
|
||||
+ for (abbrv = list->first_abbrev; abbrv != NULL;)
|
||||
{
|
||||
- abbrev_attr *next_attr = attr->next;
|
||||
+ abbrev_entry * next_abbrev = abbrv->next;
|
||||
+ abbrev_attr * attr;
|
||||
|
||||
- free (attr);
|
||||
- attr = next_attr;
|
||||
+ for (attr = abbrv->first_attr; attr;)
|
||||
+ {
|
||||
+ abbrev_attr *next_attr = attr->next;
|
||||
+
|
||||
+ free (attr);
|
||||
+ attr = next_attr;
|
||||
+ }
|
||||
+
|
||||
+ free (abbrv);
|
||||
+ abbrv = next_abbrev;
|
||||
}
|
||||
|
||||
- free (abbrv);
|
||||
- abbrv = next_abbrev;
|
||||
+ free (list);
|
||||
+ list = next;
|
||||
}
|
||||
|
||||
- last_abbrev = first_abbrev = NULL;
|
||||
+ abbrev_lists = NULL;
|
||||
+}
|
||||
+
|
||||
+static abbrev_list *
|
||||
+new_abbrev_list (dwarf_vma abbrev_offset)
|
||||
+{
|
||||
+ abbrev_list * list = (abbrev_list *) xcalloc (sizeof * list, 1);
|
||||
+
|
||||
+ list->abbrev_offset = abbrev_offset;
|
||||
+
|
||||
+ list->next = abbrev_lists;
|
||||
+ abbrev_lists = list;
|
||||
+
|
||||
+ return list;
|
||||
+}
|
||||
+
|
||||
+static abbrev_list *
|
||||
+find_abbrev_list_by_abbrev_offset (dwarf_vma abbrev_offset)
|
||||
+{
|
||||
+ abbrev_list * list;
|
||||
+
|
||||
+ for (list = abbrev_lists; list != NULL; list = list->next)
|
||||
+ if (list->abbrev_offset == abbrev_offset)
|
||||
+ return list;
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+/* Find the abbreviation map for the CU that includes OFFSET.
|
||||
+ OFFSET is an absolute offset from the start of the .debug_info section. */
|
||||
+/* FIXME: This function is going to slow down readelf & objdump.
|
||||
+ Consider using a better algorithm to mitigate this effect. */
|
||||
+
|
||||
+static abbrev_map *
|
||||
+find_abbrev_map_by_offset (dwarf_vma offset)
|
||||
+{
|
||||
+ unsigned long i;
|
||||
+
|
||||
+ for (i = 0; i < next_free_abbrev_map_entry; i++)
|
||||
+ if (cu_abbrev_map[i].start <= offset
|
||||
+ && cu_abbrev_map[i].end > offset)
|
||||
+ return cu_abbrev_map + i;
|
||||
+
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
-add_abbrev (unsigned long number, unsigned long tag, int children)
|
||||
+add_abbrev (unsigned long number,
|
||||
+ unsigned long tag,
|
||||
+ int children,
|
||||
+ abbrev_list * list)
|
||||
{
|
||||
- abbrev_entry *entry;
|
||||
+ abbrev_entry * entry;
|
||||
|
||||
- entry = (abbrev_entry *) malloc (sizeof (*entry));
|
||||
- if (entry == NULL)
|
||||
- /* ugg */
|
||||
- return;
|
||||
+ entry = (abbrev_entry *) xmalloc (sizeof (*entry));
|
||||
|
||||
- entry->entry = number;
|
||||
+ entry->number = number;
|
||||
entry->tag = tag;
|
||||
entry->children = children;
|
||||
entry->first_attr = NULL;
|
||||
entry->last_attr = NULL;
|
||||
entry->next = NULL;
|
||||
|
||||
- if (first_abbrev == NULL)
|
||||
- first_abbrev = entry;
|
||||
+ assert (list != NULL);
|
||||
+
|
||||
+ if (list->first_abbrev == NULL)
|
||||
+ list->first_abbrev = entry;
|
||||
else
|
||||
- last_abbrev->next = entry;
|
||||
+ list->last_abbrev->next = entry;
|
||||
|
||||
- last_abbrev = entry;
|
||||
+ list->last_abbrev = entry;
|
||||
}
|
||||
|
||||
static void
|
||||
-add_abbrev_attr (unsigned long attribute, unsigned long form,
|
||||
- bfd_signed_vma implicit_const)
|
||||
+add_abbrev_attr (unsigned long attribute,
|
||||
+ unsigned long form,
|
||||
+ bfd_signed_vma implicit_const,
|
||||
+ abbrev_list * list)
|
||||
{
|
||||
abbrev_attr *attr;
|
||||
|
||||
- attr = (abbrev_attr *) malloc (sizeof (*attr));
|
||||
- if (attr == NULL)
|
||||
- /* ugg */
|
||||
- return;
|
||||
+ attr = (abbrev_attr *) xmalloc (sizeof (*attr));
|
||||
|
||||
attr->attribute = attribute;
|
||||
attr->form = form;
|
||||
attr->implicit_const = implicit_const;
|
||||
attr->next = NULL;
|
||||
|
||||
- if (last_abbrev->first_attr == NULL)
|
||||
- last_abbrev->first_attr = attr;
|
||||
+ assert (list != NULL && list->last_abbrev != NULL);
|
||||
+
|
||||
+ if (list->last_abbrev->first_attr == NULL)
|
||||
+ list->last_abbrev->first_attr = attr;
|
||||
else
|
||||
- last_abbrev->last_attr->next = attr;
|
||||
+ list->last_abbrev->last_attr->next = attr;
|
||||
|
||||
- last_abbrev->last_attr = attr;
|
||||
+ list->last_abbrev->last_attr = attr;
|
||||
}
|
||||
|
||||
/* Processes the (partial) contents of a .debug_abbrev section.
|
||||
@@ -952,11 +1055,10 @@ add_abbrev_attr (unsigned long attribute
|
||||
an abbreviation set was found. */
|
||||
|
||||
static unsigned char *
|
||||
-process_abbrev_section (unsigned char *start, unsigned char *end)
|
||||
+process_abbrev_set (unsigned char * start,
|
||||
+ const unsigned char * end,
|
||||
+ abbrev_list * list)
|
||||
{
|
||||
- if (first_abbrev != NULL)
|
||||
- return NULL;
|
||||
-
|
||||
while (start < end)
|
||||
{
|
||||
unsigned long entry;
|
||||
@@ -966,7 +1068,7 @@ process_abbrev_section (unsigned char *s
|
||||
|
||||
READ_ULEB (entry, start, end);
|
||||
|
||||
- /* A single zero is supposed to end the section according
|
||||
+ /* A single zero is supposed to end the set according
|
||||
to the standard. If there's more, then signal that to
|
||||
the caller. */
|
||||
if (start == end)
|
||||
@@ -980,7 +1082,7 @@ process_abbrev_section (unsigned char *s
|
||||
|
||||
children = *start++;
|
||||
|
||||
- add_abbrev (entry, tag, children);
|
||||
+ add_abbrev (entry, tag, children, list);
|
||||
|
||||
do
|
||||
{
|
||||
@@ -1003,7 +1105,7 @@ process_abbrev_section (unsigned char *s
|
||||
break;
|
||||
}
|
||||
|
||||
- add_abbrev_attr (attribute, form, implicit_const);
|
||||
+ add_abbrev_attr (attribute, form, implicit_const, list);
|
||||
}
|
||||
while (attribute != 0);
|
||||
}
|
||||
@@ -1969,36 +2071,123 @@ skip_attr_bytes (unsigned long
|
||||
return data;
|
||||
}
|
||||
|
||||
-/* Return IS_SIGNED set to TRUE if the type at
|
||||
- DATA can be determined to be a signed type. */
|
||||
+/* Given form FORM with value UVALUE, locate and return the abbreviation
|
||||
+ associated with it. */
|
||||
+
|
||||
+static abbrev_entry *
|
||||
+get_type_abbrev_from_form (unsigned long form,
|
||||
+ unsigned long uvalue,
|
||||
+ dwarf_vma cu_offset,
|
||||
+ const struct dwarf_section * section,
|
||||
+ unsigned long * abbrev_num_return,
|
||||
+ unsigned char ** data_return,
|
||||
+ unsigned long * cu_offset_return)
|
||||
+{
|
||||
+ unsigned long abbrev_number;
|
||||
+ abbrev_map * map;
|
||||
+ abbrev_entry * entry;
|
||||
+ unsigned char * data;
|
||||
+
|
||||
+ if (abbrev_num_return != NULL)
|
||||
+ * abbrev_num_return = 0;
|
||||
+ if (data_return != NULL)
|
||||
+ * data_return = NULL;
|
||||
+
|
||||
+ switch (form)
|
||||
+ {
|
||||
+ case DW_FORM_GNU_ref_alt:
|
||||
+ /* FIXME: We are unable to handle this form at the moment. */
|
||||
+ return NULL;
|
||||
+
|
||||
+ case DW_FORM_ref_addr:
|
||||
+ if (uvalue >= section->size)
|
||||
+ {
|
||||
+ warn (_("Unable to resolve ref_addr form: uvalue %lx > section size %lx (%s)\n"),
|
||||
+ uvalue, (long) section->size, section->name);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case DW_FORM_ref1:
|
||||
+ case DW_FORM_ref2:
|
||||
+ case DW_FORM_ref4:
|
||||
+ case DW_FORM_ref_udata:
|
||||
+ if (uvalue + cu_offset > section->size)
|
||||
+ {
|
||||
+ warn (_("Unable to resolve ref form: uvalue %lx + cu_offset %lx > section size %lx\n"),
|
||||
+ uvalue, (long) cu_offset, (long) section->size);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ uvalue += cu_offset;
|
||||
+ break;
|
||||
+
|
||||
+ /* FIXME: Are there other DW_FORMs that can be used by types ? */
|
||||
+
|
||||
+ default:
|
||||
+ warn (_("Unexpected form %lx encountered whilst finding abbreviation for type\n"), form);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ data = (unsigned char *) section->start + uvalue;
|
||||
+ map = find_abbrev_map_by_offset (uvalue);
|
||||
+
|
||||
+ if (map == NULL)
|
||||
+ {
|
||||
+ warn (_("Unable to find abbreviations for CU offset %#lx\n"), uvalue);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ if (map->list == NULL)
|
||||
+ {
|
||||
+ warn (_("Empty abbreviation list encountered for CU offset %lx\n"), uvalue);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (cu_offset_return != NULL)
|
||||
+ {
|
||||
+ if (form == DW_FORM_ref_addr)
|
||||
+ * cu_offset_return = map->start;
|
||||
+ else
|
||||
+ * cu_offset_return = cu_offset;
|
||||
+ }
|
||||
+
|
||||
+ READ_ULEB (abbrev_number, data, section->start + section->size);
|
||||
+
|
||||
+ for (entry = map->list->first_abbrev; entry != NULL; entry = entry->next)
|
||||
+ if (entry->number == abbrev_number)
|
||||
+ break;
|
||||
+
|
||||
+ if (abbrev_num_return != NULL)
|
||||
+ * abbrev_num_return = abbrev_number;
|
||||
+
|
||||
+ if (data_return != NULL)
|
||||
+ * data_return = data;
|
||||
+
|
||||
+ if (entry == NULL)
|
||||
+ warn (_("Unable to find entry for abbreviation %lu\n"), abbrev_number);
|
||||
+
|
||||
+ return entry;
|
||||
+}
|
||||
+
|
||||
+/* Return IS_SIGNED set to TRUE if the type using abbreviation ENTRY
|
||||
+ can be determined to be a signed type. The data for ENTRY can be
|
||||
+ found starting at DATA. */
|
||||
|
||||
static void
|
||||
-get_type_signedness (unsigned char * start,
|
||||
+get_type_signedness (abbrev_entry * entry,
|
||||
+ const struct dwarf_section * section,
|
||||
unsigned char * data,
|
||||
unsigned const char * end,
|
||||
+ dwarf_vma cu_offset,
|
||||
dwarf_vma pointer_size,
|
||||
dwarf_vma offset_size,
|
||||
int dwarf_version,
|
||||
bfd_boolean * is_signed,
|
||||
unsigned int nesting)
|
||||
{
|
||||
- unsigned long abbrev_number;
|
||||
- abbrev_entry * entry;
|
||||
abbrev_attr * attr;
|
||||
|
||||
* is_signed = FALSE;
|
||||
|
||||
- READ_ULEB (abbrev_number, data, end);
|
||||
-
|
||||
- for (entry = first_abbrev;
|
||||
- entry != NULL && entry->entry != abbrev_number;
|
||||
- entry = entry->next)
|
||||
- continue;
|
||||
-
|
||||
- if (entry == NULL)
|
||||
- /* FIXME: Issue a warning ? */
|
||||
- return;
|
||||
-
|
||||
#define MAX_NESTING 20
|
||||
if (nesting > MAX_NESTING)
|
||||
{
|
||||
@@ -2011,6 +2200,7 @@ get_type_signedness (unsigned char *
|
||||
attr != NULL && attr->attribute;
|
||||
attr = attr->next)
|
||||
{
|
||||
+ unsigned char * orig_data = data;
|
||||
dwarf_vma uvalue = 0;
|
||||
|
||||
data = skip_attr_bytes (attr->form, data, end, pointer_size,
|
||||
@@ -2020,21 +2210,38 @@ get_type_signedness (unsigned char *
|
||||
|
||||
switch (attr->attribute)
|
||||
{
|
||||
-#if 0 /* FIXME: It would be nice to print the name of the type,
|
||||
- but this would mean updating a lot of binutils tests. */
|
||||
+ case DW_AT_linkage_name:
|
||||
case DW_AT_name:
|
||||
- if (attr->form == DW_FORM_strp)
|
||||
- printf ("%s", fetch_indirect_string (uvalue));
|
||||
+ if (do_wide)
|
||||
+ {
|
||||
+ if (attr->form == DW_FORM_strp)
|
||||
+ printf (", %s", fetch_indirect_string (uvalue));
|
||||
+ else if (attr->form == DW_FORM_string)
|
||||
+ printf (", %s", orig_data);
|
||||
+ }
|
||||
break;
|
||||
-#endif
|
||||
+
|
||||
case DW_AT_type:
|
||||
/* Recurse. */
|
||||
- if (uvalue >= (size_t) (end - start))
|
||||
- return;
|
||||
- /* We cannot correctly process DW_FORM_ref_addr at the moment. */
|
||||
- if (attr->form != DW_FORM_ref_addr)
|
||||
- get_type_signedness (start, start + uvalue, end, pointer_size,
|
||||
- offset_size, dwarf_version, is_signed, nesting + 1);
|
||||
+ {
|
||||
+ abbrev_entry * type_abbrev;
|
||||
+ unsigned char * type_data;
|
||||
+ unsigned long type_cu_offset;
|
||||
+
|
||||
+ type_abbrev = get_type_abbrev_from_form (attr->form,
|
||||
+ uvalue,
|
||||
+ cu_offset,
|
||||
+ section,
|
||||
+ NULL /* abbrev num return */,
|
||||
+ & type_data,
|
||||
+ & type_cu_offset);
|
||||
+ if (type_abbrev == NULL)
|
||||
+ break;
|
||||
+
|
||||
+ get_type_signedness (type_abbrev, section, type_data, end, type_cu_offset,
|
||||
+ pointer_size, offset_size, dwarf_version,
|
||||
+ is_signed, nesting + 1);
|
||||
+ }
|
||||
break;
|
||||
|
||||
case DW_AT_encoding:
|
||||
@@ -2276,12 +2483,12 @@ read_and_display_attr_value (unsigned lo
|
||||
{
|
||||
case DW_FORM_ref_addr:
|
||||
if (!do_loc)
|
||||
- printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x",uvalue));
|
||||
+ printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x", uvalue));
|
||||
break;
|
||||
|
||||
case DW_FORM_GNU_ref_alt:
|
||||
if (!do_loc)
|
||||
- printf ("%c<alt 0x%s>", delimiter, dwarf_vmatoa ("x",uvalue));
|
||||
+ printf ("%c<alt 0x%s>", delimiter, dwarf_vmatoa ("x", uvalue));
|
||||
/* FIXME: Follow the reference... */
|
||||
break;
|
||||
|
||||
@@ -2667,11 +2874,18 @@ read_and_display_attr_value (unsigned lo
|
||||
&& uvalue < (size_t) (end - start))
|
||||
{
|
||||
bfd_boolean is_signed = FALSE;
|
||||
-
|
||||
- /* We cannot correctly process DW_FORM_ref_addr at the moment. */
|
||||
- if (form != DW_FORM_ref_addr)
|
||||
- get_type_signedness (start, start + uvalue, end, pointer_size,
|
||||
- offset_size, dwarf_version, & is_signed, 0);
|
||||
+ abbrev_entry * type_abbrev;
|
||||
+ unsigned char * type_data;
|
||||
+ unsigned long type_cu_offset;
|
||||
+
|
||||
+ type_abbrev = get_type_abbrev_from_form (form, uvalue, cu_offset,
|
||||
+ section, NULL, & type_data, & type_cu_offset);
|
||||
+ if (type_abbrev != NULL)
|
||||
+ {
|
||||
+ get_type_signedness (type_abbrev, section, type_data, end, type_cu_offset,
|
||||
+ pointer_size, offset_size, dwarf_version,
|
||||
+ & is_signed, 0);
|
||||
+ }
|
||||
level_type_signed[level] = is_signed;
|
||||
}
|
||||
break;
|
||||
@@ -2993,40 +3207,22 @@ read_and_display_attr_value (unsigned lo
|
||||
|
||||
case DW_AT_import:
|
||||
{
|
||||
- if (form == DW_FORM_ref_sig8
|
||||
- || form == DW_FORM_GNU_ref_alt)
|
||||
- break;
|
||||
-
|
||||
- if (form == DW_FORM_ref1
|
||||
- || form == DW_FORM_ref2
|
||||
- || form == DW_FORM_ref4
|
||||
- || form == DW_FORM_ref_udata)
|
||||
- uvalue += cu_offset;
|
||||
+ unsigned long abbrev_number;
|
||||
+ abbrev_entry *entry;
|
||||
|
||||
- if (uvalue >= section->size)
|
||||
- warn (_("Offset %s used as value for DW_AT_import attribute of DIE at offset 0x%lx is too big.\n"),
|
||||
- dwarf_vmatoa ("x", uvalue),
|
||||
- (unsigned long) (orig_data - section->start));
|
||||
+ entry = get_type_abbrev_from_form (form, uvalue, cu_offset,
|
||||
+ section, & abbrev_number, NULL, NULL);
|
||||
+ if (entry == NULL)
|
||||
+ {
|
||||
+ if (form != DW_FORM_GNU_ref_alt)
|
||||
+ warn (_("Offset %s used as value for DW_AT_import attribute of DIE at offset 0x%lx is too big.\n"),
|
||||
+ dwarf_vmatoa ("x", uvalue),
|
||||
+ (unsigned long) (orig_data - section->start));
|
||||
+ }
|
||||
else
|
||||
{
|
||||
- unsigned long abbrev_number;
|
||||
- abbrev_entry *entry;
|
||||
- unsigned char *p = section->start + uvalue;
|
||||
-
|
||||
- READ_ULEB (abbrev_number, p, end);
|
||||
-
|
||||
printf (_("\t[Abbrev Number: %ld"), abbrev_number);
|
||||
- /* Don't look up abbrev for DW_FORM_ref_addr, as it very often will
|
||||
- use different abbrev table, and we don't track .debug_info chunks
|
||||
- yet. */
|
||||
- if (form != DW_FORM_ref_addr)
|
||||
- {
|
||||
- for (entry = first_abbrev; entry != NULL; entry = entry->next)
|
||||
- if (entry->entry == abbrev_number)
|
||||
- break;
|
||||
- if (entry != NULL)
|
||||
- printf (" (%s)", get_TAG_name (entry->tag));
|
||||
- }
|
||||
+ printf (" (%s)", get_TAG_name (entry->tag));
|
||||
printf ("]");
|
||||
}
|
||||
}
|
||||
@@ -3245,8 +3441,98 @@ process_debug_info (struct dwarf_section
|
||||
|
||||
if (!do_loc && dwarf_start_die == 0)
|
||||
introduce (section, FALSE);
|
||||
+
|
||||
+ free_all_abbrevs ();
|
||||
+ free (cu_abbrev_map);
|
||||
+ cu_abbrev_map = NULL;
|
||||
+ next_free_abbrev_map_entry = 0;
|
||||
|
||||
- for (section_begin = start, unit = 0; start < end; unit++)
|
||||
+ /* In order to be able to resolve DW_FORM_ref_attr forms we need
|
||||
+ to load *all* of the abbrevs for all CUs in this .debug_info
|
||||
+ section. This does effectively mean that we (partially) read
|
||||
+ every CU header twice. */
|
||||
+ for (section_begin = start; start < end;)
|
||||
+ {
|
||||
+ DWARF2_Internal_CompUnit compunit;
|
||||
+ unsigned char * hdrptr;
|
||||
+ dwarf_vma cu_offset;
|
||||
+ unsigned int offset_size;
|
||||
+ unsigned int initial_length_size;
|
||||
+ struct cu_tu_set * this_set;
|
||||
+ abbrev_list * list;
|
||||
+
|
||||
+ hdrptr = start;
|
||||
+
|
||||
+ SAFE_BYTE_GET_AND_INC (compunit.cu_length, hdrptr, 4, end);
|
||||
+
|
||||
+ if (compunit.cu_length == 0xffffffff)
|
||||
+ {
|
||||
+ SAFE_BYTE_GET_AND_INC (compunit.cu_length, hdrptr, 8, end);
|
||||
+ offset_size = 8;
|
||||
+ initial_length_size = 12;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ offset_size = 4;
|
||||
+ initial_length_size = 4;
|
||||
+ }
|
||||
+
|
||||
+ SAFE_BYTE_GET_AND_INC (compunit.cu_version, hdrptr, 2, end);
|
||||
+
|
||||
+ cu_offset = start - section_begin;
|
||||
+
|
||||
+ this_set = find_cu_tu_set_v2 (cu_offset, do_types);
|
||||
+
|
||||
+ if (compunit.cu_version < 5)
|
||||
+ {
|
||||
+ compunit.cu_unit_type = DW_UT_compile;
|
||||
+ /* Initialize it due to a false compiler warning. */
|
||||
+ compunit.cu_pointer_size = -1;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ SAFE_BYTE_GET_AND_INC (compunit.cu_unit_type, hdrptr, 1, end);
|
||||
+ do_types = (compunit.cu_unit_type == DW_UT_type);
|
||||
+
|
||||
+ SAFE_BYTE_GET_AND_INC (compunit.cu_pointer_size, hdrptr, 1, end);
|
||||
+ }
|
||||
+
|
||||
+ SAFE_BYTE_GET_AND_INC (compunit.cu_abbrev_offset, hdrptr, offset_size, end);
|
||||
+
|
||||
+ list = find_abbrev_list_by_abbrev_offset (compunit.cu_abbrev_offset);
|
||||
+ if (list == NULL)
|
||||
+ {
|
||||
+ dwarf_vma abbrev_base;
|
||||
+ size_t abbrev_size;
|
||||
+ unsigned char * next;
|
||||
+
|
||||
+ if (this_set == NULL)
|
||||
+ {
|
||||
+ abbrev_base = 0;
|
||||
+ abbrev_size = debug_displays [abbrev_sec].section.size;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ abbrev_base = this_set->section_offsets [DW_SECT_ABBREV];
|
||||
+ abbrev_size = this_set->section_sizes [DW_SECT_ABBREV];
|
||||
+ }
|
||||
+
|
||||
+ list = new_abbrev_list (compunit.cu_abbrev_offset);
|
||||
+ next = process_abbrev_set
|
||||
+ (((unsigned char *) debug_displays [abbrev_sec].section.start
|
||||
+ + abbrev_base + compunit.cu_abbrev_offset),
|
||||
+ ((unsigned char *) debug_displays [abbrev_sec].section.start
|
||||
+ + abbrev_base + abbrev_size),
|
||||
+ list);
|
||||
+ list->start_of_next_abbrevs = next;
|
||||
+ }
|
||||
+
|
||||
+ start = section_begin + cu_offset + compunit.cu_length
|
||||
+ + initial_length_size;
|
||||
+ record_abbrev_list_for_cu (cu_offset, start - section_begin, list);
|
||||
+ }
|
||||
+
|
||||
+ for (start = section_begin, unit = 0; start < end; unit++)
|
||||
{
|
||||
DWARF2_Internal_CompUnit compunit;
|
||||
unsigned char *hdrptr;
|
||||
@@ -3262,6 +3548,7 @@ process_debug_info (struct dwarf_section
|
||||
struct cu_tu_set *this_set;
|
||||
dwarf_vma abbrev_base;
|
||||
size_t abbrev_size;
|
||||
+ abbrev_list * list = NULL;
|
||||
|
||||
hdrptr = start;
|
||||
|
||||
@@ -3434,8 +3721,6 @@ process_debug_info (struct dwarf_section
|
||||
continue;
|
||||
}
|
||||
|
||||
- free_abbrevs ();
|
||||
-
|
||||
/* Process the abbrevs used by this compilation unit. */
|
||||
if (compunit.cu_abbrev_offset >= abbrev_size)
|
||||
warn (_("Debug info is corrupted, abbrev offset (%lx) is larger than abbrev section size (%lx)\n"),
|
||||
@@ -3448,11 +3733,22 @@ process_debug_info (struct dwarf_section
|
||||
(unsigned long) abbrev_base + abbrev_size,
|
||||
(unsigned long) debug_displays [abbrev_sec].section.size);
|
||||
else
|
||||
- process_abbrev_section
|
||||
- (((unsigned char *) debug_displays [abbrev_sec].section.start
|
||||
- + abbrev_base + compunit.cu_abbrev_offset),
|
||||
- ((unsigned char *) debug_displays [abbrev_sec].section.start
|
||||
- + abbrev_base + abbrev_size));
|
||||
+ {
|
||||
+ list = find_abbrev_list_by_abbrev_offset (compunit.cu_abbrev_offset);
|
||||
+ if (list == NULL)
|
||||
+ {
|
||||
+ unsigned char * next;
|
||||
+
|
||||
+ list = new_abbrev_list (compunit.cu_abbrev_offset);
|
||||
+ next = process_abbrev_set
|
||||
+ (((unsigned char *) debug_displays [abbrev_sec].section.start
|
||||
+ + abbrev_base + compunit.cu_abbrev_offset),
|
||||
+ ((unsigned char *) debug_displays [abbrev_sec].section.start
|
||||
+ + abbrev_base + abbrev_size),
|
||||
+ list);
|
||||
+ list->start_of_next_abbrevs = next;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
level = 0;
|
||||
last_level = level;
|
||||
@@ -3532,11 +3828,13 @@ process_debug_info (struct dwarf_section
|
||||
|
||||
/* Scan through the abbreviation list until we reach the
|
||||
correct entry. */
|
||||
- for (entry = first_abbrev;
|
||||
- entry && entry->entry != abbrev_number;
|
||||
- entry = entry->next)
|
||||
+ if (list == NULL)
|
||||
continue;
|
||||
|
||||
+ for (entry = list->first_abbrev; entry != NULL; entry = entry->next)
|
||||
+ if (entry->number == abbrev_number)
|
||||
+ break;
|
||||
+
|
||||
if (entry == NULL)
|
||||
{
|
||||
if (!do_loc && do_printing)
|
||||
@@ -5721,30 +6019,37 @@ display_debug_abbrev (struct dwarf_secti
|
||||
{
|
||||
abbrev_entry *entry;
|
||||
unsigned char *start = section->start;
|
||||
- unsigned char *end = start + section->size;
|
||||
+ const unsigned char *end = start + section->size;
|
||||
|
||||
introduce (section, FALSE);
|
||||
|
||||
do
|
||||
{
|
||||
- unsigned char *last;
|
||||
-
|
||||
- free_abbrevs ();
|
||||
+ abbrev_list * list;
|
||||
+ dwarf_vma offset;
|
||||
|
||||
- last = start;
|
||||
- start = process_abbrev_section (start, end);
|
||||
+ offset = start - section->start;
|
||||
+ list = find_abbrev_list_by_abbrev_offset (offset);
|
||||
+ if (list == NULL)
|
||||
+ {
|
||||
+ list = new_abbrev_list (offset);
|
||||
+ start = process_abbrev_set (start, end, list);
|
||||
+ list->start_of_next_abbrevs = start;
|
||||
+ }
|
||||
+ else
|
||||
+ start = list->start_of_next_abbrevs;
|
||||
|
||||
- if (first_abbrev == NULL)
|
||||
+ if (list->first_abbrev == NULL)
|
||||
continue;
|
||||
|
||||
- printf (_(" Number TAG (0x%lx)\n"), (long) (last - section->start));
|
||||
+ printf (_(" Number TAG (0x%lx)\n"), (long) offset);
|
||||
|
||||
- for (entry = first_abbrev; entry; entry = entry->next)
|
||||
+ for (entry = list->first_abbrev; entry; entry = entry->next)
|
||||
{
|
||||
abbrev_attr *attr;
|
||||
|
||||
printf (" %ld %s [%s]\n",
|
||||
- entry->entry,
|
||||
+ entry->number,
|
||||
get_TAG_name (entry->tag),
|
||||
entry->children ? _("has children") : _("no children"));
|
||||
|
||||
@@ -10776,8 +11081,12 @@ free_debug_memory (void)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
- free_abbrevs ();
|
||||
+ free_all_abbrevs ();
|
||||
|
||||
+ free (cu_abbrev_map);
|
||||
+ cu_abbrev_map = NULL;
|
||||
+ next_free_abbrev_map_entry = 0;
|
||||
+
|
||||
for (i = 0; i < max; i++)
|
||||
free_debug_section ((enum dwarf_section_display_enum) i);
|
||||
|
||||
Only in binutils-2.35.1/binutils: dwarf.c.orig
|
||||
36
binutils-elf-add-objects.patch
Normal file
36
binutils-elf-add-objects.patch
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
--- binutils.orig/bfd/elflink.c 2020-07-31 10:45:48.747912761 +0100
|
||||
+++ binutils-2.35/bfd/elflink.c 2020-07-31 10:47:26.336262770 +0100
|
||||
@@ -505,6 +505,16 @@ bfd_elf_link_record_dynamic_symbol (stru
|
||||
const char *name;
|
||||
size_t indx;
|
||||
|
||||
+ if (h->root.type == bfd_link_hash_defined
|
||||
+ || h->root.type == bfd_link_hash_defweak)
|
||||
+ {
|
||||
+ /* An IR symbol should not be made dynamic. */
|
||||
+ if (h->root.u.def.section != NULL
|
||||
+ && h->root.u.def.section->owner != NULL
|
||||
+ && (h->root.u.def.section->owner->flags & BFD_PLUGIN) != 0)
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
/* XXX: The ABI draft says the linker must turn hidden and
|
||||
internal symbols into STB_LOCAL symbols when producing the
|
||||
DSO. However, if ld.so honors st_other in the dynamic table,
|
||||
@@ -5199,15 +5209,11 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||
break;
|
||||
}
|
||||
|
||||
- /* Don't add DT_NEEDED for references from the dummy bfd nor
|
||||
- for unmatched symbol. */
|
||||
if (!add_needed
|
||||
&& matched
|
||||
&& definition
|
||||
&& ((dynsym
|
||||
- && h->ref_regular_nonweak
|
||||
- && (old_bfd == NULL
|
||||
- || (old_bfd->flags & BFD_PLUGIN) == 0))
|
||||
+ && h->ref_regular_nonweak)
|
||||
|| (h->ref_dynamic_nonweak
|
||||
&& (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0
|
||||
&& !on_needed_list (elf_dt_name (abfd),
|
||||
|
|
@ -5,8 +5,8 @@ diff -rup binutils.orig/bfd/Makefile.am binutils-2.32/bfd/Makefile.am
|
|||
bfdincludedir = @bfdincludedir@
|
||||
bfdlib_LTLIBRARIES = libbfd.la
|
||||
bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
|
||||
- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
|
||||
+ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
|
||||
- bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
|
||||
+ bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
|
||||
else !INSTALL_LIBBFD
|
||||
# Empty these so that the respective installation directories will not be created.
|
||||
bfdlibdir =
|
||||
|
|
@ -16,7 +16,7 @@ diff -rup binutils.orig/bfd/Makefile.in binutils-2.32/bfd/Makefile.in
|
|||
@@ -249,7 +249,7 @@ am__can_run_installinfo = \
|
||||
esac
|
||||
am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \
|
||||
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
|
||||
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bfd_stdint.h \
|
||||
- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
|
||||
+ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
|
||||
HEADERS = $(bfdinclude_HEADERS)
|
||||
|
|
@ -26,8 +26,8 @@ diff -rup binutils.orig/bfd/Makefile.in binutils-2.32/bfd/Makefile.in
|
|||
@INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2)
|
||||
@INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \
|
||||
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
|
||||
-@INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h \
|
||||
+@INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h \
|
||||
-@INSTALL_LIBBFD_TRUE@ bfd_stdint.h $(INCDIR)/diagnostics.h \
|
||||
+@INSTALL_LIBBFD_TRUE@ bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h \
|
||||
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2)
|
||||
@INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@
|
||||
@INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la
|
||||
|
|
|
|||
657
binutils-extend-s390-arch14-support.patch
Normal file
657
binutils-extend-s390-arch14-support.patch
Normal file
|
|
@ -0,0 +1,657 @@
|
|||
Only in binutils-2.35.1/gas: ChangeLog.orig
|
||||
Only in binutils-2.35.1/gas: ChangeLog.rej
|
||||
Only in binutils-2.35.1/gas/config: tc-s390.c.rej
|
||||
diff -rup binutils.orig/gas/doc/c-s390.texi binutils-2.35.1/gas/doc/c-s390.texi
|
||||
--- binutils.orig/gas/doc/c-s390.texi 2021-03-25 14:35:40.951633346 +0000
|
||||
+++ binutils-2.35.1/gas/doc/c-s390.texi 2021-03-25 14:39:39.910468584 +0000
|
||||
@@ -313,7 +313,7 @@ field. The notation changes as follows:
|
||||
@cindex instruction formats, s390
|
||||
@cindex s390 instruction formats
|
||||
|
||||
-The Principles of Operation manuals lists 26 instruction formats where
|
||||
+The Principles of Operation manuals lists 35 instruction formats where
|
||||
some of the formats have multiple variants. For the @samp{.insn}
|
||||
pseudo directive the assembler recognizes some of the formats.
|
||||
Typically, the most general variant of the instruction format is used
|
||||
@@ -545,6 +545,54 @@ with the @samp{.insn} pseudo directive:
|
||||
0 8 12 16 20 32 36 47
|
||||
@end verbatim
|
||||
|
||||
+@item VRV format: <insn> V1,D2(V2,B2),M3
|
||||
+@verbatim
|
||||
++--------+----+----+----+-------------+----+------------+
|
||||
+| OpCode | V1 | V2 | B2 | D2 | M3 | Opcode |
|
||||
++--------+----+----+----+-------------+----+------------+
|
||||
+0 8 12 16 20 32 36 47
|
||||
+@end verbatim
|
||||
+
|
||||
+@item VRI format: <insn> V1,V2,I3,M4,M5
|
||||
+@verbatim
|
||||
++--------+----+----+-------------+----+----+------------+
|
||||
+| OpCode | V1 | V2 | I3 | M5 | M4 | Opcode |
|
||||
++--------+----+----+-------------+----+----+------------+
|
||||
+0 8 12 16 28 32 36 47
|
||||
+@end verbatim
|
||||
+
|
||||
+@item VRX format: <insn> V1,D2(R2,B2),M3
|
||||
+@verbatim
|
||||
++--------+----+----+----+-------------+----+------------+
|
||||
+| OpCode | V1 | R2 | B2 | D2 | M3 | Opcode |
|
||||
++--------+----+----+----+-------------+----+------------+
|
||||
+0 8 12 16 20 32 36 47
|
||||
+@end verbatim
|
||||
+
|
||||
+@item VRS format: <insn> R1,V3,D2(B2),M4
|
||||
+@verbatim
|
||||
++--------+----+----+----+-------------+----+------------+
|
||||
+| OpCode | R1 | V3 | B2 | D2 | M4 | Opcode |
|
||||
++--------+----+----+----+-------------+----+------------+
|
||||
+0 8 12 16 20 32 36 47
|
||||
+@end verbatim
|
||||
+
|
||||
+@item VRR format: <insn> V1,V2,V3,M4,M5,M6
|
||||
+@verbatim
|
||||
++--------+----+----+----+---+----+----+----+------------+
|
||||
+| OpCode | V1 | V2 | V3 |///| M6 | M5 | M4 | Opcode |
|
||||
++--------+----+----+----+---+----+----+----+------------+
|
||||
+0 8 12 16 24 28 32 36 47
|
||||
+@end verbatim
|
||||
+
|
||||
+@item VSI format: <insn> V1,D2(B2),I3
|
||||
+@verbatim
|
||||
++--------+---------+----+-------------+----+------------+
|
||||
+| OpCode | I3 | B2 | D2 | V1 | Opcode |
|
||||
++--------+---------+----+-------------+----+------------+
|
||||
+0 8 16 20 32 36 47
|
||||
+@end verbatim
|
||||
+
|
||||
@end table
|
||||
|
||||
For the complete list of all instruction format variants see the
|
||||
Only in binutils-2.35.1/gas/doc: c-s390.texi.orig
|
||||
Only in binutils-2.35.1/gas/doc: c-s390.texi.rej
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/esa-g5.d binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.d
|
||||
--- binutils.orig/gas/testsuite/gas/s390/esa-g5.d 2021-03-25 14:35:41.038632922 +0000
|
||||
+++ binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.d 2021-03-25 14:39:56.533387550 +0000
|
||||
@@ -78,10 +78,14 @@ Disassembly of section .text:
|
||||
.*: 07 29 [ ]*bhr %r9
|
||||
.*: 07 f9 [ ]*br %r9
|
||||
.*: a7 95 00 00 [ ]*bras %r9,e2 <foo\+0xe2>
|
||||
-.*: a7 64 00 00 [ ]*jlh e6 <foo\+0xe6>
|
||||
-.*: a7 66 00 00 [ ]*brct %r6,ea <foo\+0xea>
|
||||
-.*: 84 69 00 00 [ ]*brxh %r6,%r9,ee <foo\+0xee>
|
||||
-.*: 85 69 00 00 [ ]*brxle %r6,%r9,f2 <foo\+0xf2>
|
||||
+.*: a7 65 00 00 [ ]*bras %r6,e6 <foo\+0xe6>
|
||||
+.*: a7 64 00 00 [ ]*jlh ea <foo\+0xea>
|
||||
+.*: a7 66 00 00 [ ]*brct %r6,ee <foo\+0xee>
|
||||
+.*: a7 66 00 00 [ ]*brct %r6,f2 <foo\+0xf2>
|
||||
+.*: 84 69 00 00 [ ]*brxh %r6,%r9,f6 <foo\+0xf6>
|
||||
+.*: 84 69 00 00 [ ]*brxh %r6,%r9,fa <foo\+0xfa>
|
||||
+.*: 85 69 00 00 [ ]*brxle %r6,%r9,fe <foo\+0xfe>
|
||||
+.*: 85 69 00 00 [ ]*brxle %r6,%r9,102 <foo\+0x102>
|
||||
.*: b2 5a 00 69 [ ]*bsa %r6,%r9
|
||||
.*: b2 58 00 69 [ ]*bsg %r6,%r9
|
||||
.*: 0b 69 [ ]*bsm %r6,%r9
|
||||
@@ -180,27 +184,49 @@ Disassembly of section .text:
|
||||
.*: b2 21 00 69 [ ]*ipte %r6,%r9
|
||||
.*: b2 29 00 69 [ ]*iske %r6,%r9
|
||||
.*: b2 23 00 69 [ ]*ivsk %r6,%r9
|
||||
-.*: a7 f4 00 00 [ ]*j 278 <foo\+0x278>
|
||||
-.*: a7 84 00 00 [ ]*je 27c <foo\+0x27c>
|
||||
-.*: a7 24 00 00 [ ]*jh 280 <foo\+0x280>
|
||||
-.*: a7 a4 00 00 [ ]*jhe 284 <foo\+0x284>
|
||||
-.*: a7 44 00 00 [ ]*jl 288 <foo\+0x288>
|
||||
-.*: a7 c4 00 00 [ ]*jle 28c <foo\+0x28c>
|
||||
-.*: a7 64 00 00 [ ]*jlh 290 <foo\+0x290>
|
||||
-.*: a7 44 00 00 [ ]*jl 294 <foo\+0x294>
|
||||
-.*: a7 74 00 00 [ ]*jne 298 <foo\+0x298>
|
||||
-.*: a7 d4 00 00 [ ]*jnh 29c <foo\+0x29c>
|
||||
-.*: a7 54 00 00 [ ]*jnhe 2a0 <foo\+0x2a0>
|
||||
-.*: a7 b4 00 00 [ ]*jnl 2a4 <foo\+0x2a4>
|
||||
-.*: a7 34 00 00 [ ]*jnle 2a8 <foo\+0x2a8>
|
||||
-.*: a7 94 00 00 [ ]*jnlh 2ac <foo\+0x2ac>
|
||||
-.*: a7 b4 00 00 [ ]*jnl 2b0 <foo\+0x2b0>
|
||||
-.*: a7 e4 00 00 [ ]*jno 2b4 <foo\+0x2b4>
|
||||
-.*: a7 d4 00 00 [ ]*jnh 2b8 <foo\+0x2b8>
|
||||
-.*: a7 74 00 00 [ ]*jne 2bc <foo\+0x2bc>
|
||||
-.*: a7 14 00 00 [ ]*jo 2c0 <foo\+0x2c0>
|
||||
-.*: a7 24 00 00 [ ]*jh 2c4 <foo\+0x2c4>
|
||||
-.*: a7 84 00 00 [ ]*je 2c8 <foo\+0x2c8>
|
||||
+.*: a7 f4 00 00 [ ]*j 288 <foo\+0x288>
|
||||
+.*: a7 84 00 00 [ ]*je 28c <foo\+0x28c>
|
||||
+.*: a7 24 00 00 [ ]*jh 290 <foo\+0x290>
|
||||
+.*: a7 a4 00 00 [ ]*jhe 294 <foo\+0x294>
|
||||
+.*: a7 44 00 00 [ ]*jl 298 <foo\+0x298>
|
||||
+.*: a7 c4 00 00 [ ]*jle 29c <foo\+0x29c>
|
||||
+.*: a7 64 00 00 [ ]*jlh 2a0 <foo\+0x2a0>
|
||||
+.*: a7 44 00 00 [ ]*jl 2a4 <foo\+0x2a4>
|
||||
+.*: a7 74 00 00 [ ]*jne 2a8 <foo\+0x2a8>
|
||||
+.*: a7 d4 00 00 [ ]*jnh 2ac <foo\+0x2ac>
|
||||
+.*: a7 54 00 00 [ ]*jnhe 2b0 <foo\+0x2b0>
|
||||
+.*: a7 b4 00 00 [ ]*jnl 2b4 <foo\+0x2b4>
|
||||
+.*: a7 34 00 00 [ ]*jnle 2b8 <foo\+0x2b8>
|
||||
+.*: a7 94 00 00 [ ]*jnlh 2bc <foo\+0x2bc>
|
||||
+.*: a7 b4 00 00 [ ]*jnl 2c0 <foo\+0x2c0>
|
||||
+.*: a7 e4 00 00 [ ]*jno 2c4 <foo\+0x2c4>
|
||||
+.*: a7 d4 00 00 [ ]*jnh 2c8 <foo\+0x2c8>
|
||||
+.*: a7 74 00 00 [ ]*jne 2cc <foo\+0x2cc>
|
||||
+.*: a7 14 00 00 [ ]*jo 2d0 <foo\+0x2d0>
|
||||
+.*: a7 24 00 00 [ ]*jh 2d4 <foo\+0x2d4>
|
||||
+.*: a7 84 00 00 [ ]*je 2d8 <foo\+0x2d8>
|
||||
+.*: a7 04 00 00 [ ]*jnop 2dc <foo\+0x2dc>
|
||||
+.*: a7 14 00 00 [ ]*jo 2e0 <foo\+0x2e0>
|
||||
+.*: a7 24 00 00 [ ]*jh 2e4 <foo\+0x2e4>
|
||||
+.*: a7 24 00 00 [ ]*jh 2e8 <foo\+0x2e8>
|
||||
+.*: a7 34 00 00 [ ]*jnle 2ec <foo\+0x2ec>
|
||||
+.*: a7 44 00 00 [ ]*jl 2f0 <foo\+0x2f0>
|
||||
+.*: a7 44 00 00 [ ]*jl 2f4 <foo\+0x2f4>
|
||||
+.*: a7 54 00 00 [ ]*jnhe 2f8 <foo\+0x2f8>
|
||||
+.*: a7 64 00 00 [ ]*jlh 2fc <foo\+0x2fc>
|
||||
+.*: a7 74 00 00 [ ]*jne 300 <foo\+0x300>
|
||||
+.*: a7 74 00 00 [ ]*jne 304 <foo\+0x304>
|
||||
+.*: a7 84 00 00 [ ]*je 308 <foo\+0x308>
|
||||
+.*: a7 84 00 00 [ ]*je 30c <foo\+0x30c>
|
||||
+.*: a7 94 00 00 [ ]*jnlh 310 <foo\+0x310>
|
||||
+.*: a7 a4 00 00 [ ]*jhe 314 <foo\+0x314>
|
||||
+.*: a7 b4 00 00 [ ]*jnl 318 <foo\+0x318>
|
||||
+.*: a7 b4 00 00 [ ]*jnl 31c <foo\+0x31c>
|
||||
+.*: a7 c4 00 00 [ ]*jle 320 <foo\+0x320>
|
||||
+.*: a7 d4 00 00 [ ]*jnh 324 <foo\+0x324>
|
||||
+.*: a7 d4 00 00 [ ]*jnh 328 <foo\+0x328>
|
||||
+.*: a7 e4 00 00 [ ]*jno 32c <foo\+0x32c>
|
||||
+.*: a7 f4 00 00 [ ]*j 330 <foo\+0x330>
|
||||
.*: ed 65 af ff 00 18 [ ]*kdb %f6,4095\(%r5,%r10\)
|
||||
.*: b3 18 00 69 [ ]*kdbr %f6,%f9
|
||||
.*: ed 65 af ff 00 08 [ ]*keb %f6,4095\(%r5,%r10\)
|
||||
@@ -483,4 +509,4 @@ Disassembly of section .text:
|
||||
.*: f8 58 5f ff af ff [ ]*zap 4095\(6,%r5\),4095\(9,%r10\)
|
||||
.*: b2 21 b0 69 [ ]*ipte %r6,%r9,%r11
|
||||
.*: b2 21 bd 69 [ ]*ipte %r6,%r9,%r11,13
|
||||
-.*: 07 07 [ ]*nopr %r7
|
||||
+.*: 07 07 [ ]*nopr %r7
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/esa-g5.s binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.s
|
||||
--- binutils.orig/gas/testsuite/gas/s390/esa-g5.s 2021-03-25 14:35:41.038632922 +0000
|
||||
+++ binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.s 2021-03-25 14:39:56.534387545 +0000
|
||||
@@ -72,10 +72,14 @@ foo:
|
||||
bpr %r9
|
||||
br %r9
|
||||
bras %r9,.
|
||||
+ jas %r6,.
|
||||
brc 6,.
|
||||
brct 6,.
|
||||
+ jct %r6,.
|
||||
brxh %r6,%r9,.
|
||||
+ jxh %r6,%r9,.
|
||||
brxle %r6,%r9,.
|
||||
+ jxle %r6,%r9,.
|
||||
bsa %r6,%r9
|
||||
bsg %r6,%r9
|
||||
bsm %r6,%r9
|
||||
@@ -195,6 +199,28 @@ foo:
|
||||
jo .
|
||||
jp .
|
||||
jz .
|
||||
+ jnop .
|
||||
+ bro .
|
||||
+ brh .
|
||||
+ brp .
|
||||
+ brnle .
|
||||
+ brl .
|
||||
+ brm .
|
||||
+ brnhe .
|
||||
+ brlh .
|
||||
+ brne .
|
||||
+ brnz .
|
||||
+ bre .
|
||||
+ brz .
|
||||
+ brnlh .
|
||||
+ brhe .
|
||||
+ brnl .
|
||||
+ brnm .
|
||||
+ brle .
|
||||
+ brnh .
|
||||
+ brnp .
|
||||
+ brno .
|
||||
+ bru .
|
||||
kdb %f6,4095(%r5,%r10)
|
||||
kdbr %f6,%f9
|
||||
keb %f6,4095(%r5,%r10)
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/esa-z900.d binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.d
|
||||
--- binutils.orig/gas/testsuite/gas/s390/esa-z900.d 2021-03-25 14:35:41.038632922 +0000
|
||||
+++ binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.d 2021-03-25 14:39:56.534387545 +0000
|
||||
@@ -6,29 +6,52 @@
|
||||
Disassembly of section .text:
|
||||
|
||||
.* <foo>:
|
||||
-.*: c0 f4 00 00 00 00 [ ]*jg 0 \<foo\>
|
||||
-.*: c0 14 00 00 00 00 [ ]*jgo 6 \<foo\+0x6>
|
||||
-.*: c0 24 00 00 00 00 [ ]*jgh c \<foo\+0xc>
|
||||
-.*: c0 24 00 00 00 00 [ ]*jgh 12 \<foo\+0x12>
|
||||
-.*: c0 34 00 00 00 00 [ ]*jgnle 18 \<foo\+0x18>
|
||||
-.*: c0 44 00 00 00 00 [ ]*jgl 1e \<foo\+0x1e>
|
||||
-.*: c0 44 00 00 00 00 [ ]*jgl 24 \<foo\+0x24>
|
||||
-.*: c0 54 00 00 00 00 [ ]*jgnhe 2a \<foo\+0x2a>
|
||||
-.*: c0 64 00 00 00 00 [ ]*jglh 30 \<foo\+0x30>
|
||||
-.*: c0 74 00 00 00 00 [ ]*jgne 36 \<foo\+0x36>
|
||||
-.*: c0 74 00 00 00 00 [ ]*jgne 3c \<foo\+0x3c>
|
||||
-.*: c0 84 00 00 00 00 [ ]*jge 42 \<foo\+0x42>
|
||||
-.*: c0 84 00 00 00 00 [ ]*jge 48 \<foo\+0x48>
|
||||
-.*: c0 94 00 00 00 00 [ ]*jgnlh 4e \<foo\+0x4e>
|
||||
-.*: c0 a4 00 00 00 00 [ ]*jghe 54 \<foo\+0x54>
|
||||
-.*: c0 b4 00 00 00 00 [ ]*jgnl 5a \<foo\+0x5a>
|
||||
-.*: c0 b4 00 00 00 00 [ ]*jgnl 60 \<foo\+0x60>
|
||||
-.*: c0 c4 00 00 00 00 [ ]*jgle 66 \<foo\+0x66>
|
||||
-.*: c0 d4 00 00 00 00 [ ]*jgnh 6c \<foo\+0x6c>
|
||||
-.*: c0 d4 00 00 00 00 [ ]*jgnh 72 \<foo\+0x72>
|
||||
-.*: c0 e4 00 00 00 00 [ ]*jgno 78 \<foo\+0x78>
|
||||
-.*: c0 f4 00 00 00 00 [ ]*jg 7e \<foo\+0x7e>
|
||||
-.*: c0 65 00 00 00 00 [ ]*brasl %r6,84 \<foo\+0x84>
|
||||
+.*: c0 f4 00 00 00 00 [ ]*jg 0 <foo>
|
||||
+.*: c0 04 00 00 00 00 [ ]*jgnop 6 <foo\+0x6>
|
||||
+.*: c0 14 00 00 00 00 [ ]*jgo c <foo\+0xc>
|
||||
+.*: c0 24 00 00 00 00 [ ]*jgh 12 <foo\+0x12>
|
||||
+.*: c0 24 00 00 00 00 [ ]*jgh 18 <foo\+0x18>
|
||||
+.*: c0 34 00 00 00 00 [ ]*jgnle 1e <foo\+0x1e>
|
||||
+.*: c0 44 00 00 00 00 [ ]*jgl 24 <foo\+0x24>
|
||||
+.*: c0 44 00 00 00 00 [ ]*jgl 2a <foo\+0x2a>
|
||||
+.*: c0 54 00 00 00 00 [ ]*jgnhe 30 <foo\+0x30>
|
||||
+.*: c0 64 00 00 00 00 [ ]*jglh 36 <foo\+0x36>
|
||||
+.*: c0 74 00 00 00 00 [ ]*jgne 3c <foo\+0x3c>
|
||||
+.*: c0 74 00 00 00 00 [ ]*jgne 42 <foo\+0x42>
|
||||
+.*: c0 84 00 00 00 00 [ ]*jge 48 <foo\+0x48>
|
||||
+.*: c0 84 00 00 00 00 [ ]*jge 4e <foo\+0x4e>
|
||||
+.*: c0 94 00 00 00 00 [ ]*jgnlh 54 <foo\+0x54>
|
||||
+.*: c0 a4 00 00 00 00 [ ]*jghe 5a <foo\+0x5a>
|
||||
+.*: c0 b4 00 00 00 00 [ ]*jgnl 60 <foo\+0x60>
|
||||
+.*: c0 b4 00 00 00 00 [ ]*jgnl 66 <foo\+0x66>
|
||||
+.*: c0 c4 00 00 00 00 [ ]*jgle 6c <foo\+0x6c>
|
||||
+.*: c0 d4 00 00 00 00 [ ]*jgnh 72 <foo\+0x72>
|
||||
+.*: c0 d4 00 00 00 00 [ ]*jgnh 78 <foo\+0x78>
|
||||
+.*: c0 e4 00 00 00 00 [ ]*jgno 7e <foo\+0x7e>
|
||||
+.*: c0 f4 00 00 00 00 [ ]*jg 84 <foo\+0x84>
|
||||
+.*: c0 14 00 00 00 00 [ ]*jgo 8a <foo\+0x8a>
|
||||
+.*: c0 24 00 00 00 00 [ ]*jgh 90 <foo\+0x90>
|
||||
+.*: c0 24 00 00 00 00 [ ]*jgh 96 <foo\+0x96>
|
||||
+.*: c0 34 00 00 00 00 [ ]*jgnle 9c <foo\+0x9c>
|
||||
+.*: c0 44 00 00 00 00 [ ]*jgl a2 <foo\+0xa2>
|
||||
+.*: c0 44 00 00 00 00 [ ]*jgl a8 <foo\+0xa8>
|
||||
+.*: c0 54 00 00 00 00 [ ]*jgnhe ae <foo\+0xae>
|
||||
+.*: c0 64 00 00 00 00 [ ]*jglh b4 <foo\+0xb4>
|
||||
+.*: c0 74 00 00 00 00 [ ]*jgne ba <foo\+0xba>
|
||||
+.*: c0 74 00 00 00 00 [ ]*jgne c0 <foo\+0xc0>
|
||||
+.*: c0 84 00 00 00 00 [ ]*jge c6 <foo\+0xc6>
|
||||
+.*: c0 84 00 00 00 00 [ ]*jge cc <foo\+0xcc>
|
||||
+.*: c0 94 00 00 00 00 [ ]*jgnlh d2 <foo\+0xd2>
|
||||
+.*: c0 a4 00 00 00 00 [ ]*jghe d8 <foo\+0xd8>
|
||||
+.*: c0 b4 00 00 00 00 [ ]*jgnl de <foo\+0xde>
|
||||
+.*: c0 b4 00 00 00 00 [ ]*jgnl e4 <foo\+0xe4>
|
||||
+.*: c0 c4 00 00 00 00 [ ]*jgle ea <foo\+0xea>
|
||||
+.*: c0 d4 00 00 00 00 [ ]*jgnh f0 <foo\+0xf0>
|
||||
+.*: c0 d4 00 00 00 00 [ ]*jgnh f6 <foo\+0xf6>
|
||||
+.*: c0 e4 00 00 00 00 [ ]*jgno fc <foo\+0xfc>
|
||||
+.*: c0 f4 00 00 00 00 [ ]*jg 102 <foo\+0x102>
|
||||
+.*: c0 65 00 00 00 00 [ ]*brasl %r6,108 <foo\+0x108>
|
||||
+.*: c0 65 00 00 00 00 [ ]*brasl %r6,10e <foo\+0x10e>
|
||||
.*: 01 0b [ ]*tam
|
||||
.*: 01 0c [ ]*sam24
|
||||
.*: 01 0d [ ]*sam31
|
||||
@@ -39,7 +62,7 @@ Disassembly of section .text:
|
||||
.*: b9 97 00 69 [ ]*dlr %r6,%r9
|
||||
.*: b9 98 00 69 [ ]*alcr %r6,%r9
|
||||
.*: b9 99 00 69 [ ]*slbr %r6,%r9
|
||||
-.*: c0 60 00 00 00 00 [ ]*larl %r6,ac \<foo\+0xac\>
|
||||
+.*: c0 60 00 00 00 00 [ ]*larl %r6,136 <foo\+0x136>
|
||||
.*: e3 65 af ff 00 1e [ ]*lrv %r6,4095\(%r5,%r10\)
|
||||
.*: e3 65 af ff 00 1f [ ]*lrvh %r6,4095\(%r5,%r10\)
|
||||
.*: e3 65 af ff 00 3e [ ]*strv %r6,4095\(%r5,%r10\)
|
||||
@@ -49,3 +72,4 @@ Disassembly of section .text:
|
||||
.*: e3 65 af ff 00 98 [ ]*alc %r6,4095\(%r5,%r10\)
|
||||
.*: e3 65 af ff 00 99 [ ]*slb %r6,4095\(%r5,%r10\)
|
||||
.*: eb 69 5f ff 00 1d [ ]*rll %r6,%r9,4095\(%r5\)
|
||||
+.*: 07 07 [ ]*nopr %r7
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/esa-z900.s binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.s
|
||||
--- binutils.orig/gas/testsuite/gas/s390/esa-z900.s 2021-03-25 14:35:41.037632927 +0000
|
||||
+++ binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.s 2021-03-25 14:39:56.534387545 +0000
|
||||
@@ -1,6 +1,7 @@
|
||||
.text
|
||||
foo:
|
||||
brcl 15,.
|
||||
+ jgnop .
|
||||
jgo .
|
||||
jgh .
|
||||
jgp .
|
||||
@@ -22,7 +23,29 @@ foo:
|
||||
jgnp .
|
||||
jgno .
|
||||
jg .
|
||||
+ brol .
|
||||
+ brhl .
|
||||
+ brpl .
|
||||
+ brnlel .
|
||||
+ brll .
|
||||
+ brml .
|
||||
+ brnhel .
|
||||
+ brlhl .
|
||||
+ brnel .
|
||||
+ brnzl .
|
||||
+ brel .
|
||||
+ brzl .
|
||||
+ brnlhl .
|
||||
+ brhel .
|
||||
+ brnll .
|
||||
+ brnml .
|
||||
+ brlel .
|
||||
+ brnhl .
|
||||
+ brnpl .
|
||||
+ brnol .
|
||||
+ brul .
|
||||
brasl %r6,.
|
||||
+ jasl %r6,.
|
||||
tam
|
||||
sam24
|
||||
sam31
|
||||
Only in binutils-2.35.1/gas/testsuite/gas/s390: s390.exp.rej
|
||||
Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.d
|
||||
Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.s
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z10.d binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.d
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-z10.d 2021-03-25 14:35:41.038632922 +0000
|
||||
+++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.d 2021-03-25 14:39:49.766420543 +0000
|
||||
@@ -362,11 +362,13 @@ Disassembly of section .text:
|
||||
.*: ec 67 d2 dc e6 54 [ ]*rnsbg %r6,%r7,210,220,230
|
||||
.*: ec 67 d2 dc e6 57 [ ]*rxsbg %r6,%r7,210,220,230
|
||||
.*: ec 67 d2 dc e6 56 [ ]*rosbg %r6,%r7,210,220,230
|
||||
-.*: ec 67 d2 dc e6 55 [ ]*risbg %r6,%r7,210,220,230
|
||||
-.*: c4 6f 00 00 00 00 [ ]*strl %r6,7f6 <foo\+0x7f6>
|
||||
-.*: c4 6b 00 00 00 00 [ ]*stgrl %r6,7fc <foo\+0x7fc>
|
||||
-.*: c4 67 00 00 00 00 [ ]*sthrl %r6,802 <foo\+0x802>
|
||||
-.*: c6 60 00 00 00 00 [ ]*exrl %r6,808 <foo\+0x808>
|
||||
+.*: ec 67 d2 14 e6 55 [ ]*risbg %r6,%r7,210,20,230
|
||||
+.*: ec 67 d2 bc e6 55 [ ]*risbgz %r6,%r7,210,60,230
|
||||
+.*: ec 67 d2 94 e6 55 [ ]*risbgz %r6,%r7,210,20,230
|
||||
+.*: c4 6f 00 00 00 00 [ ]*strl %r6,802 <foo\+0x802>
|
||||
+.*: c4 6b 00 00 00 00 [ ]*stgrl %r6,808 <foo\+0x808>
|
||||
+.*: c4 67 00 00 00 00 [ ]*sthrl %r6,80e <foo\+0x80e>
|
||||
+.*: c6 60 00 00 00 00 [ ]*exrl %r6,814 <foo\+0x814>
|
||||
.*: af ee 6d 05 [ ]*mc 3333\(%r6\),238
|
||||
.*: b9 a2 00 60 [ ]*ptf %r6
|
||||
.*: b9 af 00 67 [ ]*pfmf %r6,%r7
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z10.s binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.s
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-z10.s 2021-03-25 14:35:41.038632922 +0000
|
||||
+++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.s 2021-03-25 14:39:49.766420543 +0000
|
||||
@@ -356,7 +356,9 @@ foo:
|
||||
rnsbg %r6,%r7,210,220,230
|
||||
rxsbg %r6,%r7,210,220,230
|
||||
rosbg %r6,%r7,210,220,230
|
||||
- risbg %r6,%r7,210,220,230
|
||||
+ risbg %r6,%r7,210,20,230
|
||||
+ risbg %r6,%r7,210,188,230
|
||||
+ risbgz %r6,%r7,210,20,230
|
||||
strl %r6,.
|
||||
stgrl %r6,.
|
||||
sthrl %r6,.
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z900.d binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.d
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-z900.d 2021-03-25 14:35:41.037632927 +0000
|
||||
+++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.d 2021-03-25 14:39:56.534387545 +0000
|
||||
@@ -20,8 +20,11 @@ Disassembly of section .text:
|
||||
.*: e3 95 af ff 00 46 [ ]*bctg %r9,4095\(%r5,%r10\)
|
||||
.*: b9 46 00 96 [ ]*bctgr %r9,%r6
|
||||
.*: a7 97 00 00 [ ]*brctg %r9,40 \<foo\+0x40\>
|
||||
-.*: ec 96 00 00 00 44 [ ]*brxhg %r9,%r6,44 <foo\+0x44>
|
||||
-.*: ec 96 00 00 00 45 [ ]*brxlg %r9,%r6,4a <foo\+0x4a>
|
||||
+.*: a7 67 00 00 [ ]*brctg %r6,44 <foo\+0x44>
|
||||
+.*: ec 96 00 00 00 44 [ ]*brxhg %r9,%r6,48 <foo\+0x48>
|
||||
+.*: ec 69 00 00 00 44 [ ]*brxhg %r6,%r9,4e <foo\+0x4e>
|
||||
+.*: ec 96 00 00 00 45 [ ]*brxlg %r9,%r6,54 <foo\+0x54>
|
||||
+.*: ec 69 00 00 00 45 [ ]*brxlg %r6,%r9,5a <foo\+0x5a>
|
||||
.*: eb 96 5f ff 00 44 [ ]*bxhg %r9,%r6,4095\(%r5\)
|
||||
.*: eb 96 5f ff 00 45 [ ]*bxleg %r9,%r6,4095\(%r5\)
|
||||
.*: b3 a5 00 96 [ ]*cdgbr %f9,%r6
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z900.s binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.s
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-z900.s 2021-03-25 14:35:41.038632922 +0000
|
||||
+++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.s 2021-03-25 14:39:56.534387545 +0000
|
||||
@@ -14,8 +14,11 @@ foo:
|
||||
bctg %r9,4095(%r5,%r10)
|
||||
bctgr %r9,%r6
|
||||
brctg %r9,.
|
||||
+ jctg %r6,.
|
||||
brxhg %r9,%r6,.
|
||||
+ jxhg %r6,%r9,.
|
||||
brxlg %r9,%r6,.
|
||||
+ jxleg %r6,%r9,.
|
||||
bxhg %r9,%r6,4095(%r5)
|
||||
bxleg %r9,%r6,4095(%r5)
|
||||
cdgbr %f9,%r6
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.d binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.d
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.d 2021-03-25 14:35:41.037632927 +0000
|
||||
+++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.d 2021-03-25 14:39:49.766420543 +0000
|
||||
@@ -47,6 +47,8 @@ Disassembly of section .text:
|
||||
.*: eb 6c 7a 4d fe 2b [ ]*clgtnh %r6,-5555\(%r7\)
|
||||
.*: eb 6c 7a 4d fe 2b [ ]*clgtnh %r6,-5555\(%r7\)
|
||||
.*: ec 67 0c 0d 0e 59 [ ]*risbgn %r6,%r7,12,13,14
|
||||
+.*: ec 67 0c bc 0e 59 [ ]*risbgnz %r6,%r7,12,60,14
|
||||
+.*: ec 67 0c 94 0e 59 [ ]*risbgnz %r6,%r7,12,20,14
|
||||
.*: ed 0f 8f a0 6d aa [ ]*cdzt %f6,4000\(16,%r8\),13
|
||||
.*: ed 21 8f a0 4d ab [ ]*cxzt %f4,4000\(34,%r8\),13
|
||||
.*: ed 0f 8f a0 6d a8 [ ]*czdt %f6,4000\(16,%r8\),13
|
||||
@@ -54,16 +56,16 @@ Disassembly of section .text:
|
||||
.*: b2 e8 c0 56 [ ]*ppa %r5,%r6,12
|
||||
.*: b9 8f 60 59 [ ]*crdte %r5,%r6,%r9
|
||||
.*: b9 8f 61 59 [ ]*crdte %r5,%r6,%r9,1
|
||||
-.*: c5 a0 0c 00 00 0c [ ]*bprp 10,12a <bar>,12a <bar>
|
||||
-.*: c5 a0 00 00 00 00 [ ]*bprp 10,118 <foo\+0x118>,118 <foo\+0x118>
|
||||
-[ ]*119: R_390_PLT12DBL bar\+0x1
|
||||
-[ ]*11b: R_390_PLT24DBL bar\+0x3
|
||||
-.*: c7 a0 00 00 00 00 [ ]*bpp 10,11e <foo\+0x11e>,0
|
||||
-[ ]*122: R_390_PLT16DBL bar\+0x4
|
||||
-.*: c7 a0 00 00 00 00 [ ]*bpp 10,124 <foo\+0x124>,0
|
||||
-[ ]*128: R_390_PC16DBL baz\+0x4
|
||||
+.*: c5 a0 0c 00 00 0c [ ]*bprp 10,136 <bar>,136 <bar>
|
||||
+.*: c5 a0 00 00 00 00 [ ]*bprp 10,124 <foo\+0x124>,124 <foo\+0x124>
|
||||
+[ ]*125: R_390_PLT12DBL bar\+0x1
|
||||
+[ ]*127: R_390_PLT24DBL bar\+0x3
|
||||
+.*: c7 a0 00 00 00 00 [ ]*bpp 10,12a <foo\+0x12a>,0
|
||||
+[ ]*12e: R_390_PLT16DBL bar\+0x4
|
||||
+.*: c7 a0 00 00 00 00 [ ]*bpp 10,130 <foo\+0x130>,0
|
||||
+[ ]*134: R_390_PC16DBL baz\+0x4
|
||||
|
||||
|
||||
-000000000000012a <bar>:
|
||||
+0000000000000136 <bar>:
|
||||
|
||||
.*: 07 07 [ ]*nopr %r7
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.s binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.s
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.s 2021-03-25 14:35:41.038632922 +0000
|
||||
+++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.s 2021-03-25 14:39:49.766420543 +0000
|
||||
@@ -44,6 +44,9 @@ foo:
|
||||
clgtnh %r6,-5555(%r7)
|
||||
|
||||
risbgn %r6,%r7,12,13,14
|
||||
+ risbgn %r6,%r7,12,188,14
|
||||
+ risbgnz %r6,%r7,12,20,14
|
||||
+
|
||||
cdzt %f6,4000(16,%r8),13
|
||||
cxzt %f4,4000(34,%r8),13
|
||||
czdt %f6,4000(16,%r8),13
|
||||
Only in binutils-2.35.1/include: ChangeLog.orig
|
||||
Only in binutils-2.35.1/include: ChangeLog.rej
|
||||
Only in binutils-2.35.1/include/opcode: s390.h.rej
|
||||
Only in binutils-2.35.1/ld: ChangeLog.orig
|
||||
Only in binutils-2.35.1/ld: ChangeLog.rej
|
||||
diff -rup binutils.orig/ld/testsuite/ld-s390/tlsbin_64.dd binutils-2.35.1/ld/testsuite/ld-s390/tlsbin_64.dd
|
||||
--- binutils.orig/ld/testsuite/ld-s390/tlsbin_64.dd 2021-03-25 14:35:40.826633955 +0000
|
||||
+++ binutils-2.35.1/ld/testsuite/ld-s390/tlsbin_64.dd 2021-03-25 14:39:56.534387545 +0000
|
||||
@@ -87,26 +87,26 @@ Disassembly of section .text:
|
||||
+[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\)
|
||||
# GD -> LE with global variable defined in executable
|
||||
+[0-9a-f]+: e3 20 d0 10 00 04 lg %r2,16\(%r13\)
|
||||
- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xca>
|
||||
+ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ <fn2\+0xca>
|
||||
+[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\)
|
||||
# GD -> LE with local variable defined in executable
|
||||
+[0-9a-f]+: e3 20 d0 18 00 04 lg %r2,24\(%r13\)
|
||||
- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xda>
|
||||
+ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ <fn2\+0xda>
|
||||
+[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\)
|
||||
# GD -> LE with hidden variable defined in executable
|
||||
+[0-9a-f]+: e3 20 d0 20 00 04 lg %r2,32\(%r13\)
|
||||
- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xea>
|
||||
+ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ <fn2\+0xea>
|
||||
+[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\)
|
||||
# LD -> LE
|
||||
+[0-9a-f]+: e3 20 d0 28 00 04 lg %r2,40\(%r13\)
|
||||
- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xfa>
|
||||
+ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ <fn2\+0xfa>
|
||||
+[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\)
|
||||
+[0-9a-f]+: e3 40 d0 30 00 04 lg %r4,48\(%r13\)
|
||||
+[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\)
|
||||
+[0-9a-f]+: e3 40 d0 38 00 04 lg %r4,56\(%r13\)
|
||||
+[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\)
|
||||
+[0-9a-f]+: e3 20 d0 40 00 04 lg %r2,64\(%r13\)
|
||||
- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0x11e>
|
||||
+ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ <fn2\+0x11e>
|
||||
+[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\)
|
||||
+[0-9a-f]+: e3 40 d0 48 00 04 lg %r4,72\(%r13\)
|
||||
+[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\)
|
||||
Only in binutils-2.35.1/opcodes: ChangeLog.orig
|
||||
Only in binutils-2.35.1/opcodes: ChangeLog.rej
|
||||
Only in binutils-2.35.1/opcodes: s390-mkopc.c.rej
|
||||
diff -rup binutils.orig/opcodes/s390-opc.c binutils-2.35.1/opcodes/s390-opc.c
|
||||
--- binutils.orig/opcodes/s390-opc.c 2021-03-25 14:35:40.719634477 +0000
|
||||
+++ binutils-2.35.1/opcodes/s390-opc.c 2021-03-25 14:39:49.766420543 +0000
|
||||
@@ -218,32 +218,34 @@ const struct s390_operand s390_operands[
|
||||
{ 8, 8, 0 },
|
||||
#define U8_16 68 /* 8 bit unsigned value starting at 16 */
|
||||
{ 8, 16, 0 },
|
||||
-#define U8_24 69 /* 8 bit unsigned value starting at 24 */
|
||||
+#define U6_26 69 /* 6 bit unsigned value starting at 26 */
|
||||
+ { 6, 26, 0 },
|
||||
+#define U8_24 70 /* 8 bit unsigned value starting at 24 */
|
||||
{ 8, 24, 0 },
|
||||
-#define U8_28 70 /* 8 bit unsigned value starting at 28 */
|
||||
+#define U8_28 71 /* 8 bit unsigned value starting at 28 */
|
||||
{ 8, 28, 0 },
|
||||
-#define U8_32 71 /* 8 bit unsigned value starting at 32 */
|
||||
+#define U8_32 72 /* 8 bit unsigned value starting at 32 */
|
||||
{ 8, 32, 0 },
|
||||
-#define U12_16 72 /* 12 bit unsigned value starting at 16 */
|
||||
+#define U12_16 73 /* 12 bit unsigned value starting at 16 */
|
||||
{ 12, 16, 0 },
|
||||
-#define U16_16 73 /* 16 bit unsigned value starting at 16 */
|
||||
+#define U16_16 74 /* 16 bit unsigned value starting at 16 */
|
||||
{ 16, 16, 0 },
|
||||
-#define U16_32 74 /* 16 bit unsigned value starting at 32 */
|
||||
+#define U16_32 75 /* 16 bit unsigned value starting at 32 */
|
||||
{ 16, 32, 0 },
|
||||
-#define U32_16 75 /* 32 bit unsigned value starting at 16 */
|
||||
+#define U32_16 76 /* 32 bit unsigned value starting at 16 */
|
||||
{ 32, 16, 0 },
|
||||
|
||||
/* PC-relative address operands. */
|
||||
|
||||
-#define J12_12 76 /* 12 bit PC relative offset at 12 */
|
||||
+#define J12_12 77 /* 12 bit PC relative offset at 12 */
|
||||
{ 12, 12, S390_OPERAND_PCREL },
|
||||
-#define J16_16 77 /* 16 bit PC relative offset at 16 */
|
||||
+#define J16_16 78 /* 16 bit PC relative offset at 16 */
|
||||
{ 16, 16, S390_OPERAND_PCREL },
|
||||
-#define J16_32 78 /* 16 bit PC relative offset at 32 */
|
||||
+#define J16_32 79 /* 16 bit PC relative offset at 32 */
|
||||
{ 16, 32, S390_OPERAND_PCREL },
|
||||
-#define J24_24 79 /* 24 bit PC relative offset at 24 */
|
||||
+#define J24_24 80 /* 24 bit PC relative offset at 24 */
|
||||
{ 24, 24, S390_OPERAND_PCREL },
|
||||
-#define J32_16 80 /* 32 bit PC relative offset at 16 */
|
||||
+#define J32_16 81 /* 32 bit PC relative offset at 16 */
|
||||
{ 32, 16, S390_OPERAND_PCREL },
|
||||
|
||||
};
|
||||
@@ -313,6 +315,7 @@ const struct s390_operand s390_operands[
|
||||
#define INSTR_RIE_R0U0 6, { R_8,U16_16,0,0,0,0 } /* e.g. clfitne */
|
||||
#define INSTR_RIE_RUI0 6, { R_8,I16_16,U4_12,0,0,0 } /* e.g. lochi */
|
||||
#define INSTR_RIE_RRUUU 6, { R_8,R_12,U8_16,U8_24,U8_32,0 } /* e.g. rnsbg */
|
||||
+#define INSTR_RIE_RRUUU2 6, { R_8,R_12,U8_16,U6_26,U8_32,0 } /* e.g. rnsbg */
|
||||
#define INSTR_RIL_0P 6, { J32_16,0,0,0,0 } /* e.g. jg */
|
||||
#define INSTR_RIL_RP 6, { R_8,J32_16,0,0,0,0 } /* e.g. brasl */
|
||||
#define INSTR_RIL_UP 6, { U4_8,J32_16,0,0,0,0 } /* e.g. brcl */
|
||||
@@ -534,6 +537,7 @@ const struct s390_operand s390_operands[
|
||||
#define MASK_RIE_R0U0 { 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff }
|
||||
#define MASK_RIE_RUI0 { 0xff, 0x00, 0x00, 0x00, 0xff, 0xff }
|
||||
#define MASK_RIE_RRUUU { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
|
||||
+#define MASK_RIE_RRUUU2 { 0xff, 0x00, 0x00, 0xc0, 0x00, 0xff }
|
||||
#define MASK_RIL_0P { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
|
||||
#define MASK_RIL_RP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
|
||||
#define MASK_RIL_UP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 }
|
||||
diff -rup binutils.orig/opcodes/s390-opc.txt binutils-2.35.1/opcodes/s390-opc.txt
|
||||
--- binutils.orig/opcodes/s390-opc.txt 2021-03-25 14:35:40.728634433 +0000
|
||||
+++ binutils-2.35.1/opcodes/s390-opc.txt 2021-03-25 14:39:56.534387545 +0000
|
||||
@@ -246,10 +246,14 @@ d7 xc SS_L0RDRD "exclusive OR" g5 esa,za
|
||||
f8 zap SS_LLRDRD "zero and add" g5 esa,zarch
|
||||
a70a ahi RI_RI "add halfword immediate" g5 esa,zarch
|
||||
84 brxh RSI_RRP "branch relative on index high" g5 esa,zarch
|
||||
+84 jxh RSI_RRP "branch relative on index high" g5 esa,zarch
|
||||
85 brxle RSI_RRP "branch relative on index low or equal" g5 esa,zarch
|
||||
+85 jxle RSI_RRP "branch relative on index low or equal" g5 esa,zarch
|
||||
a705 bras RI_RP "branch relative and save" g5 esa,zarch
|
||||
+a705 jas RI_RP "branch relative and save" g5 esa,zarch
|
||||
a704 brc RI_UP "branch relative on condition" g5 esa,zarch
|
||||
a706 brct RI_RP "branch relative on count" g5 esa,zarch
|
||||
+a706 jct RI_RP "branch relative on count" g5 esa,zarch
|
||||
b241 cksm RRE_RR "checksum" g5 esa,zarch
|
||||
a70e chi RI_RI "compare halfword immediate" g5 esa,zarch
|
||||
a9 clcle RS_RRRD "compare logical long extended" g5 esa,zarch
|
||||
@@ -268,8 +272,11 @@ a701 tml RI_RU "test under mask low" g5
|
||||
4700 nop RX_0RRD "no operation" g5 esa,zarch optparm
|
||||
4700 b*8 RX_0RRD "conditional branch" g5 esa,zarch
|
||||
47f0 b RX_0RRD "unconditional branch" g5 esa,zarch
|
||||
+a704 jnop RI_0P "nop jump" g5 esa,zarch
|
||||
a704 j*8 RI_0P "conditional jump" g5 esa,zarch
|
||||
+a704 br*8 RI_0P "conditional jump" g5 esa,zarch
|
||||
a7f4 j RI_0P "unconditional jump" g5 esa,zarch
|
||||
+a7f4 bru RI_0P "unconditional jump" g5 esa,zarch
|
||||
b34a axbr RRE_FEFE "add extended bfp" g5 esa,zarch
|
||||
b31a adbr RRE_FF "add long bfp" g5 esa,zarch
|
||||
ed000000001a adb RXE_FRRD "add long bfp" g5 esa,zarch
|
||||
@@ -437,7 +444,9 @@ e3000000001b slgf RXE_RRRD "subtract log
|
||||
e3000000000c msg RXE_RRRD "multiply single 64" z900 zarch
|
||||
e3000000001c msgf RXE_RRRD "multiply single 64<32" z900 zarch
|
||||
ec0000000044 brxhg RIE_RRP "branch relative on index high 64" z900 zarch
|
||||
+ec0000000044 jxhg RIE_RRP "branch relative on index high 64" z900 zarch
|
||||
ec0000000045 brxlg RIE_RRP "branch relative on index low or equal 64" z900 zarch
|
||||
+ec0000000045 jxleg RIE_RRP "branch relative on index low or equal 64" z900 zarch
|
||||
eb0000000044 bxhg RSE_RRRD "branch on index high 64" z900 zarch
|
||||
eb0000000045 bxleg RSE_RRRD "branch on index low or equal 64" z900 zarch
|
||||
eb000000000c srlg RSE_RRRD "shift right single logical 64" z900 zarch
|
||||
@@ -462,10 +471,15 @@ eb0000000080 icmh RSE_RURD "insert chara
|
||||
a702 tmhh RI_RU "test under mask high high" z900 zarch
|
||||
a703 tmhl RI_RU "test under mask high low" z900 zarch
|
||||
c004 brcl RIL_UP "branch relative on condition long" z900 esa,zarch
|
||||
+c004 jgnop RIL_0P "nop jump long" z900 esa,zarch
|
||||
c004 jg*8 RIL_0P "conditional jump long" z900 esa,zarch
|
||||
+c004 br*8l RIL_0P "conditional jump long" z900 esa,zarch
|
||||
c0f4 jg RIL_0P "unconditional jump long" z900 esa,zarch
|
||||
+c0f4 brul RIL_0P "unconditional jump long" z900 esa,zarch
|
||||
c005 brasl RIL_RP "branch relative and save long" z900 esa,zarch
|
||||
+c005 jasl RIL_RP "branch relative and save long" z900 esa,zarch
|
||||
a707 brctg RI_RP "branch relative on count 64" z900 zarch
|
||||
+a707 jctg RI_RP "branch relative on count 64" z900 zarch
|
||||
a709 lghi RI_RI "load halfword immediate 64" z900 zarch
|
||||
a70b aghi RI_RI "add halfword immediate 64" z900 zarch
|
||||
a70d mghi RI_RI "multiply halfword immediate 64" z900 zarch
|
||||
@@ -956,6 +970,7 @@ ec0000000054 rnsbg RIE_RRUUU "rotate the
|
||||
ec0000000057 rxsbg RIE_RRUUU "rotate then exclusive or selected bits" z10 zarch
|
||||
ec0000000056 rosbg RIE_RRUUU "rotate then or selected bits" z10 zarch
|
||||
ec0000000055 risbg RIE_RRUUU "rotate then insert selected bits" z10 zarch
|
||||
+ec0000800055 risbgz RIE_RRUUU2 "rotate then insert selected bits and zero remaining bits" z10 zarch
|
||||
c40f strl RIL_RP "store relative long (32)" z10 zarch
|
||||
c40b stgrl RIL_RP "store relative long (64)" z10 zarch
|
||||
c407 sthrl RIL_RP "store halfword relative long" z10 zarch
|
||||
@@ -1139,6 +1154,7 @@ eb0000000023 clt$12 RSY_R0RD "compare lo
|
||||
eb000000002b clgt RSY_RURD "compare logical and trap 64 bit reg-mem" zEC12 zarch
|
||||
eb000000002b clgt$12 RSY_R0RD "compare logical and trap 64 bit reg-mem" zEC12 zarch
|
||||
ec0000000059 risbgn RIE_RRUUU "rotate then insert selected bits nocc" zEC12 zarch
|
||||
+ec0000800059 risbgnz RIE_RRUUU2 "rotate then insert selected bits and zero remaining bits nocc" zEC12 zarch
|
||||
ed00000000aa cdzt RSL_LRDFU "convert from zoned long" zEC12 zarch
|
||||
ed00000000ab cxzt RSL_LRDFEU "convert from zoned extended" zEC12 zarch
|
||||
ed00000000a8 czdt RSL_LRDFU "convert to zoned long" zEC12 zarch
|
||||
Only in binutils-2.35.1/opcodes: s390-opc.txt.orig
|
||||
Only in binutils-2.35.1/opcodes: s390-opc.txt.rej
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- binutils.orig/binutils/testsuite/binutils-all/ar.exp 2024-02-07 13:02:23.490031197 +0000
|
||||
+++ binutils-2.42/binutils/testsuite/binutils-all/ar.exp 2024-02-07 13:03:10.285034069 +0000
|
||||
@@ -1017,7 +1017,7 @@ symbol_table
|
||||
argument_parsing
|
||||
deterministic_archive
|
||||
replacing_deterministic_member
|
||||
-replacing_non_deterministic_member
|
||||
+# replacing_non_deterministic_member
|
||||
replacing_sde_deterministic_member
|
||||
delete_an_element
|
||||
move_an_element
|
||||
330
binutils-fix-testsuite-failures.patch
Normal file
330
binutils-fix-testsuite-failures.patch
Normal file
|
|
@ -0,0 +1,330 @@
|
|||
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"
|
||||
292
binutils-gas-Use-the-directory-name-in-.file-0.patch
Normal file
292
binutils-gas-Use-the-directory-name-in-.file-0.patch
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
diff --git a/gas/testsuite/gas/elf/dwarf-5-file0-2.d b/gas/testsuite/gas/elf/dwarf-5-file0-2.d
|
||||
new file mode 100644
|
||||
index 00000000000..4b3ed29f4c9
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/elf/dwarf-5-file0-2.d
|
||||
@@ -0,0 +1,15 @@
|
||||
+#as: --gdwarf-5
|
||||
+#name: DWARF5 .file 0 dir file
|
||||
+#readelf: -wl
|
||||
+
|
||||
+#...
|
||||
+ The Directory Table \(offset 0x.*, lines 1, columns 1\):
|
||||
+ Entry Name
|
||||
+#...
|
||||
+ 0 \(indirect line string, offset: 0x.*\): /example
|
||||
+
|
||||
+ The File Name Table \(offset 0x.*, lines 2, columns 2\):
|
||||
+ Entry Dir Name
|
||||
+ 0 0 \(indirect line string, offset: 0x.*\): test.c
|
||||
+ 1 0 \(indirect line string, offset: 0x.*\): test.c
|
||||
+#pass
|
||||
diff --git a/gas/testsuite/gas/elf/dwarf-5-file0-2.s b/gas/testsuite/gas/elf/dwarf-5-file0-2.s
|
||||
new file mode 100644
|
||||
index 00000000000..135a03bf493
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/elf/dwarf-5-file0-2.s
|
||||
@@ -0,0 +1,111 @@
|
||||
+ .file "test.c"
|
||||
+ .text
|
||||
+.Ltext0:
|
||||
+ .file 0 "/example" "test.c"
|
||||
+ .globl x
|
||||
+ .section .bss
|
||||
+ .balign 4
|
||||
+ .type x, @object
|
||||
+ .size x, 4
|
||||
+x:
|
||||
+ .zero 4
|
||||
+ .text
|
||||
+.Letext0:
|
||||
+ .file 1 "test.c"
|
||||
+ .section .debug_info,"",%progbits
|
||||
+.Ldebug_info0:
|
||||
+ .long 0x32
|
||||
+ .2byte 0x5
|
||||
+ .byte 0x1
|
||||
+ .byte 0x4
|
||||
+ .long .Ldebug_abbrev0
|
||||
+ .uleb128 0x1
|
||||
+ .long .LASF2
|
||||
+ .byte 0x1d
|
||||
+ .long .LASF0
|
||||
+ .long .LASF1
|
||||
+ .long .Ldebug_line0
|
||||
+ .uleb128 0x2
|
||||
+ .string "x"
|
||||
+ .byte 0x1
|
||||
+ .byte 0x1
|
||||
+ .byte 0x5
|
||||
+ .long 0x2e
|
||||
+ .uleb128 0x5
|
||||
+ .byte 0x3
|
||||
+ .long x
|
||||
+ .uleb128 0x3
|
||||
+ .byte 0x4
|
||||
+ .byte 0x5
|
||||
+ .string "int"
|
||||
+ .byte 0
|
||||
+ .section .debug_abbrev,"",%progbits
|
||||
+.Ldebug_abbrev0:
|
||||
+ .uleb128 0x1
|
||||
+ .uleb128 0x11
|
||||
+ .byte 0x1
|
||||
+ .uleb128 0x25
|
||||
+ .uleb128 0xe
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x1f
|
||||
+ .uleb128 0x1b
|
||||
+ .uleb128 0x1f
|
||||
+ .uleb128 0x10
|
||||
+ .uleb128 0x17
|
||||
+ .byte 0
|
||||
+ .byte 0
|
||||
+ .uleb128 0x2
|
||||
+ .uleb128 0x34
|
||||
+ .byte 0
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x8
|
||||
+ .uleb128 0x3a
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3b
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x39
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x49
|
||||
+ .uleb128 0x13
|
||||
+ .uleb128 0x3f
|
||||
+ .uleb128 0x19
|
||||
+ .uleb128 0x2
|
||||
+ .uleb128 0x18
|
||||
+ .byte 0
|
||||
+ .byte 0
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x24
|
||||
+ .byte 0
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3e
|
||||
+ .uleb128 0xb
|
||||
+ .uleb128 0x3
|
||||
+ .uleb128 0x8
|
||||
+ .byte 0
|
||||
+ .byte 0
|
||||
+ .byte 0
|
||||
+ .section .debug_aranges,"",%progbits
|
||||
+ .long 0x14
|
||||
+ .2byte 0x2
|
||||
+ .long .Ldebug_info0
|
||||
+ .byte 0x4
|
||||
+ .byte 0
|
||||
+ .2byte 0
|
||||
+ .2byte 0
|
||||
+ .long 0
|
||||
+ .long 0
|
||||
+ .section .debug_line,"",%progbits
|
||||
+.Ldebug_line0:
|
||||
+ .section .debug_str,"MS",%progbits,1
|
||||
+.LASF2:
|
||||
+ .string "GNU C17 11.2.1 -g"
|
||||
+ .section .debug_line_str,"MS",%progbits,1
|
||||
+.LASF1:
|
||||
+ .string "/example"
|
||||
+.LASF0:
|
||||
+ .string "test.c"
|
||||
+ .ident "GCC: (GNU) 11.2.1"
|
||||
+ .section .note.GNU-stack,"",%progbits
|
||||
diff --git a/gas/testsuite/gas/elf/dwarf-5-file0-2.s b/gas/testsuite/gas/elf/dwarf-5-file0-2.s
|
||||
index 135a03bf493..bab4a16b56b 100644
|
||||
--- a/gas/testsuite/gas/elf/dwarf-5-file0-2.s
|
||||
+++ b/gas/testsuite/gas/elf/dwarf-5-file0-2.s
|
||||
@@ -5,7 +5,7 @@
|
||||
.globl x
|
||||
.section .bss
|
||||
.balign 4
|
||||
- .type x, @object
|
||||
+ .type x, %object
|
||||
.size x, 4
|
||||
x:
|
||||
.zero 4
|
||||
@@ -14,30 +14,30 @@ x:
|
||||
.file 1 "test.c"
|
||||
.section .debug_info,"",%progbits
|
||||
.Ldebug_info0:
|
||||
- .long 0x32
|
||||
+ .4byte 0x32
|
||||
.2byte 0x5
|
||||
.byte 0x1
|
||||
.byte 0x4
|
||||
- .long .Ldebug_abbrev0
|
||||
+ .4byte .Ldebug_abbrev0
|
||||
.uleb128 0x1
|
||||
- .long .LASF2
|
||||
+ .4byte .LASF2
|
||||
.byte 0x1d
|
||||
- .long .LASF0
|
||||
- .long .LASF1
|
||||
- .long .Ldebug_line0
|
||||
+ .4byte .LASF0
|
||||
+ .4byte .LASF1
|
||||
+ .4byte .Ldebug_line0
|
||||
.uleb128 0x2
|
||||
- .string "x"
|
||||
+ .asciz "x"
|
||||
.byte 0x1
|
||||
.byte 0x1
|
||||
.byte 0x5
|
||||
- .long 0x2e
|
||||
+ .4byte 0x2e
|
||||
.uleb128 0x5
|
||||
.byte 0x3
|
||||
- .long x
|
||||
+ .4byte x
|
||||
.uleb128 0x3
|
||||
.byte 0x4
|
||||
.byte 0x5
|
||||
- .string "int"
|
||||
+ .asciz "int"
|
||||
.byte 0
|
||||
.section .debug_abbrev,"",%progbits
|
||||
.Ldebug_abbrev0:
|
||||
@@ -88,24 +88,24 @@ x:
|
||||
.byte 0
|
||||
.byte 0
|
||||
.section .debug_aranges,"",%progbits
|
||||
- .long 0x14
|
||||
+ .4byte 0x14
|
||||
.2byte 0x2
|
||||
- .long .Ldebug_info0
|
||||
+ .4byte .Ldebug_info0
|
||||
.byte 0x4
|
||||
.byte 0
|
||||
.2byte 0
|
||||
.2byte 0
|
||||
- .long 0
|
||||
- .long 0
|
||||
+ .4byte 0
|
||||
+ .4byte 0
|
||||
.section .debug_line,"",%progbits
|
||||
.Ldebug_line0:
|
||||
.section .debug_str,"MS",%progbits,1
|
||||
.LASF2:
|
||||
- .string "GNU C17 11.2.1 -g"
|
||||
+ .asciz "GNU C17 11.2.1 -g"
|
||||
.section .debug_line_str,"MS",%progbits,1
|
||||
.LASF1:
|
||||
- .string "/example"
|
||||
+ .asciz "/example"
|
||||
.LASF0:
|
||||
- .string "test.c"
|
||||
+ .asciz "test.c"
|
||||
.ident "GCC: (GNU) 11.2.1"
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
diff -rup binutils.orig/gas/dwarf2dbg.c binutils-2.35.2/gas/dwarf2dbg.c
|
||||
--- binutils.orig/gas/dwarf2dbg.c 2021-11-08 14:59:19.759524743 +0000
|
||||
+++ binutils-2.35.2/gas/dwarf2dbg.c 2021-11-08 15:00:55.179909708 +0000
|
||||
@@ -588,6 +588,7 @@ get_basename (const char * pathname)
|
||||
|
||||
static unsigned int
|
||||
get_directory_table_entry (const char * dirname,
|
||||
+ const char * file0_dirname,
|
||||
size_t dirlen,
|
||||
bfd_boolean can_use_zero)
|
||||
{
|
||||
@@ -617,7 +618,7 @@ get_directory_table_entry (const char *
|
||||
{
|
||||
if (dirs == NULL || dirs[0] == NULL)
|
||||
{
|
||||
- const char * pwd = getpwd ();
|
||||
+ const char * pwd = file0_dirname ? file0_dirname : getpwd ();
|
||||
|
||||
if (dwarf_level >= 5 && strcmp (dirname, pwd) != 0)
|
||||
{
|
||||
@@ -626,7 +627,7 @@ get_directory_table_entry (const char *
|
||||
directory). Since we are about to create a directory entry that
|
||||
is not the same, allocate the current directory first.
|
||||
FIXME: Alternatively we could generate an error message here. */
|
||||
- (void) get_directory_table_entry (pwd, strlen (pwd), TRUE);
|
||||
+ (void) get_directory_table_entry (pwd, NULL, strlen (pwd), TRUE);
|
||||
d = 1;
|
||||
}
|
||||
else
|
||||
@@ -722,7 +723,7 @@ allocate_filenum (const char * pathname)
|
||||
file = get_basename (pathname);
|
||||
dir_len = file - pathname;
|
||||
|
||||
- dir = get_directory_table_entry (pathname, dir_len, FALSE);
|
||||
+ dir = get_directory_table_entry (pathname, NULL, dir_len, FALSE);
|
||||
|
||||
/* Do not use slot-0. That is specifically reserved for use by
|
||||
the '.file 0 "name"' directive. */
|
||||
@@ -762,6 +763,7 @@ allocate_filename_to_slot (const char *
|
||||
const char *file;
|
||||
size_t dirlen;
|
||||
unsigned int i, d;
|
||||
+ const char *file0_dirname = dirname;
|
||||
|
||||
/* Short circuit the common case of adding the same pathname
|
||||
as last time. */
|
||||
@@ -836,7 +838,8 @@ allocate_filename_to_slot (const char *
|
||||
file = filename;
|
||||
}
|
||||
|
||||
- d = get_directory_table_entry (dirname, dirlen, num == 0);
|
||||
+ d = get_directory_table_entry (dirname, file0_dirname, dirlen,
|
||||
+ num == 0);
|
||||
i = num;
|
||||
|
||||
if (! assign_file_to_slot (i, file, d))
|
||||
diff -rup binutils.orig/gas/testsuite/gas/elf/elf.exp binutils-2.35.2/gas/testsuite/gas/elf/elf.exp
|
||||
--- binutils.orig/gas/testsuite/gas/elf/elf.exp 2021-11-08 14:59:19.856524118 +0000
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/elf/elf.exp 2021-11-08 14:59:36.225418609 +0000
|
||||
@@ -274,6 +274,7 @@ if { [is_elf_format] } then {
|
||||
run_dump_test "dwarf2-18" $dump_opts
|
||||
run_dump_test "dwarf2-19" $dump_opts
|
||||
run_dump_test "dwarf-5-file0" $dump_opts
|
||||
+ run_dump_test "dwarf-5-file0-2" $dump_opts
|
||||
run_dump_test "dwarf-5-dir0" $dump_opts
|
||||
run_dump_test "dwarf-4-cu" $dump_opts
|
||||
run_dump_test "dwarf-5-cu" $dump_opts
|
||||
|
||||
47
binutils-gas-auto-dwarf-5.patch
Normal file
47
binutils-gas-auto-dwarf-5.patch
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
--- binutils.orig/gas/dwarf2dbg.c 2021-01-18 15:02:20.322260068 +0000
|
||||
+++ binutils-2.35.1/gas/dwarf2dbg.c 2021-01-18 15:04:20.078481127 +0000
|
||||
@@ -537,7 +537,11 @@ dwarf2_gen_line_info (addressT ofs, stru
|
||||
if (loc->line == 0)
|
||||
return;
|
||||
if (loc->filenum == 0 && DWARF2_LINE_VERSION < 5)
|
||||
- return;
|
||||
+ {
|
||||
+ dwarf_level = 5;
|
||||
+ if (DWARF2_LINE_VERSION < 5)
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
/* Don't emit sequences of line symbols for the same line when the
|
||||
symbols apply to assembler code. It is necessary to emit
|
||||
@@ -1030,9 +1034,13 @@ dwarf2_directive_filename (void)
|
||||
|
||||
if ((offsetT) num < 1 && DWARF2_LINE_VERSION < 5)
|
||||
{
|
||||
- as_bad (_("file number less than one"));
|
||||
- ignore_rest_of_line ();
|
||||
- return NULL;
|
||||
+ dwarf_level = 5;
|
||||
+ if (DWARF2_LINE_VERSION < 5)
|
||||
+ {
|
||||
+ as_bad (_("file number less than one"));
|
||||
+ ignore_rest_of_line ();
|
||||
+ return NULL;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* FIXME: Should we allow ".file <N>\n" as an expression meaning
|
||||
@@ -1129,8 +1137,12 @@ dwarf2_directive_loc (int dummy ATTRIBUT
|
||||
{
|
||||
if (filenum != 0 || DWARF2_LINE_VERSION < 5)
|
||||
{
|
||||
- as_bad (_("file number less than one"));
|
||||
- return;
|
||||
+ dwarf_level = 5;
|
||||
+ if (DWARF2_LINE_VERSION < 5)
|
||||
+ {
|
||||
+ as_bad (_("file number less than one"));
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
375
binutils-gas-multibyte-warnings.patch
Normal file
375
binutils-gas-multibyte-warnings.patch
Normal file
|
|
@ -0,0 +1,375 @@
|
|||
diff -rupN binutils.orig/gas/NEWS binutils-2.35.2/gas/NEWS
|
||||
--- binutils.orig/gas/NEWS 2021-11-19 13:45:07.404537791 +0000
|
||||
+++ binutils-2.35.2/gas/NEWS 2021-11-19 13:46:06.334144249 +0000
|
||||
@@ -1,5 +1,13 @@
|
||||
-*- text -*-
|
||||
|
||||
+* The --multibyte-handling=[allow|warn|warn-sym-only] option tells the
|
||||
+ assembler what to when it encoutners multibyte characters in the input. The
|
||||
+ default is to allow them. Setting the option to "warn" will generate a
|
||||
+ warning message whenever any multibyte character is encountered. Using the
|
||||
+ option to "warn-sym-only" will make the assembler generate a warning whenever a
|
||||
+ symbol is defined containing multibyte characters. (References to undefined
|
||||
+ symbols will not generate warnings).
|
||||
+
|
||||
* Add {disp16} pseudo prefix to x86 assembler.
|
||||
|
||||
Changes in 2.35:
|
||||
diff -rupN binutils.orig/gas/app.c binutils-2.35.2/gas/app.c
|
||||
--- binutils.orig/gas/app.c 2021-11-19 13:45:07.403537798 +0000
|
||||
+++ binutils-2.35.2/gas/app.c 2021-11-19 13:45:34.611356099 +0000
|
||||
@@ -352,6 +352,55 @@ process_escape (int ch)
|
||||
}
|
||||
}
|
||||
|
||||
+#define MULTIBYTE_WARN_COUNT_LIMIT 10
|
||||
+static unsigned int multibyte_warn_count = 0;
|
||||
+
|
||||
+bfd_boolean
|
||||
+scan_for_multibyte_characters (const unsigned char * start,
|
||||
+ const unsigned char * end,
|
||||
+ bfd_boolean warn)
|
||||
+{
|
||||
+ if (end <= start)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ if (warn && multibyte_warn_count > MULTIBYTE_WARN_COUNT_LIMIT)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ bfd_boolean found = FALSE;
|
||||
+
|
||||
+ while (start < end)
|
||||
+ {
|
||||
+ unsigned char c;
|
||||
+
|
||||
+ if ((c = * start++) <= 0x7f)
|
||||
+ continue;
|
||||
+
|
||||
+ if (!warn)
|
||||
+ return TRUE;
|
||||
+
|
||||
+ found = TRUE;
|
||||
+
|
||||
+ const char * filename;
|
||||
+ unsigned int lineno;
|
||||
+
|
||||
+ filename = as_where (& lineno);
|
||||
+ if (filename == NULL)
|
||||
+ as_warn (_("multibyte character (%#x) encountered in input"), c);
|
||||
+ else if (lineno == 0)
|
||||
+ as_warn (_("multibyte character (%#x) encountered in %s"), c, filename);
|
||||
+ else
|
||||
+ as_warn (_("multibyte character (%#x) encountered in %s at or near line %u"), c, filename, lineno);
|
||||
+
|
||||
+ if (++ multibyte_warn_count == MULTIBYTE_WARN_COUNT_LIMIT)
|
||||
+ {
|
||||
+ as_warn (_("further multibyte character warnings suppressed"));
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return found;
|
||||
+}
|
||||
+
|
||||
/* This function is called to process input characters. The GET
|
||||
parameter is used to retrieve more input characters. GET should
|
||||
set its parameter to point to a buffer, and return the length of
|
||||
@@ -470,6 +519,11 @@ do_scrub_chars (size_t (*get) (char *, s
|
||||
return 0;
|
||||
from = input_buffer;
|
||||
fromend = from + fromlen;
|
||||
+
|
||||
+ if (multibyte_handling == multibyte_warn)
|
||||
+ (void) scan_for_multibyte_characters ((const unsigned char *) from,
|
||||
+ (const unsigned char* ) fromend,
|
||||
+ TRUE /* Generate warnings. */);
|
||||
}
|
||||
|
||||
while (1)
|
||||
diff -rupN binutils.orig/gas/as.c binutils-2.35.2/gas/as.c
|
||||
--- binutils.orig/gas/as.c 2021-11-19 13:45:07.404537791 +0000
|
||||
+++ binutils-2.35.2/gas/as.c 2021-11-19 13:45:34.613356085 +0000
|
||||
@@ -482,7 +482,7 @@ parse_args (int * pargc, char *** pargv)
|
||||
OPTION_DEBUG_PREFIX_MAP,
|
||||
OPTION_DEFSYM,
|
||||
OPTION_LISTING_LHS_WIDTH,
|
||||
- OPTION_LISTING_LHS_WIDTH2,
|
||||
+ OPTION_LISTING_LHS_WIDTH2, /* = STD_BASE + 10 */
|
||||
OPTION_LISTING_RHS_WIDTH,
|
||||
OPTION_LISTING_CONT_LINES,
|
||||
OPTION_DEPFILE,
|
||||
@@ -492,7 +492,7 @@ parse_args (int * pargc, char *** pargv)
|
||||
OPTION_GDWARF_3,
|
||||
OPTION_GDWARF_4,
|
||||
OPTION_GDWARF_5,
|
||||
- OPTION_GDWARF_SECTIONS,
|
||||
+ OPTION_GDWARF_SECTIONS, /* = STD_BASE + 20 */
|
||||
OPTION_GDWARF_CIE_VERSION,
|
||||
OPTION_STRIP_LOCAL_ABSOLUTE,
|
||||
OPTION_TRADITIONAL_FORMAT,
|
||||
@@ -502,7 +502,7 @@ parse_args (int * pargc, char *** pargv)
|
||||
OPTION_NOEXECSTACK,
|
||||
OPTION_SIZE_CHECK,
|
||||
OPTION_ELF_STT_COMMON,
|
||||
- OPTION_ELF_BUILD_NOTES,
|
||||
+ OPTION_ELF_BUILD_NOTES, /* = STD_BASE + 30 */
|
||||
OPTION_SECTNAME_SUBST,
|
||||
OPTION_ALTERNATE,
|
||||
OPTION_AL,
|
||||
@@ -511,7 +511,8 @@ parse_args (int * pargc, char *** pargv)
|
||||
OPTION_WARN_FATAL,
|
||||
OPTION_COMPRESS_DEBUG,
|
||||
OPTION_NOCOMPRESS_DEBUG,
|
||||
- OPTION_NO_PAD_SECTIONS /* = STD_BASE + 40 */
|
||||
+ OPTION_NO_PAD_SECTIONS,
|
||||
+ OPTION_MULTIBYTE_HANDLING /* = STD_BASE + 40 */
|
||||
/* When you add options here, check that they do
|
||||
not collide with OPTION_MD_BASE. See as.h. */
|
||||
};
|
||||
@@ -589,6 +590,7 @@ parse_args (int * pargc, char *** pargv)
|
||||
,{"target-help", no_argument, NULL, OPTION_TARGET_HELP}
|
||||
,{"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT}
|
||||
,{"warn", no_argument, NULL, OPTION_WARN}
|
||||
+ ,{"multibyte-handling", required_argument, NULL, OPTION_MULTIBYTE_HANDLING}
|
||||
};
|
||||
|
||||
/* Construct the option lists from the standard list and the target
|
||||
@@ -691,6 +693,19 @@ parse_args (int * pargc, char *** pargv)
|
||||
flag_traditional_format = 1;
|
||||
break;
|
||||
|
||||
+ case OPTION_MULTIBYTE_HANDLING:
|
||||
+ if (strcmp (optarg, "allow") == 0)
|
||||
+ multibyte_handling = multibyte_allow;
|
||||
+ else if (strcmp (optarg, "warn") == 0)
|
||||
+ multibyte_handling = multibyte_warn;
|
||||
+ else if (strcmp (optarg, "warn-sym-only") == 0)
|
||||
+ multibyte_handling = multibyte_warn_syms;
|
||||
+ else if (strcmp (optarg, "warn_sym_only") == 0)
|
||||
+ multibyte_handling = multibyte_warn_syms;
|
||||
+ else
|
||||
+ as_fatal (_("unexpected argument to --multibyte-input-option: '%s'"), optarg);
|
||||
+ break;
|
||||
+
|
||||
case OPTION_VERSION:
|
||||
/* This output is intended to follow the GNU standards document. */
|
||||
printf (_("GNU assembler %s\n"), BFD_VERSION_STRING);
|
||||
diff -rupN binutils.orig/gas/as.h binutils-2.35.2/gas/as.h
|
||||
--- binutils.orig/gas/as.h 2021-11-19 13:45:07.136539581 +0000
|
||||
+++ binutils-2.35.2/gas/as.h 2021-11-19 13:45:34.613356085 +0000
|
||||
@@ -388,6 +388,14 @@ COMMON int linkrelax;
|
||||
|
||||
COMMON int do_not_pad_sections_to_alignment;
|
||||
|
||||
+enum multibyte_input_handling
|
||||
+{
|
||||
+ multibyte_allow = 0,
|
||||
+ multibyte_warn,
|
||||
+ multibyte_warn_syms
|
||||
+};
|
||||
+COMMON enum multibyte_input_handling multibyte_handling;
|
||||
+
|
||||
/* TRUE if we should produce a listing. */
|
||||
extern int listing;
|
||||
|
||||
@@ -495,6 +503,7 @@ void input_scrub_insert_file (char *);
|
||||
char * input_scrub_new_file (const char *);
|
||||
char * input_scrub_next_buffer (char **bufp);
|
||||
size_t do_scrub_chars (size_t (*get) (char *, size_t), char *, size_t);
|
||||
+bfd_boolean scan_for_multibyte_characters (const unsigned char *, const unsigned char *, bfd_boolean);
|
||||
int gen_to_words (LITTLENUM_TYPE *, int, long);
|
||||
int had_err (void);
|
||||
int ignore_input (void);
|
||||
diff -rupN binutils.orig/gas/doc/as.texi binutils-2.35.2/gas/doc/as.texi
|
||||
--- binutils.orig/gas/doc/as.texi 2021-11-19 13:45:07.141539547 +0000
|
||||
+++ binutils-2.35.2/gas/doc/as.texi 2021-11-19 13:45:34.617356059 +0000
|
||||
@@ -246,6 +246,7 @@ gcc(1), ld(1), and the Info entries for
|
||||
[@b{--sectname-subst}] [@b{--size-check=[error|warning]}]
|
||||
[@b{--elf-stt-common=[no|yes]}]
|
||||
[@b{--generate-missing-build-notes=[no|yes]}]
|
||||
+ [@b{--multibyte-handling=[allow|warn|warn-sym-only]}]
|
||||
[@b{--target-help}] [@var{target-options}]
|
||||
[@b{--}|@var{files} @dots{}]
|
||||
@c
|
||||
@@ -866,6 +867,18 @@ Set the maximum width of an input source
|
||||
Set the maximum number of lines printed in a listing for a single line of input
|
||||
to @var{number} + 1.
|
||||
|
||||
+@item --multibyte-handling=allow
|
||||
+@itemx --multibyte-handling=warn
|
||||
+@itemx --multibyte-handling=warn-sym-only
|
||||
+Controls how the assembler handles multibyte characters in the input. The
|
||||
+default (which can be restored by using the @option{allow} argument) is to
|
||||
+allow such characters without complaint. Using the @option{warn} argument will
|
||||
+make the assembler generate a warning message whenever any multibyte character
|
||||
+is encountered. Using the @option{warn-sym-only} argument will only cause a
|
||||
+warning to be generated when a symbol is defined with a name that contains
|
||||
+multibyte characters. (References to undefined symbols will not generate a
|
||||
+warning).
|
||||
+
|
||||
@item --no-pad-sections
|
||||
Stop the assembler for padding the ends of output sections to the alignment
|
||||
of that section. The default is to pad the sections, but this can waste space
|
||||
@@ -2954,9 +2967,11 @@ are noted in @ref{Machine Dependencies}.
|
||||
@end ifset
|
||||
No symbol may begin with a digit. Case is significant.
|
||||
There is no length limit; all characters are significant. Multibyte characters
|
||||
-are supported. Symbols are delimited by characters not in that set, or by the
|
||||
-beginning of a file (since the source program must end with a newline, the end
|
||||
-of a file is not a possible symbol delimiter). @xref{Symbols}.
|
||||
+are supported, but note that the setting of the
|
||||
+@option{--multibyte-handling} option might prevent their use. Symbols
|
||||
+are delimited by characters not in that set, or by the beginning of a file
|
||||
+(since the source program must end with a newline, the end of a file is not a
|
||||
+possible symbol delimiter). @xref{Symbols}.
|
||||
|
||||
Symbol names may also be enclosed in double quote @code{"} characters. In such
|
||||
cases any characters are allowed, except for the NUL character. If a double
|
||||
@@ -3846,11 +3861,18 @@ than @code{Foo}.
|
||||
Symbol names do not start with a digit. An exception to this rule is made for
|
||||
Local Labels. See below.
|
||||
|
||||
-Multibyte characters are supported. To generate a symbol name containing
|
||||
+Multibyte characters are supported, but note that the setting of the
|
||||
+@option{multibyte-handling} option might prevent their use.
|
||||
+To generate a symbol name containing
|
||||
multibyte characters enclose it within double quotes and use escape codes. cf
|
||||
@xref{Strings}. Generating a multibyte symbol name from a label is not
|
||||
currently supported.
|
||||
|
||||
+Since multibyte symbol names are unusual, and could possibly be used
|
||||
+maliciously, @command{@value{AS}} provides a command line option
|
||||
+(@option{--multibyte-handling=warn-sym-only}) which can be used to generate a
|
||||
+warning message whenever a symbol name containing multibyte characters is defined.
|
||||
+
|
||||
Each symbol has exactly one name. Each name in an assembly language program
|
||||
refers to exactly one symbol. You may use that symbol name any number of times
|
||||
in a program.
|
||||
diff -rupN binutils.orig/gas/input-scrub.c binutils-2.35.2/gas/input-scrub.c
|
||||
--- binutils.orig/gas/input-scrub.c 2021-11-19 13:45:07.138539567 +0000
|
||||
+++ binutils-2.35.2/gas/input-scrub.c 2021-11-19 13:45:34.618356052 +0000
|
||||
@@ -377,6 +377,11 @@ input_scrub_next_buffer (char **bufp)
|
||||
++p;
|
||||
}
|
||||
|
||||
+ if (multibyte_handling == multibyte_warn)
|
||||
+ (void) scan_for_multibyte_characters ((const unsigned char *) p,
|
||||
+ (const unsigned char *) limit,
|
||||
+ TRUE /* Generate warnings */);
|
||||
+
|
||||
/* We found a newline in the newly read chars. */
|
||||
partial_where = p;
|
||||
partial_size = limit - p;
|
||||
diff -rupN binutils.orig/gas/symbols.c binutils-2.35.2/gas/symbols.c
|
||||
--- binutils.orig/gas/symbols.c 2021-11-19 13:45:07.404537791 +0000
|
||||
+++ binutils-2.35.2/gas/symbols.c 2021-11-19 13:50:21.853437801 +0000
|
||||
@@ -73,6 +73,10 @@ struct symbol_flags
|
||||
before. It is cleared as soon as any direct reference to the
|
||||
symbol is present. */
|
||||
unsigned int sy_weakrefd : 1;
|
||||
+
|
||||
+ /* Set when a warning about the symbol containing multibyte characters
|
||||
+ is generated. */
|
||||
+ unsigned int multibyte_warned : 1;
|
||||
};
|
||||
|
||||
/* The information we keep for a symbol. Note that the symbol table
|
||||
@@ -282,6 +286,18 @@ symbol_create (const char *name, /* It i
|
||||
as_fatal ("bfd_make_empty_symbol: %s", bfd_errmsg (bfd_get_error ()));
|
||||
S_SET_NAME (symbolP, preserved_copy_of_name);
|
||||
|
||||
+ if (multibyte_handling == multibyte_warn_syms
|
||||
+ && ! symbolP->sy_flags.sy_local_symbol
|
||||
+ && segment != undefined_section
|
||||
+ && ! symbolP->sy_flags.multibyte_warned
|
||||
+ && scan_for_multibyte_characters ((const unsigned char *) name,
|
||||
+ (const unsigned char *) name + strlen (name),
|
||||
+ FALSE /* Do not warn. */))
|
||||
+ {
|
||||
+ as_warn (_("symbol '%s' contains multibyte characters"), name);
|
||||
+ symbolP->sy_flags.multibyte_warned = 1;
|
||||
+ }
|
||||
+
|
||||
S_SET_SEGMENT (symbolP, segment);
|
||||
S_SET_VALUE (symbolP, valu);
|
||||
symbol_clear_list_pointers (symbolP);
|
||||
@@ -2421,7 +2437,21 @@ S_SET_SEGMENT (symbolS *s, segT seg)
|
||||
abort ();
|
||||
}
|
||||
else
|
||||
- s->bsym->section = seg;
|
||||
+ {
|
||||
+ if (multibyte_handling == multibyte_warn_syms
|
||||
+ && ! s->sy_flags.sy_local_symbol
|
||||
+ && seg != undefined_section
|
||||
+ && ! s->sy_flags.multibyte_warned
|
||||
+ && scan_for_multibyte_characters ((const unsigned char *) S_GET_NAME (s),
|
||||
+ (const unsigned char *) S_GET_NAME (s) + strlen (S_GET_NAME (s)),
|
||||
+ FALSE))
|
||||
+ {
|
||||
+ as_warn (_("symbol '%s' contains multibyte characters"), S_GET_NAME (s));
|
||||
+ s->sy_flags.multibyte_warned = 1;
|
||||
+ }
|
||||
+
|
||||
+ s->bsym->section = seg;
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
diff -rupN binutils.orig/gas/testsuite/gas/all/gas.exp binutils-2.35.2/gas/testsuite/gas/all/gas.exp
|
||||
--- binutils.orig/gas/testsuite/gas/all/gas.exp 2021-11-19 13:45:07.400537818 +0000
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/all/gas.exp 2021-11-19 13:51:08.664125186 +0000
|
||||
@@ -470,3 +470,5 @@ run_dump_test "fill-1"
|
||||
gas_test "pr23938.s" "" "" ".xstabs"
|
||||
|
||||
run_dump_test "nop"
|
||||
+run_dump_test "multibyte1"
|
||||
+run_dump_test "multibyte2"
|
||||
diff -rupN binutils.orig/testsuite/gas/all/multibyte.s binutils-2.35.2/testsuite/gas/all/multibyte.s
|
||||
--- binutils.orig/testsuite/gas/all/multibyte.s 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.35.2/testsuite/gas/all/multibyte.s 2021-11-19 13:45:35.284351604 +0000
|
||||
@@ -0,0 +1,8 @@
|
||||
+ .text
|
||||
+ .globl heoll
|
||||
+heoll:
|
||||
+ .nop
|
||||
+
|
||||
+ .globl hello
|
||||
+hello:
|
||||
+ .nop
|
||||
diff -rupN binutils.orig/testsuite/gas/all/multibyte1.d binutils-2.35.2/testsuite/gas/all/multibyte1.d
|
||||
--- binutils.orig/testsuite/gas/all/multibyte1.d 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.35.2/testsuite/gas/all/multibyte1.d 2021-11-19 13:45:35.284351604 +0000
|
||||
@@ -0,0 +1,3 @@
|
||||
+#source: multibyte.s
|
||||
+#as: --multibyte-handling=warn
|
||||
+#warning_output: multibyte1.l
|
||||
diff -rupN binutils.orig/testsuite/gas/all/multibyte1.l binutils-2.35.2/testsuite/gas/all/multibyte1.l
|
||||
--- binutils.orig/testsuite/gas/all/multibyte1.l 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.35.2/testsuite/gas/all/multibyte1.l 2021-11-19 13:45:35.284351604 +0000
|
||||
@@ -0,0 +1,12 @@
|
||||
+[^:]*: Assembler messages:
|
||||
+[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0x80\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xae\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0x80\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xac\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0x80\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xae\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: further multibyte character warnings suppressed
|
||||
diff -rupN binutils.orig/testsuite/gas/all/multibyte2.d binutils-2.35.2/testsuite/gas/all/multibyte2.d
|
||||
--- binutils.orig/testsuite/gas/all/multibyte2.d 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.35.2/testsuite/gas/all/multibyte2.d 2021-11-19 13:45:35.284351604 +0000
|
||||
@@ -0,0 +1,3 @@
|
||||
+#source: multibyte.s
|
||||
+#as: --multibyte-handling=warn-sym-only
|
||||
+#warning_output: multibyte2.l
|
||||
diff -rupN binutils.orig/testsuite/gas/all/multibyte2.l binutils-2.35.2/testsuite/gas/all/multibyte2.l
|
||||
--- binutils.orig/testsuite/gas/all/multibyte2.l 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.35.2/testsuite/gas/all/multibyte2.l 2021-11-19 13:45:35.284351604 +0000
|
||||
@@ -0,0 +1,2 @@
|
||||
+[^:]*: Assembler messages:
|
||||
+[^:]*:3: Warning: symbol '.*' contains multibyte characters
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- binutils.orig/gold/dwp.cc 2023-05-02 13:26:44.075148082 +0100
|
||||
+++ binutils-2.40/gold/dwp.cc 2023-05-02 13:27:16.189130127 +0100
|
||||
@@ -2418,6 +2418,8 @@ main(int argc, char** argv)
|
||||
{
|
||||
Dwo_file exe_file(exe_filename);
|
||||
exe_file.read_executable(&files);
|
||||
+ if (files.empty())
|
||||
+ gold_fatal(_("Could not find any dwo links in specified EXE"));
|
||||
}
|
||||
|
||||
// Add any additional files listed on command line.
|
||||
181
binutils-gold-gnu-properties.patch
Normal file
181
binutils-gold-gnu-properties.patch
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
diff -rup binutils.orig/gold/testsuite/gnu_property_a.S binutils-2.35/gold/testsuite/gnu_property_a.S
|
||||
--- binutils.orig/gold/testsuite/gnu_property_a.S 2021-01-18 14:01:41.228809868 +0000
|
||||
+++ binutils-2.35/gold/testsuite/gnu_property_a.S 2021-01-18 14:01:52.542736705 +0000
|
||||
@@ -1,8 +1,8 @@
|
||||
#define NT_GNU_PROPERTY_TYPE_0 5
|
||||
|
||||
#define GNU_PROPERTY_STACK_SIZE 1
|
||||
-#define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000
|
||||
-#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001
|
||||
+#define GNU_PROPERTY_X86_ISA_1_USED 0xc0010002
|
||||
+#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0008002
|
||||
#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002
|
||||
|
||||
#if __SIZEOF_PTRDIFF_T__ == 8
|
||||
diff -rup binutils.orig/gold/testsuite/gnu_property_b.S binutils-2.35/gold/testsuite/gnu_property_b.S
|
||||
--- binutils.orig/gold/testsuite/gnu_property_b.S 2021-01-18 14:01:41.233809836 +0000
|
||||
+++ binutils-2.35/gold/testsuite/gnu_property_b.S 2021-01-18 14:01:52.542736705 +0000
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#define GNU_PROPERTY_STACK_SIZE 1
|
||||
#define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2
|
||||
-#define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000
|
||||
-#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001
|
||||
+#define GNU_PROPERTY_X86_ISA_1_USED 0xc0010002
|
||||
+#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0008002
|
||||
#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002
|
||||
|
||||
#if __SIZEOF_PTRDIFF_T__ == 8
|
||||
diff -rup binutils.orig/gold/testsuite/gnu_property_c.S binutils-2.35/gold/testsuite/gnu_property_c.S
|
||||
--- binutils.orig/gold/testsuite/gnu_property_c.S 2021-01-18 14:01:41.232809843 +0000
|
||||
+++ binutils-2.35/gold/testsuite/gnu_property_c.S 2021-01-18 14:01:52.542736705 +0000
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#define GNU_PROPERTY_STACK_SIZE 1
|
||||
#define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2
|
||||
-#define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000
|
||||
-#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001
|
||||
+#define GNU_PROPERTY_X86_ISA_1_USED 0xc0010002
|
||||
+#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0008002
|
||||
#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002
|
||||
|
||||
#if __SIZEOF_PTRDIFF_T__ == 8
|
||||
diff -rup binutils.orig/gold/testsuite/gnu_property_test.sh binutils-2.35/gold/testsuite/gnu_property_test.sh
|
||||
--- binutils.orig/gold/testsuite/gnu_property_test.sh 2021-01-18 14:01:41.236809817 +0000
|
||||
+++ binutils-2.35/gold/testsuite/gnu_property_test.sh 2021-01-18 14:01:52.543736699 +0000
|
||||
@@ -57,8 +57,8 @@ check_count gnu_property_test.stdout "GN
|
||||
|
||||
check gnu_property_test.stdout "stack size: 0x111100"
|
||||
check gnu_property_test.stdout "no copy on protected"
|
||||
-check gnu_property_test.stdout "x86 ISA used: i486, SSE2, SSE4_2, AVX512CD"
|
||||
-check gnu_property_test.stdout "x86 ISA needed: i486, SSE2, SSE4_2, AVX512CD"
|
||||
+check gnu_property_test.stdout "x86 ISA used: x86-64-v2, <unknown: 10>, <unknown: 100>, <unknown: 1000>"
|
||||
+check gnu_property_test.stdout "x86 ISA needed: x86-64-v2, <unknown: 10>, <unknown: 100>, <unknown: 1000>"
|
||||
check gnu_property_test.stdout "x86 feature: IBT"
|
||||
|
||||
exit 0
|
||||
diff -rup binutils.orig/gold/x86_64.cc binutils-2.35/gold/x86_64.cc
|
||||
--- binutils.orig/gold/x86_64.cc 2021-01-18 14:01:41.225809888 +0000
|
||||
+++ binutils-2.35/gold/x86_64.cc 2021-01-18 14:01:52.543736699 +0000
|
||||
@@ -706,8 +706,9 @@ class Target_x86_64 : public Sized_targe
|
||||
rela_irelative_(NULL), copy_relocs_(elfcpp::R_X86_64_COPY),
|
||||
got_mod_index_offset_(-1U), tlsdesc_reloc_info_(),
|
||||
tls_base_symbol_defined_(false), isa_1_used_(0), isa_1_needed_(0),
|
||||
- feature_1_(0), object_isa_1_used_(0), object_feature_1_(0),
|
||||
- seen_first_object_(false)
|
||||
+ feature_1_(0), feature_2_used_(0), feature_2_needed_(0),
|
||||
+ object_isa_1_used_(0), object_feature_1_(0),
|
||||
+ object_feature_2_used_(0), seen_first_object_(false)
|
||||
{ }
|
||||
|
||||
// Hook for a new output section.
|
||||
@@ -1382,6 +1383,8 @@ class Target_x86_64 : public Sized_targe
|
||||
uint32_t isa_1_used_;
|
||||
uint32_t isa_1_needed_;
|
||||
uint32_t feature_1_;
|
||||
+ uint32_t feature_2_used_;
|
||||
+ uint32_t feature_2_needed_;
|
||||
// Target-specific properties from the current object.
|
||||
// These bits get ORed into ISA_1_USED_ after all properties for the object
|
||||
// have been processed. But if either is all zeroes (as when the property
|
||||
@@ -1391,6 +1394,7 @@ class Target_x86_64 : public Sized_targe
|
||||
// These bits get ANDed into FEATURE_1_ after all properties for the object
|
||||
// have been processed.
|
||||
uint32_t object_feature_1_;
|
||||
+ uint32_t object_feature_2_used_;
|
||||
// Whether we have seen our first object, for use in initializing FEATURE_1_.
|
||||
bool seen_first_object_;
|
||||
};
|
||||
@@ -1594,9 +1598,15 @@ Target_x86_64<size>::record_gnu_property
|
||||
|
||||
switch (pr_type)
|
||||
{
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED:
|
||||
case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED:
|
||||
case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED:
|
||||
if (pr_datasz != 4)
|
||||
{
|
||||
gold_warning(_("%s: corrupt .note.gnu.property section "
|
||||
@@ -1625,6 +1635,12 @@ Target_x86_64<size>::record_gnu_property
|
||||
// If we see multiple feature props in one object, OR them together.
|
||||
this->object_feature_1_ |= val;
|
||||
break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED:
|
||||
+ this->object_feature_2_used_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED:
|
||||
+ this->feature_2_needed_ |= val;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1642,15 +1658,23 @@ Target_x86_64<size>::merge_gnu_propertie
|
||||
else if (this->isa_1_used_ != 0)
|
||||
this->isa_1_used_ |= this->object_isa_1_used_;
|
||||
this->feature_1_ &= this->object_feature_1_;
|
||||
+ // If any object is missing the FEATURE_2_USED property, we must
|
||||
+ // omit it from the output file.
|
||||
+ if (this->object_feature_2_used_ == 0)
|
||||
+ this->feature_2_used_ = 0;
|
||||
+ else if (this->feature_2_used_ != 0)
|
||||
+ this->feature_2_used_ |= this->object_feature_2_used_;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->isa_1_used_ = this->object_isa_1_used_;
|
||||
this->feature_1_ = this->object_feature_1_;
|
||||
+ this->feature_2_used_ = this->object_feature_2_used_;
|
||||
this->seen_first_object_ = true;
|
||||
}
|
||||
this->object_isa_1_used_ = 0;
|
||||
this->object_feature_1_ = 0;
|
||||
+ this->object_feature_2_used_ = 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -1676,6 +1700,12 @@ Target_x86_64<size>::do_finalize_gnu_pro
|
||||
if (this->feature_1_ != 0)
|
||||
add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND,
|
||||
this->feature_1_);
|
||||
+ if (this->feature_2_used_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED,
|
||||
+ this->feature_2_used_);
|
||||
+ if (this->feature_2_needed_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED,
|
||||
+ this->feature_2_needed_);
|
||||
}
|
||||
|
||||
// Write the first three reserved words of the .got.plt section.
|
||||
--- binutils.orig/elfcpp/elfcpp.h 2021-01-18 14:01:40.778812778 +0000
|
||||
+++ binutils-2.35/elfcpp/elfcpp.h 2021-01-18 14:50:05.144035077 +0000
|
||||
@@ -1009,9 +1009,21 @@ enum
|
||||
GNU_PROPERTY_STACK_SIZE = 1,
|
||||
GNU_PROPERTY_NO_COPY_ON_PROTECTED = 2,
|
||||
GNU_PROPERTY_LOPROC = 0xc0000000,
|
||||
- GNU_PROPERTY_X86_ISA_1_USED = 0xc0000000,
|
||||
- GNU_PROPERTY_X86_ISA_1_NEEDED = 0xc0000001,
|
||||
- GNU_PROPERTY_X86_FEATURE_1_AND = 0xc0000002,
|
||||
+ GNU_PROPERTY_X86_COMPAT_ISA_1_USED = 0xc0000000,
|
||||
+ GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED = 0xc0000001,
|
||||
+ GNU_PROPERTY_X86_UINT32_AND_LO = 0xc0000002,
|
||||
+ GNU_PROPERTY_X86_UINT32_AND_HI = 0xc0007fff,
|
||||
+ GNU_PROPERTY_X86_UINT32_OR_LO = 0xc0008000,
|
||||
+ GNU_PROPERTY_X86_UINT32_OR_HI = 0xc000ffff,
|
||||
+ GNU_PROPERTY_X86_UINT32_OR_AND_LO = 0xc0010000,
|
||||
+ GNU_PROPERTY_X86_UINT32_OR_AND_HI = 0xc0017fff,
|
||||
+ GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED = GNU_PROPERTY_X86_UINT32_OR_LO + 0,
|
||||
+ GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED = GNU_PROPERTY_X86_UINT32_OR_AND_LO + 0,
|
||||
+ GNU_PROPERTY_X86_FEATURE_1_AND = GNU_PROPERTY_X86_UINT32_AND_LO + 0,
|
||||
+ GNU_PROPERTY_X86_ISA_1_NEEDED = GNU_PROPERTY_X86_UINT32_OR_LO + 2,
|
||||
+ GNU_PROPERTY_X86_FEATURE_2_NEEDED = GNU_PROPERTY_X86_UINT32_OR_LO + 1,
|
||||
+ GNU_PROPERTY_X86_ISA_1_USED = GNU_PROPERTY_X86_UINT32_OR_AND_LO + 2,
|
||||
+ GNU_PROPERTY_X86_FEATURE_2_USED = GNU_PROPERTY_X86_UINT32_OR_AND_LO + 1,
|
||||
GNU_PROPERTY_HIPROC = 0xdfffffff,
|
||||
GNU_PROPERTY_LOUSER = 0xe0000000,
|
||||
GNU_PROPERTY_HIUSER = 0xffffffff
|
||||
|
|
@ -1,193 +0,0 @@
|
|||
diff --git a/gold/i386.cc b/gold/i386.cc
|
||||
index bf209fe9a86..31161ff091c 100644
|
||||
--- a/gold/i386.cc
|
||||
+++ b/gold/i386.cc
|
||||
@@ -360,7 +360,11 @@ class Target_i386 : public Sized_target<32, false>
|
||||
got_(NULL), plt_(NULL), got_plt_(NULL), got_irelative_(NULL),
|
||||
got_tlsdesc_(NULL), global_offset_table_(NULL), rel_dyn_(NULL),
|
||||
rel_irelative_(NULL), copy_relocs_(elfcpp::R_386_COPY),
|
||||
- got_mod_index_offset_(-1U), tls_base_symbol_defined_(false)
|
||||
+ got_mod_index_offset_(-1U), tls_base_symbol_defined_(false),
|
||||
+ isa_1_used_(0), isa_1_needed_(0),
|
||||
+ feature_1_(0), feature_2_used_(0), feature_2_needed_(0),
|
||||
+ object_isa_1_used_(0), object_feature_1_(0),
|
||||
+ object_feature_2_used_(0), seen_first_object_(false)
|
||||
{ }
|
||||
|
||||
// Process the relocations to determine unreferenced sections for
|
||||
@@ -859,6 +863,21 @@ class Target_i386 : public Sized_target<32, false>
|
||||
this->rel_dyn_section(layout));
|
||||
}
|
||||
|
||||
+ // Record a target-specific program property in the .note.gnu.property
|
||||
+ // section.
|
||||
+ void
|
||||
+ record_gnu_property(unsigned int, unsigned int, size_t,
|
||||
+ const unsigned char*, const Object*);
|
||||
+
|
||||
+ // Merge the target-specific program properties from the current object.
|
||||
+ void
|
||||
+ merge_gnu_properties(const Object*);
|
||||
+
|
||||
+ // Finalize the target-specific program properties and add them back to
|
||||
+ // the layout.
|
||||
+ void
|
||||
+ do_finalize_gnu_properties(Layout*) const;
|
||||
+
|
||||
// Information about this specific target which we pass to the
|
||||
// general Target structure.
|
||||
static const Target::Target_info i386_info;
|
||||
@@ -898,6 +917,26 @@ class Target_i386 : public Sized_target<32, false>
|
||||
unsigned int got_mod_index_offset_;
|
||||
// True if the _TLS_MODULE_BASE_ symbol has been defined.
|
||||
bool tls_base_symbol_defined_;
|
||||
+
|
||||
+ // Target-specific program properties, from .note.gnu.property section.
|
||||
+ // Each bit represents a specific feature.
|
||||
+ uint32_t isa_1_used_;
|
||||
+ uint32_t isa_1_needed_;
|
||||
+ uint32_t feature_1_;
|
||||
+ uint32_t feature_2_used_;
|
||||
+ uint32_t feature_2_needed_;
|
||||
+ // Target-specific properties from the current object.
|
||||
+ // These bits get ORed into ISA_1_USED_ after all properties for the object
|
||||
+ // have been processed. But if either is all zeroes (as when the property
|
||||
+ // is absent from an object), the result should be all zeroes.
|
||||
+ // (See PR ld/23486.)
|
||||
+ uint32_t object_isa_1_used_;
|
||||
+ // These bits get ANDed into FEATURE_1_ after all properties for the object
|
||||
+ // have been processed.
|
||||
+ uint32_t object_feature_1_;
|
||||
+ uint32_t object_feature_2_used_;
|
||||
+ // Whether we have seen our first object, for use in initializing FEATURE_1_.
|
||||
+ bool seen_first_object_;
|
||||
};
|
||||
|
||||
const Target::Target_info Target_i386::i386_info =
|
||||
@@ -1042,6 +1081,126 @@ Target_i386::rel_irelative_section(Layout* layout)
|
||||
return this->rel_irelative_;
|
||||
}
|
||||
|
||||
+// Record a target-specific program property from the .note.gnu.property
|
||||
+// section.
|
||||
+void
|
||||
+Target_i386::record_gnu_property(
|
||||
+ unsigned int, unsigned int pr_type,
|
||||
+ size_t pr_datasz, const unsigned char* pr_data,
|
||||
+ const Object* object)
|
||||
+{
|
||||
+ uint32_t val = 0;
|
||||
+
|
||||
+ switch (pr_type)
|
||||
+ {
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED:
|
||||
+ if (pr_datasz != 4)
|
||||
+ {
|
||||
+ gold_warning(_("%s: corrupt .note.gnu.property section "
|
||||
+ "(pr_datasz for property %d is not 4)"),
|
||||
+ object->name().c_str(), pr_type);
|
||||
+ return;
|
||||
+ }
|
||||
+ val = elfcpp::Swap<32, false>::readval(pr_data);
|
||||
+ break;
|
||||
+ default:
|
||||
+ gold_warning(_("%s: unknown program property type 0x%x "
|
||||
+ "in .note.gnu.property section"),
|
||||
+ object->name().c_str(), pr_type);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ switch (pr_type)
|
||||
+ {
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
+ this->object_isa_1_used_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED:
|
||||
+ this->isa_1_needed_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND:
|
||||
+ // If we see multiple feature props in one object, OR them together.
|
||||
+ this->object_feature_1_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED:
|
||||
+ this->object_feature_2_used_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED:
|
||||
+ this->feature_2_needed_ |= val;
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+// Merge the target-specific program properties from the current object.
|
||||
+void
|
||||
+Target_i386::merge_gnu_properties(const Object*)
|
||||
+{
|
||||
+ if (this->seen_first_object_)
|
||||
+ {
|
||||
+ // If any object is missing the ISA_1_USED property, we must omit
|
||||
+ // it from the output file.
|
||||
+ if (this->object_isa_1_used_ == 0)
|
||||
+ this->isa_1_used_ = 0;
|
||||
+ else if (this->isa_1_used_ != 0)
|
||||
+ this->isa_1_used_ |= this->object_isa_1_used_;
|
||||
+ this->feature_1_ &= this->object_feature_1_;
|
||||
+ // If any object is missing the FEATURE_2_USED property, we must
|
||||
+ // omit it from the output file.
|
||||
+ if (this->object_feature_2_used_ == 0)
|
||||
+ this->feature_2_used_ = 0;
|
||||
+ else if (this->feature_2_used_ != 0)
|
||||
+ this->feature_2_used_ |= this->object_feature_2_used_;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ this->isa_1_used_ = this->object_isa_1_used_;
|
||||
+ this->feature_1_ = this->object_feature_1_;
|
||||
+ this->feature_2_used_ = this->object_feature_2_used_;
|
||||
+ this->seen_first_object_ = true;
|
||||
+ }
|
||||
+ this->object_isa_1_used_ = 0;
|
||||
+ this->object_feature_1_ = 0;
|
||||
+ this->object_feature_2_used_ = 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+add_property(Layout* layout, unsigned int pr_type, uint32_t val)
|
||||
+{
|
||||
+ unsigned char buf[4];
|
||||
+ elfcpp::Swap<32, false>::writeval(buf, val);
|
||||
+ layout->add_gnu_property(elfcpp::NT_GNU_PROPERTY_TYPE_0, pr_type, 4, buf);
|
||||
+}
|
||||
+
|
||||
+// Finalize the target-specific program properties and add them back to
|
||||
+// the layout.
|
||||
+void
|
||||
+Target_i386::do_finalize_gnu_properties(Layout* layout) const
|
||||
+{
|
||||
+ if (this->isa_1_used_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_ISA_1_USED,
|
||||
+ this->isa_1_used_);
|
||||
+ if (this->isa_1_needed_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED,
|
||||
+ this->isa_1_needed_);
|
||||
+ if (this->feature_1_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND,
|
||||
+ this->feature_1_);
|
||||
+ if (this->feature_2_used_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED,
|
||||
+ this->feature_2_used_);
|
||||
+ if (this->feature_2_needed_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED,
|
||||
+ this->feature_2_needed_);
|
||||
+}
|
||||
+
|
||||
// Write the first three reserved words of the .got.plt section.
|
||||
// The remainder of the section is written while writing the PLT
|
||||
// in Output_data_plt_i386::do_write.
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
diff -rup binutils.orig/gold/options.h binutils-2.41/gold/options.h
|
||||
--- binutils.orig/gold/options.h 2024-01-04 09:52:09.282002253 +0000
|
||||
+++ binutils-2.41/gold/options.h 2024-01-04 09:52:51.890972630 +0000
|
||||
@@ -855,6 +855,12 @@ class General_options
|
||||
N_("(ARM only) Do not warn about objects with incompatible "
|
||||
"enum sizes"));
|
||||
|
||||
+ DEFINE_bool_ignore(error_execstack, options::TWO_DASHES, '\0',
|
||||
+ N_("Ignored"), N_("Ignored"));
|
||||
+
|
||||
+ DEFINE_bool_ignore(error_rwx_segments, options::TWO_DASHES, '\0',
|
||||
+ N_("Ignored"), N_("Ignored"));
|
||||
+
|
||||
DEFINE_special(exclude_libs, options::TWO_DASHES, '\0',
|
||||
N_("Exclude libraries from automatic export"),
|
||||
N_(("lib,lib ...")));
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
diff --git a/gold/options.cc b/gold/options.cc
|
||||
index c9834b66159..91d7802fffe 100644
|
||||
--- a/gold/options.cc
|
||||
+++ b/gold/options.cc
|
||||
@@ -989,7 +989,7 @@ parse_short_option(int argc, const char** argv, int pos_in_argv_i,
|
||||
}
|
||||
|
||||
// If we're a -z option, we need to parse our argument as a
|
||||
- // long-option, e.g. "-z stacksize=8192".
|
||||
+ // long-option, e.g. "-z stack-size=8192".
|
||||
if (retval == &dash_z)
|
||||
{
|
||||
int dummy_i = 0;
|
||||
diff --git a/gold/options.h b/gold/options.h
|
||||
index 46f658f23ea..d16e38066da 100644
|
||||
--- a/gold/options.h
|
||||
+++ b/gold/options.h
|
||||
@@ -1110,6 +1110,9 @@ class General_options
|
||||
N_("Generate package metadata note"),
|
||||
N_("[=JSON]"));
|
||||
|
||||
+ DEFINE_bool_ignore(pack_relative_relocs, options::DASH_Z, '\0',
|
||||
+ N_("Ignored"), N_("Ignored"));
|
||||
+
|
||||
DEFINE_bool(pie, options::ONE_DASH, '\0', false,
|
||||
N_("Create a position independent executable"),
|
||||
N_("Do not create a position independent executable"));
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
# The gold linker does not build if the target list includes s390x-linux
|
||||
# but does not include s390-linux. ie it needs the 32-bit target to be
|
||||
# enabled in order for the 64-bit target to work. On the other hand the
|
||||
# BFD library does not support the 32-bit s390 target. So this patch
|
||||
# "enhances" the gold configure script so that if s390x is listed, the
|
||||
# s390 target will automatically be added to the list as well.
|
||||
|
||||
diff -upr orig/gold/configure binutils-2.47/gold/configure
|
||||
--- orig/gold/configure 2026-07-27 09:38:54.907192013 +0100
|
||||
+++ binutils-2.47/gold/configure 2026-07-27 10:12:02.759629540 +0100
|
||||
@@ -5223,7 +5223,12 @@ if test -n "$enable_targets"; then
|
||||
for targ in `echo $enable_targets | sed -e 's/,/ /g'`; do
|
||||
result=`$ac_config_sub $targ 2>/dev/null`
|
||||
if test -n "$result"; then
|
||||
- canon_targets="$canon_targets $result"
|
||||
+ canon_targets="$canon_targets $result" ;
|
||||
+ case "$result" in
|
||||
+ s390x-*)
|
||||
+ canon_targets="$canon_targets s390-gnu-linux"
|
||||
+ ;;
|
||||
+ esac
|
||||
else
|
||||
# Permit unrecognized target names, like "all".
|
||||
canon_targets="$canon_targets $targ"
|
||||
diff -upr orig/gold/configure.ac binutils-2.47/gold/configure.ac
|
||||
--- orig/gold/configure.ac 2026-07-27 09:38:54.907192013 +0100
|
||||
+++ binutils-2.47/gold/configure.ac 2026-07-27 10:18:18.480766140 +0100
|
||||
@@ -133,6 +133,12 @@ if test -n "$enable_targets"; then
|
||||
result=`$ac_config_sub $targ 2>/dev/null`
|
||||
if test -n "$result"; then
|
||||
canon_targets="$canon_targets $result"
|
||||
+ # Hack: Enable the s390-linux target if s390x-linux is enabled.
|
||||
+ case "$result" in
|
||||
+ s390x-*)
|
||||
+ canon_targets="$canon_targets s390-gnu-linux"
|
||||
+ ;;
|
||||
+ esac
|
||||
else
|
||||
# Permit unrecognized target names, like "all".
|
||||
canon_targets="$canon_targets $targ"
|
||||
|
|
@ -24,6 +24,26 @@ diff -rup binutils.orig/gold/configure.ac binutils-2.34/gold/configure.ac
|
|||
else
|
||||
targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
|
||||
if test "$targ_extra_obj" != ""; then
|
||||
--- binutils.orig/ld/configure.tgt 2020-04-20 12:35:12.465301359 +0100
|
||||
+++ binutils-2.34/ld/configure.tgt 2020-04-20 14:17:52.123066333 +0100
|
||||
@@ -220,7 +220,7 @@ bfin-*-linux-uclibc*) targ_emul=elf32bfi
|
||||
targ_extra_emuls="elf32bfin"
|
||||
targ_extra_libpath=$targ_extra_emuls
|
||||
;;
|
||||
-bpf-*-*) targ_emul=elf64bpf
|
||||
+bpf-* | bpf-*-*) targ_emul=elf64bpf
|
||||
;;
|
||||
cr16-*-elf*) targ_emul=elf32cr16
|
||||
;;
|
||||
@@ -1026,7 +1026,7 @@ z8k-*-coff) targ_emul=z8002
|
||||
targ_extra_ofiles=
|
||||
;;
|
||||
*)
|
||||
- echo 2>&1 "*** ld does not support target ${targ}"
|
||||
+ echo 2>&1 "*** ld does not support target '${targ}' NO REALLY"
|
||||
echo 2>&1 "*** see ld/configure.tgt for supported targets"
|
||||
exit 1
|
||||
|
||||
--- binutils.orig/bfd/config.bfd 2020-04-20 12:35:13.038297375 +0100
|
||||
+++ binutils-2.34/bfd/config.bfd 2020-04-20 14:25:26.452869193 +0100
|
||||
@@ -473,7 +473,7 @@ case "${targ}" in
|
||||
|
|
@ -35,14 +55,12 @@ diff -rup binutils.orig/gold/configure.ac binutils-2.34/gold/configure.ac
|
|||
targ_defvec=bpf_elf64_le_vec
|
||||
targ_selvecs=bpf_elf64_be_vec
|
||||
targ_underscore=yes
|
||||
--- binutils.orig/ld/configure.tgt 2026-01-05 08:51:02.908224792 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/configure.tgt 2026-01-05 08:51:55.852677409 +0000
|
||||
@@ -255,7 +255,7 @@ bfin-*-uclinux*) targ_emul=elf32bfin;
|
||||
bfin-*-linux-uclibc*) targ_emul=elf32bfinfd;
|
||||
targ_extra_libpath=elf32bfin
|
||||
;;
|
||||
-bpf-*-*) targ_emul=elf64bpf
|
||||
+bpf-* | bpf-*-*) targ_emul=elf64bpf
|
||||
;;
|
||||
cr16-*-elf*) targ_emul=elf32cr16
|
||||
;;
|
||||
@@ -1427,7 +1427,7 @@ case "${targ}" in
|
||||
;;
|
||||
|
||||
*)
|
||||
- echo 1>&2 "*** BFD does not support target ${targ}."
|
||||
+ echo 1>&2 "*** BFD does not support target '${targ}'. Honest."
|
||||
echo 1>&2 "*** Look in bfd/config.bfd for supported targets."
|
||||
exit 1
|
||||
;;
|
||||
|
|
|
|||
60
binutils-ld-DWARF-5-sections.patch
Normal file
60
binutils-ld-DWARF-5-sections.patch
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
--- binutils.orig/ld/scripttempl/DWARF.sc 2021-02-01 10:29:33.596729908 +0000
|
||||
+++ binutils-2.35.1/ld/scripttempl/DWARF.sc 2021-02-01 10:30:00.454552083 +0000
|
||||
@@ -1,4 +1,4 @@
|
||||
-# Copyright (C) 2014-2020 Free Software Foundation, Inc.
|
||||
+# Copyright (C) 2014-2021 Free Software Foundation, Inc.
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification,
|
||||
# are permitted in any medium without royalty provided the copyright
|
||||
@@ -9,19 +9,19 @@ cat <<EOF
|
||||
Symbols in the DWARF debugging sections are relative to the beginning
|
||||
of the section so we begin them at 0. */
|
||||
|
||||
- /* DWARF 1 */
|
||||
+ /* DWARF 1. */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
|
||||
- /* GNU DWARF 1 extensions */
|
||||
+ /* GNU DWARF 1 extensions. */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
|
||||
- /* DWARF 1.1 and DWARF 2 */
|
||||
+ /* DWARF 1.1 and DWARF 2. */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
|
||||
- /* DWARF 2 */
|
||||
+ /* DWARF 2. */
|
||||
.debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line${RELOCATING+ .debug_line.* .debug_line_end}) }
|
||||
@@ -30,17 +30,23 @@ cat <<EOF
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
|
||||
- /* SGI/MIPS DWARF 2 extensions */
|
||||
+ /* SGI/MIPS DWARF 2 extensions. */
|
||||
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
|
||||
- /* DWARF 3 */
|
||||
+ /* DWARF 3. */
|
||||
.debug_pubtypes 0 : { *(.debug_pubtypes) }
|
||||
.debug_ranges 0 : { *(.debug_ranges) }
|
||||
|
||||
- /* DWARF Extension. */
|
||||
- .debug_macro 0 : { *(.debug_macro) }
|
||||
+ /* DWARF 5. */
|
||||
.debug_addr 0 : { *(.debug_addr) }
|
||||
+ .debug_line_str 0 : { *(.debug_line_str) }
|
||||
+ .debug_loclists 0 : { *(.debug_loclists) }
|
||||
+ .debug_macro 0 : { *(.debug_macro) }
|
||||
+ .debug_names 0 : { *(.debug_names) }
|
||||
+ .debug_rnglists 0 : { *(.debug_rnglists) }
|
||||
+ .debug_str_offsets 0 : { *(.debug_str_offsets) }
|
||||
+ .debug_sup 0 : { *(.debug_sup) }
|
||||
EOF
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
diff -rup binutils.orig/bfd/elflink.c binutils-with-gold-2.45.50-be970c68891/bfd/elflink.c
|
||||
--- binutils.orig/bfd/elflink.c 2026-01-14 09:21:14.835847967 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/bfd/elflink.c 2026-01-14 09:23:48.780495205 +0000
|
||||
@@ -13786,7 +13786,7 @@ _bfd_elf_final_link (bfd *abfd, struct b
|
||||
{
|
||||
if (info->textrel_check == textrel_check_error)
|
||||
info->callbacks->einfo
|
||||
- (_("%P%X: read-only segment has dynamic relocations\n"));
|
||||
+ (_("%P%X: error: read-only segment has dynamic relocations\n"));
|
||||
else if (bfd_link_dll (info))
|
||||
info->callbacks->einfo
|
||||
(_("%P: warning: creating DT_TEXTREL in a shared object\n"));
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-mode.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-mode.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-mode.d 2026-01-14 09:21:15.248851537 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-mode.d 2026-01-14 09:22:24.603416270 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: dt-memtag.s
|
||||
-#ld: -shared -z memtag-mode=async
|
||||
+#ld: -shared -z memtag-mode=async -z notext
|
||||
#readelf: -d
|
||||
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-stack.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-stack.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-stack.d 2026-01-14 09:21:15.248851537 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-stack.d 2026-01-14 09:24:19.594780414 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: dt-memtag.s
|
||||
-#ld: -shared -z memtag-stack
|
||||
+#ld: -shared -z memtag-stack -z notext
|
||||
#readelf: -d
|
||||
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/relr-text-pie.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-pie.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/relr-text-pie.d 2026-01-14 09:21:15.246851520 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-pie.d 2026-01-14 09:24:45.363485698 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: relr-text.s
|
||||
-#ld: -pie -z pack-relative-relocs -T relocs.ld
|
||||
+#ld: -pie -z pack-relative-relocs -T relocs.ld -z notext
|
||||
#readelf: -drW
|
||||
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/relr-text-shared.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-shared.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/relr-text-shared.d 2026-01-14 09:21:15.246851520 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-shared.d 2026-01-14 09:25:06.651664713 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: relr-text.s
|
||||
-#ld: -shared -z pack-relative-relocs -T relocs.ld
|
||||
+#ld: -shared -z pack-relative-relocs -T relocs.ld -z notext
|
||||
#readelf: -drW
|
||||
|
||||
#...
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
diff -rup binutils.orig/ltmain.sh binutils-2.37/ltmain.sh
|
||||
--- binutils.orig/ltmain.sh 2022-01-27 16:23:09.304207432 +0000
|
||||
+++ binutils-2.37/ltmain.sh 2022-01-27 16:23:18.380143759 +0000
|
||||
@@ -7103,6 +7103,7 @@ EOF
|
||||
rpath="$finalize_rpath"
|
||||
test "$mode" != relink && rpath="$compile_rpath$rpath"
|
||||
for libdir in $rpath; do
|
||||
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
|
||||
if test -n "$hardcode_libdir_flag_spec"; then
|
||||
if test -n "$hardcode_libdir_separator"; then
|
||||
if test -z "$hardcode_libdirs"; then
|
||||
@@ -7798,6 +7799,7 @@ EOF
|
||||
rpath=
|
||||
hardcode_libdirs=
|
||||
for libdir in $compile_rpath $finalize_rpath; do
|
||||
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
|
||||
if test -n "$hardcode_libdir_flag_spec"; then
|
||||
if test -n "$hardcode_libdir_separator"; then
|
||||
if test -z "$hardcode_libdirs"; then
|
||||
@@ -7849,6 +7851,7 @@ EOF
|
||||
rpath=
|
||||
hardcode_libdirs=
|
||||
for libdir in $finalize_rpath; do
|
||||
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
|
||||
if test -n "$hardcode_libdir_flag_spec"; then
|
||||
if test -n "$hardcode_libdir_separator"; then
|
||||
if test -z "$hardcode_libdirs"; then
|
||||
Only in binutils-2.37: ltmain.sh.orig
|
||||
182
binutils-plugin-as-needed.patch
Normal file
182
binutils-plugin-as-needed.patch
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
--- binutils.orig/bfd/elflink.c 2020-11-03 11:59:59.966565009 +0000
|
||||
+++ binutils-2.35.1/bfd/elflink.c 2020-11-03 12:07:34.691991602 +0000
|
||||
@@ -4477,7 +4477,12 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||
h = (struct elf_link_hash_entry *) p;
|
||||
entsize += htab->root.table.entsize;
|
||||
if (h->root.type == bfd_link_hash_warning)
|
||||
- entsize += htab->root.table.entsize;
|
||||
+ {
|
||||
+ entsize += htab->root.table.entsize;
|
||||
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
+ }
|
||||
+ if (h->root.type == bfd_link_hash_common)
|
||||
+ entsize += sizeof (*h->root.u.c.p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4521,14 +4526,20 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||
|
||||
for (p = htab->root.table.table[i]; p != NULL; p = p->next)
|
||||
{
|
||||
- memcpy (old_ent, p, htab->root.table.entsize);
|
||||
- old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||
h = (struct elf_link_hash_entry *) p;
|
||||
+ memcpy (old_ent, h, htab->root.table.entsize);
|
||||
+ old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||
if (h->root.type == bfd_link_hash_warning)
|
||||
{
|
||||
- memcpy (old_ent, h->root.u.i.link, htab->root.table.entsize);
|
||||
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
+ memcpy (old_ent, h, htab->root.table.entsize);
|
||||
old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||
}
|
||||
+ if (h->root.type == bfd_link_hash_common)
|
||||
+ {
|
||||
+ memcpy (old_ent, h->root.u.c.p, sizeof (*h->root.u.c.p));
|
||||
+ old_ent = (char *) old_ent + sizeof (*h->root.u.c.p);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4899,7 +4910,8 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||
}
|
||||
|
||||
if (! (_bfd_generic_link_add_one_symbol
|
||||
- (info, abfd, name, flags, sec, value, NULL, FALSE, bed->collect,
|
||||
+ (info, abfd, name, flags, sec, value,
|
||||
+ NULL, FALSE, bed->collect,
|
||||
(struct bfd_link_hash_entry **) sym_hash)))
|
||||
goto error_free_vers;
|
||||
|
||||
@@ -4970,11 +4982,10 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||
object and a shared object. */
|
||||
bfd_boolean dynsym = FALSE;
|
||||
|
||||
- /* Plugin symbols aren't normal. Don't set def_regular or
|
||||
- ref_regular for them, or make them dynamic. */
|
||||
+ /* Plugin symbols aren't normal. Don't set def/ref flags. */
|
||||
if ((abfd->flags & BFD_PLUGIN) != 0)
|
||||
;
|
||||
- else if (! dynamic)
|
||||
+ else if (!dynamic)
|
||||
{
|
||||
if (! definition)
|
||||
{
|
||||
@@ -4991,14 +5002,6 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||
h->ref_dynamic = 1;
|
||||
}
|
||||
}
|
||||
-
|
||||
- /* If the indirect symbol has been forced local, don't
|
||||
- make the real symbol dynamic. */
|
||||
- if ((h == hi || !hi->forced_local)
|
||||
- && (bfd_link_dll (info)
|
||||
- || h->def_dynamic
|
||||
- || h->ref_dynamic))
|
||||
- dynsym = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5012,14 +5015,25 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||
h->def_dynamic = 1;
|
||||
hi->def_dynamic = 1;
|
||||
}
|
||||
+ }
|
||||
|
||||
- /* If the indirect symbol has been forced local, don't
|
||||
- make the real symbol dynamic. */
|
||||
- if ((h == hi || !hi->forced_local)
|
||||
- && (h->def_regular
|
||||
- || h->ref_regular
|
||||
- || (h->is_weakalias
|
||||
- && weakdef (h)->dynindx != -1)))
|
||||
+ /* If an indirect symbol has been forced local, don't
|
||||
+ make the real symbol dynamic. */
|
||||
+ if (h != hi && hi->forced_local)
|
||||
+ ;
|
||||
+ else if (!dynamic)
|
||||
+ {
|
||||
+ if (bfd_link_dll (info)
|
||||
+ || h->def_dynamic
|
||||
+ || h->ref_dynamic)
|
||||
+ dynsym = TRUE;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (h->def_regular
|
||||
+ || h->ref_regular
|
||||
+ || (h->is_weakalias
|
||||
+ && weakdef (h)->dynindx != -1))
|
||||
dynsym = TRUE;
|
||||
}
|
||||
|
||||
@@ -5214,6 +5228,9 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||
&& definition
|
||||
&& ((dynsym
|
||||
&& h->ref_regular_nonweak)
|
||||
+ || (old_bfd != NULL
|
||||
+ && (old_bfd->flags & BFD_PLUGIN) != 0
|
||||
+ && bind != STB_WEAK)
|
||||
|| (h->ref_dynamic_nonweak
|
||||
&& (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0
|
||||
&& !on_needed_list (elf_dt_name (abfd),
|
||||
@@ -5338,49 +5355,31 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||
{
|
||||
struct bfd_hash_entry *p;
|
||||
struct elf_link_hash_entry *h;
|
||||
- bfd_size_type size;
|
||||
- unsigned int alignment_power;
|
||||
unsigned int non_ir_ref_dynamic;
|
||||
|
||||
for (p = htab->root.table.table[i]; p != NULL; p = p->next)
|
||||
{
|
||||
- h = (struct elf_link_hash_entry *) p;
|
||||
- if (h->root.type == bfd_link_hash_warning)
|
||||
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
-
|
||||
- /* Preserve the maximum alignment and size for common
|
||||
- symbols even if this dynamic lib isn't on DT_NEEDED
|
||||
- since it can still be loaded at run time by another
|
||||
- dynamic lib. */
|
||||
- if (h->root.type == bfd_link_hash_common)
|
||||
- {
|
||||
- size = h->root.u.c.size;
|
||||
- alignment_power = h->root.u.c.p->alignment_power;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- size = 0;
|
||||
- alignment_power = 0;
|
||||
- }
|
||||
/* Preserve non_ir_ref_dynamic so that this symbol
|
||||
will be exported when the dynamic lib becomes needed
|
||||
in the second pass. */
|
||||
+ h = (struct elf_link_hash_entry *) p;
|
||||
+ if (h->root.type == bfd_link_hash_warning)
|
||||
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
non_ir_ref_dynamic = h->root.non_ir_ref_dynamic;
|
||||
- memcpy (p, old_ent, htab->root.table.entsize);
|
||||
- old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||
+
|
||||
h = (struct elf_link_hash_entry *) p;
|
||||
+ memcpy (h, old_ent, htab->root.table.entsize);
|
||||
+ old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||
if (h->root.type == bfd_link_hash_warning)
|
||||
{
|
||||
- memcpy (h->root.u.i.link, old_ent, htab->root.table.entsize);
|
||||
- old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
+ memcpy (h, old_ent, htab->root.table.entsize);
|
||||
+ old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||
}
|
||||
if (h->root.type == bfd_link_hash_common)
|
||||
{
|
||||
- if (size > h->root.u.c.size)
|
||||
- h->root.u.c.size = size;
|
||||
- if (alignment_power > h->root.u.c.p->alignment_power)
|
||||
- h->root.u.c.p->alignment_power = alignment_power;
|
||||
+ memcpy (h->root.u.c.p, old_ent, sizeof (*h->root.u.c.p));
|
||||
+ old_ent = (char *) old_ent + sizeof (*h->root.u.c.p);
|
||||
}
|
||||
h->root.non_ir_ref_dynamic = non_ir_ref_dynamic;
|
||||
}
|
||||
39
binutils-ppc-annobin-disassembly.patch
Normal file
39
binutils-ppc-annobin-disassembly.patch
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
--- binutils.orig/opcodes/ppc-dis.c 2020-09-11 10:55:56.243724026 +0100
|
||||
+++ binutils-2.35/opcodes/ppc-dis.c 2020-09-11 10:57:51.363934217 +0100
|
||||
@@ -399,12 +399,36 @@ static unsigned short vle_opcd_indices[V
|
||||
#define SPE2_OPCD_SEGS (1 + SPE2_XOP_TO_SEG (SPE2_XOP (-1)))
|
||||
static unsigned short spe2_opcd_indices[SPE2_OPCD_SEGS + 1];
|
||||
|
||||
+static bfd_boolean
|
||||
+ppc_symbol_is_valid (asymbol *sym,
|
||||
+ struct disassemble_info *info ATTRIBUTE_UNUSED)
|
||||
+{
|
||||
+ elf_symbol_type * est;
|
||||
+
|
||||
+ if (sym == NULL)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ est = elf_symbol_from (NULL, sym);
|
||||
+
|
||||
+ /* Ignore ELF hidden, local, no-type symbols.
|
||||
+ These are generated by annobin. */
|
||||
+ if (est != NULL
|
||||
+ && ELF_ST_VISIBILITY (est->internal_elf_sym.st_other) == STV_HIDDEN
|
||||
+ && ELF_ST_BIND (est->internal_elf_sym.st_info) == STB_LOCAL
|
||||
+ && ELF_ST_TYPE (est->internal_elf_sym.st_info) == STT_NOTYPE)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
/* Calculate opcode table indices to speed up disassembly,
|
||||
and init dialect. */
|
||||
|
||||
void
|
||||
disassemble_init_powerpc (struct disassemble_info *info)
|
||||
{
|
||||
+ info->symbol_is_valid = ppc_symbol_is_valid;
|
||||
+
|
||||
if (powerpc_opcd_indices[PPC_OPCD_SEGS] == 0)
|
||||
{
|
||||
unsigned seg, idx, op;
|
||||
42
binutils-ppc64le-note-merge.patch
Normal file
42
binutils-ppc64le-note-merge.patch
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
--- binutils.orig/binutils/objcopy.c 2021-02-18 11:35:48.062479490 +0000
|
||||
+++ binutils-2.30/binutils/objcopy.c 2021-02-18 11:36:52.207071148 +0000
|
||||
@@ -2224,6 +2224,11 @@ merge_gnu_build_notes (bfd * ab
|
||||
goto done;
|
||||
}
|
||||
|
||||
+ if (start > end)
|
||||
+ /* This can happen with PPC64LE binaries where empty notes are
|
||||
+ encoded as start = end + 4. */
|
||||
+ start = end;
|
||||
+
|
||||
if (is_open_note (pnote))
|
||||
{
|
||||
if (start)
|
||||
--- binutils.orig/binutils/objcopy.c 2021-02-22 10:44:20.107263089 +0000
|
||||
+++ binutils-2.35.1/binutils/objcopy.c 2021-02-22 16:07:12.134344229 +0000
|
||||
@@ -2243,23 +2243,8 @@ merge_gnu_build_notes (bfd * ab
|
||||
break;
|
||||
|
||||
case 8:
|
||||
- if (! is_64bit (abfd))
|
||||
- {
|
||||
- start = bfd_get_32 (abfd, pnote->note.descdata);
|
||||
- end = bfd_get_32 (abfd, pnote->note.descdata + 4);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- start = bfd_get_64 (abfd, pnote->note.descdata);
|
||||
- /* FIXME: For version 1 and 2 notes we should try to
|
||||
- calculate the end address by finding a symbol whose
|
||||
- value is START, and then adding in its size.
|
||||
-
|
||||
- For now though, since v1 and v2 was not intended to
|
||||
- handle gaps, we chose an artificially large end
|
||||
- address. */
|
||||
- end = (bfd_vma) -1;
|
||||
- }
|
||||
+ start = bfd_get_32 (abfd, pnote->note.descdata);
|
||||
+ end = bfd_get_32 (abfd, pnote->note.descdata + 4);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
19
binutils-readelf-no-warn-gaps.patch
Normal file
19
binutils-readelf-no-warn-gaps.patch
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
--- binutils.orig/binutils/readelf.c 2021-02-22 10:44:20.142262864 +0000
|
||||
+++ binutils-2.35.1/binutils/readelf.c 2021-02-22 10:45:25.646842120 +0000
|
||||
@@ -19285,6 +19285,7 @@ print_gnu_build_attribute_description (E
|
||||
|
||||
if (is_open_attr)
|
||||
{
|
||||
+#if 0 /* Suppressed because these gaps are no longer significant. */
|
||||
/* FIXME: Need to properly allow for section alignment.
|
||||
16 is just the alignment used on x86_64. */
|
||||
if (global_end > 0
|
||||
@@ -19295,7 +19296,7 @@ print_gnu_build_attribute_description (E
|
||||
&& same_section (filedata, start, global_end))
|
||||
warn (_("Gap in build notes detected from %#lx to %#lx\n"),
|
||||
global_end + 1, start - 1);
|
||||
-
|
||||
+#endif
|
||||
printf (_(" Applies to region from %#lx"), start);
|
||||
global_offset = start;
|
||||
|
||||
35
binutils-readelf-other-sym-info.patch
Normal file
35
binutils-readelf-other-sym-info.patch
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
--- 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
|
||||
109
binutils-recursive-debuglink-following.patch
Normal file
109
binutils-recursive-debuglink-following.patch
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
--- binutils.orig/binutils/dwarf.c 2020-10-15 12:13:21.960799738 +0100
|
||||
+++ binutils-2.35.1/binutils/dwarf.c 2020-10-15 13:02:39.454692627 +0100
|
||||
@@ -10427,7 +10427,7 @@ load_separate_debug_info (const char *
|
||||
{
|
||||
warn (_("Corrupt debuglink section: %s\n"),
|
||||
xlink->name ? xlink->name : xlink->uncompressed_name);
|
||||
- return FALSE;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
/* Attempt to locate the separate file.
|
||||
@@ -10587,7 +10587,7 @@ load_separate_debug_info (const char *
|
||||
{
|
||||
warn (_("failed to open separate debug file: %s\n"), debug_filename);
|
||||
free (debug_filename);
|
||||
- return FALSE;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
/* FIXME: We do not check to see if there are any other separate debug info
|
||||
@@ -10632,6 +10632,52 @@ load_dwo_file (const char * main_filenam
|
||||
return separate_handle;
|
||||
}
|
||||
|
||||
+/* Load a debuglink section and/or a debugaltlink section, if either are present.
|
||||
+ Recursively check the loaded files for more of these sections.
|
||||
+ FIXME: Should also check for DWO_* entries in the newlu loaded files. */
|
||||
+
|
||||
+static void
|
||||
+check_for_and_load_links (void * file, const char * filename)
|
||||
+{
|
||||
+ void * handle = NULL;
|
||||
+
|
||||
+ if (load_debug_section (gnu_debugaltlink, file))
|
||||
+ {
|
||||
+ Build_id_data build_id_data;
|
||||
+
|
||||
+ handle = load_separate_debug_info (filename,
|
||||
+ & debug_displays[gnu_debugaltlink].section,
|
||||
+ parse_gnu_debugaltlink,
|
||||
+ check_gnu_debugaltlink,
|
||||
+ & build_id_data,
|
||||
+ file);
|
||||
+ if (handle)
|
||||
+ {
|
||||
+ assert (handle == first_separate_info->handle);
|
||||
+ check_for_and_load_links (first_separate_info->handle,
|
||||
+ first_separate_info->filename);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (load_debug_section (gnu_debuglink, file))
|
||||
+ {
|
||||
+ unsigned long crc32;
|
||||
+
|
||||
+ handle = load_separate_debug_info (filename,
|
||||
+ & debug_displays[gnu_debuglink].section,
|
||||
+ parse_gnu_debuglink,
|
||||
+ check_gnu_debuglink,
|
||||
+ & crc32,
|
||||
+ file);
|
||||
+ if (handle)
|
||||
+ {
|
||||
+ assert (handle == first_separate_info->handle);
|
||||
+ check_for_and_load_links (first_separate_info->handle,
|
||||
+ first_separate_info->filename);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* Load the separate debug info file(s) attached to FILE, if any exist.
|
||||
Returns TRUE if any were found, FALSE otherwise.
|
||||
If TRUE is returned then the linked list starting at first_separate_info
|
||||
@@ -10707,34 +10753,10 @@ load_separate_debug_files (void * file,
|
||||
return FALSE;
|
||||
|
||||
/* FIXME: We do not check for the presence of both link sections in the same file. */
|
||||
- /* FIXME: We do not check the separate debug info file to see if it too contains debuglinks. */
|
||||
/* FIXME: We do not check for the presence of multiple, same-name debuglink sections. */
|
||||
/* FIXME: We do not check for the presence of a dwo link as well as a debuglink. */
|
||||
|
||||
- if (load_debug_section (gnu_debugaltlink, file))
|
||||
- {
|
||||
- Build_id_data * build_id_data;
|
||||
-
|
||||
- load_separate_debug_info (filename,
|
||||
- & debug_displays[gnu_debugaltlink].section,
|
||||
- parse_gnu_debugaltlink,
|
||||
- check_gnu_debugaltlink,
|
||||
- & build_id_data,
|
||||
- file);
|
||||
- }
|
||||
-
|
||||
- if (load_debug_section (gnu_debuglink, file))
|
||||
- {
|
||||
- unsigned long crc32;
|
||||
-
|
||||
- load_separate_debug_info (filename,
|
||||
- & debug_displays[gnu_debuglink].section,
|
||||
- parse_gnu_debuglink,
|
||||
- check_gnu_debuglink,
|
||||
- & crc32,
|
||||
- file);
|
||||
- }
|
||||
-
|
||||
+ check_for_and_load_links (file, filename);
|
||||
if (first_separate_info != NULL)
|
||||
return TRUE;
|
||||
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-with-gold-2.45.50-96b8a8a633a/ld/testsuite/ld-x86-64/x86-64.exp
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2025-11-20 12:02:23.738336155 +0000
|
||||
+++ binutils-with-gold-2.45.50-96b8a8a633a/ld/testsuite/ld-x86-64/x86-64.exp 2025-11-20 12:03:17.894485264 +0000
|
||||
@@ -1413,14 +1413,6 @@ if { [isnative] && [check_compiler_avail
|
||||
"libprotected-func-2b.so" \
|
||||
] \
|
||||
[list \
|
||||
- "Build protected-func-2 without PIE" \
|
||||
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2b.so" \
|
||||
- "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
|
||||
- { protected-func-1b.c } \
|
||||
- {} \
|
||||
- "protected-func-2" \
|
||||
- ] \
|
||||
- [list \
|
||||
"Build libprotected-func-2c.so" \
|
||||
"-shared" \
|
||||
"-fPIC -Wa,-mx86-used-note=yes" \
|
||||
@@ -1429,14 +1421,6 @@ if { [isnative] && [check_compiler_avail
|
||||
"libprotected-func-2c.so" \
|
||||
] \
|
||||
[list \
|
||||
- "Build protected-func-2a without PIE" \
|
||||
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2c.so" \
|
||||
- "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
|
||||
- { protected-func-1b.c } \
|
||||
- {} \
|
||||
- "protected-func-2a" \
|
||||
- ] \
|
||||
- [list \
|
||||
"Build libprotected-data-1a.so" \
|
||||
"-shared -z noindirect-extern-access" \
|
||||
"-fPIC -Wa,-mx86-used-note=yes" \
|
||||
|
|
@ -1,269 +0,0 @@
|
|||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:11:38.656875289 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:49:26.786573665 +0000
|
||||
@@ -12,8 +12,8 @@ Program Headers:
|
||||
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
|
||||
RISCV_ATTRIBUT .*
|
||||
LOAD .*
|
||||
-
|
||||
+#...
|
||||
Section to Segment mapping:
|
||||
Segment Sections...
|
||||
00 .riscv.attributes
|
||||
- 01 .text
|
||||
+#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:11:38.659875285 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:42:54.803431287 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:11:38.659875285 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:43:49.540306593 +0000
|
||||
@@ -11,5 +11,5 @@ Disassembly of section .text:
|
||||
[0-9a-f]+ <_start>:
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,gp.*<data_a>
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1.*<data_b>
|
||||
+.*:[ ]+[0-9a-f]+[ ]+mv[ ]+a1,a1
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:11:38.659875285 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:46:55.570899994 +0000
|
||||
@@ -2,4 +2,5 @@
|
||||
#source: pcrel-lo-addend-2a.s
|
||||
#as: -march=rv32ic
|
||||
#ld: -m[riscv_choose_ilp32_emul] --no-relax
|
||||
+#skip: *-*-*
|
||||
#error: .*dangerous relocation: %pcrel_lo overflow with an addend, the value of %pcrel_hi is 0x1000 without any addend, but may be 0x2000 after adding the %pcrel_lo addend
|
||||
diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf.exp binutils-2.40/ld/testsuite/ld-elf/dwarf.exp
|
||||
--- binutils.orig/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 10:11:38.515875516 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 11:08:52.209377332 +0000
|
||||
@@ -29,6 +29,10 @@ if ![is_elf_format] {
|
||||
return
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
# Skip targets where -shared is not supported
|
||||
|
||||
if ![check_shared_lib_support] {
|
||||
diff -rup binutils.orig/ld/testsuite/ld-elf/tls.exp binutils-2.40/ld/testsuite/ld-elf/tls.exp
|
||||
--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2023-02-16 10:11:38.540875476 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-elf/tls.exp 2023-02-16 11:08:56.944369374 +0000
|
||||
@@ -28,6 +28,10 @@ if { !([istarget *-*-linux*]
|
||||
return
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
# Check to see if the C compiler works.
|
||||
if { ![check_compiler_available] } {
|
||||
return
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2023-08-24 07:48:30.429195480 +0100
|
||||
+++ binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp 2023-08-24 07:57:05.535302711 +0100
|
||||
@@ -1409,6 +1409,8 @@ proc objcopy_test_without_global_symbol
|
||||
# The AArch64 and ARM targets preserve mapping symbols
|
||||
# in object files, so they will fail this test.
|
||||
setup_xfail aarch64*-*-* arm*-*-*
|
||||
+# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
+setup_xfail riscv*-*-*
|
||||
|
||||
objcopy_test_without_global_symbol
|
||||
|
||||
--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2023-08-24 07:48:31.808196076 +0100
|
||||
+++ binutils-2.41/ld/testsuite/ld-plugin/plugin.exp 2023-08-24 07:59:30.285716568 +0100
|
||||
@@ -132,6 +132,10 @@ if [is_pecoff_format] {
|
||||
append libs " --image-base=0x10000000"
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
set plugin_tests [list \
|
||||
[list "load plugin" "-plugin $plugin_path \
|
||||
$testobjfiles $libs" "" "" "" {{ld plugin-1.d}} "main.x" ] \
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/compress.exp 2023-12-11 10:09:16.923374463 +0000
|
||||
+++ binutils-2.41/binutils/testsuite/binutils-all/compress.exp 2023-12-12 09:00:15.150036675 +0000
|
||||
@@ -818,6 +818,10 @@ proc test_gnu_debuglink {} {
|
||||
}
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
if {[is_elf_format]} then {
|
||||
test_gnu_debuglink
|
||||
}
|
||||
--- binutils-2.41/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2023-07-03 00:00:00.000000000 +0100
|
||||
+++ binutils.new/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2023-12-12 11:52:54.564057931 +0000
|
||||
@@ -8,10 +8,10 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1,0x[0-9a-f]+
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,[0-9]+ # [0-9a-f]+ <data_g>
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+lui[ ]+a2,0x[0-9a-f]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,a2,[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a3,tp,0 # 0 <data_t>
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2023-12-12 14:21:10.225342926 +0000
|
||||
+++ binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp 2023-12-12 14:22:12.453421499 +0000
|
||||
@@ -1410,7 +1410,7 @@ proc objcopy_test_without_global_symbol
|
||||
# in object files, so they will fail this test.
|
||||
setup_xfail aarch64*-*-* arm*-*-*
|
||||
# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
-setup_xfail riscv*-*-*
|
||||
+# setup_xfail riscv*-*-*
|
||||
|
||||
objcopy_test_without_global_symbol
|
||||
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2024-10-03 15:21:47.926570551 +0100
|
||||
+++ binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2024-10-03 15:24:26.152502612 +0100
|
||||
@@ -8,10 +8,10 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1,0x[0-9a-f]+
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+lui[ ]+a2,0x[0-9a-f]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,a2,[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a3,tp,0 # 0 <data_t>
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2024-10-03 15:21:47.926570551 +0100
|
||||
+++ binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2024-10-03 15:23:54.512530979 +0100
|
||||
@@ -8,7 +8,7 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2024-10-03 15:21:47.926570551 +0100
|
||||
+++ binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2024-10-03 15:25:01.687468496 +0100
|
||||
@@ -11,5 +11,5 @@ Disassembly of section .text:
|
||||
[0-9a-f]+ <_start>:
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,gp.*<data_a>
|
||||
-.*:[ ]+[0-9a-f]+[ ]+mv[ ]+a1,a1
|
||||
+.*:[ ]+[0-9a-f]+[ ]+.*
|
||||
#pass
|
||||
--- binutils-with-gold-2.45.50-79b2b564fec.orig/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.d 2025-09-09 15:52:30.684689609 +0100
|
||||
+++ binutils-with-gold-2.45.50-79b2b564fec/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.d 2025-09-09 15:53:12.837859447 +0100
|
||||
@@ -30,6 +30,6 @@ Disassembly of section \.plt:
|
||||
|
||||
[0-9a-f]+ <bar@plt>:
|
||||
.*:[ ]+[0-9a-f]+[ ]+lpad[ ]+0x0
|
||||
-.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+t3,0x1
|
||||
+.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+t3,0x[0-9a-f]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+ld[ ]+t3,[0-9]+\(t3\) # [0-9a-f]+ <bar>
|
||||
.*:[ ]+[0-9a-f]+[ ]+jalr[ ]+t1,t3
|
||||
diff -rup binutils-with-gold-2.45.50-beab972c07d,orig/binutils/testsuite/binutils-all/objcopy.exp binutils-with-gold-2.45.50-beab972c07d/binutils/testsuite/binutils-all/objcopy.exp
|
||||
--- binutils-with-gold-2.45.50-beab972c07d,orig/binutils/testsuite/binutils-all/objcopy.exp 2025-12-02 12:47:19.063123207 +0000
|
||||
+++ binutils-with-gold-2.45.50-beab972c07d/binutils/testsuite/binutils-all/objcopy.exp 2025-12-04 12:39:26.079989597 +0000
|
||||
@@ -602,14 +602,19 @@ proc strip_test { } {
|
||||
set exec_output [binutils_run $STRIP "$STRIPFLAGS $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string equal "" $exec_output] {
|
||||
- fail $test
|
||||
+ fail "$test (warnings in linker output)"
|
||||
+ verbose $exec_output
|
||||
return
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $NM "-a $NMFLAGS $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string match "*: no symbols*" $exec_output] {
|
||||
- fail $test
|
||||
+
|
||||
+ # The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
+ setup_xfail riscv*-*-*
|
||||
+
|
||||
+ fail "$test (symbols in nm output)"
|
||||
return
|
||||
}
|
||||
|
||||
@@ -659,6 +664,9 @@ proc strip_test_with_saving_a_symbol { }
|
||||
pass $test
|
||||
}
|
||||
|
||||
+# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
+setup_xfail riscv*-*-*
|
||||
+
|
||||
strip_test_with_saving_a_symbol
|
||||
|
||||
# Test stripping an archive.
|
||||
@@ -1503,7 +1519,7 @@ proc objcopy_test_without_global_symbol
|
||||
# in object files, so they will fail this test.
|
||||
setup_xfail aarch64*-*-* arm*-*-*
|
||||
# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
-# setup_xfail riscv*-*-*
|
||||
+setup_xfail riscv*-*-*
|
||||
|
||||
objcopy_test_without_global_symbol
|
||||
|
||||
diff -rup binutils-with-gold-2.45.50-beab972c07d,orig/ld/testsuite/lib/ld-lib.exp binutils-with-gold-2.45.50-beab972c07d/ld/testsuite/lib/ld-lib.exp
|
||||
--- binutils-with-gold-2.45.50-beab972c07d,orig/ld/testsuite/lib/ld-lib.exp 2025-12-02 12:47:19.201090894 +0000
|
||||
+++ binutils-with-gold-2.45.50-beab972c07d/ld/testsuite/lib/ld-lib.exp 2025-12-03 09:30:07.184360005 +0000
|
||||
@@ -1633,6 +1633,12 @@ proc compile_one_cc { src output additio
|
||||
proc check_ctf_available { } {
|
||||
global ctf_available_saved
|
||||
|
||||
+ # Skip CTF tests for the Risc-V target for now, as the
|
||||
+ # tests have not been tweaked to support the riscv format.
|
||||
+ if { [istarget "riscv*-*-linux*"] } {
|
||||
+ return 0
|
||||
+ }
|
||||
+
|
||||
if {![info exists ctf_available_saved]} {
|
||||
set ctf_available_saved 0
|
||||
|
||||
--- fred/binutils/testsuite/lib/binutils-common.exp 2026-03-16 09:18:37.205413649 +0000
|
||||
+++ binutils-with-gold-2.46.50-d712202846b/binutils/testsuite/lib/binutils-common.exp 2026-03-16 09:18:49.559358668 +0000
|
||||
@@ -803,6 +803,9 @@ proc prune_warnings_extra { text } {
|
||||
# Ignore warnings about linking objects with an old sframe format
|
||||
regsub -all {(^|\n)([^\n]* unexpected SFrame format version [^\n]*\n[^\n]* SFrame section ignored\n?)+} $text {\1} text
|
||||
|
||||
+ # Skip warnings about the LTO plugin being needed.
|
||||
+ regsub -all "(^|\n)(\[^\n\]*:\[^\n\]*plugin needed to handle lto object\[^\n\]*\n?)+" $text "\\1" text
|
||||
+
|
||||
return $text
|
||||
}
|
||||
|
||||
--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2026-06-10 15:32:21.012274073 +0100
|
||||
+++ binutils-with-gold-2.46.50-48997323b0f/ld/testsuite/ld-elf/shared.exp 2026-06-10 15:34:41.397899263 +0100
|
||||
@@ -1859,6 +1859,10 @@ run_cc_link_tests [list \
|
||||
"pr29655.so" \
|
||||
] \
|
||||
]
|
||||
+
|
||||
+# FIXME: Find out why the Risc-V fails this test.
|
||||
+setup_xfail "riscv64-*-*"
|
||||
+
|
||||
# PR 29655 (cont.): Check that in PIC code linked as PDE taking the address
|
||||
# of a function defined in a DSO results in the function address (from GOT)
|
||||
# and not the "canonical PLT" address from the PDE.
|
||||
109
binutils-s390-arch14-insns.patch
Normal file
109
binutils-s390-arch14-insns.patch
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
diff -rup binutils.orig/gas/config/tc-s390.c binutils-2.35.1/gas/config/tc-s390.c
|
||||
--- binutils.orig/gas/config/tc-s390.c 2021-02-19 11:44:24.240877612 +0000
|
||||
+++ binutils-2.35.1/gas/config/tc-s390.c 2021-02-19 11:46:05.222554434 +0000
|
||||
@@ -292,6 +292,8 @@ s390_parse_cpu (const char * arg
|
||||
{ STRING_COMMA_LEN ("z14"), STRING_COMMA_LEN ("arch12"),
|
||||
S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX },
|
||||
{ STRING_COMMA_LEN ("z15"), STRING_COMMA_LEN ("arch13"),
|
||||
+ S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX },
|
||||
+ { STRING_COMMA_LEN (""), STRING_COMMA_LEN ("arch14"),
|
||||
S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }
|
||||
};
|
||||
static struct
|
||||
diff -rup binutils.orig/gas/doc/c-s390.texi binutils-2.35.1/gas/doc/c-s390.texi
|
||||
--- binutils.orig/gas/doc/c-s390.texi 2021-02-19 11:44:24.236877625 +0000
|
||||
+++ binutils-2.35.1/gas/doc/c-s390.texi 2021-02-19 11:46:05.223554431 +0000
|
||||
@@ -18,7 +18,7 @@ and eleven chip levels. The architecture
|
||||
Architecture (ESA) and the newer z/Architecture mode. The chip levels
|
||||
are g5 (or arch3), g6, z900 (or arch5), z990 (or arch6), z9-109, z9-ec
|
||||
(or arch7), z10 (or arch8), z196 (or arch9), zEC12 (or arch10), z13
|
||||
-(or arch11), z14 (or arch12), and z15 (or arch13).
|
||||
+(or arch11), z14 (or arch12), z15 (or arch13), or arch14.
|
||||
|
||||
@menu
|
||||
* s390 Options:: Command-line Options.
|
||||
@@ -70,8 +70,9 @@ are recognized:
|
||||
@code{z196} (or @code{arch9}),
|
||||
@code{zEC12} (or @code{arch10}),
|
||||
@code{z13} (or @code{arch11}),
|
||||
-@code{z14} (or @code{arch12}), and
|
||||
-@code{z15} (or @code{arch13}).
|
||||
+@code{z14} (or @code{arch12}),
|
||||
+@code{z15} (or @code{arch13}), and
|
||||
+@code{arch14}.
|
||||
|
||||
Assembling an instruction that is not supported on the target
|
||||
processor results in an error message.
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/s390.exp binutils-2.35.1/gas/testsuite/gas/s390/s390.exp
|
||||
--- binutils.orig/gas/testsuite/gas/s390/s390.exp 2021-02-19 11:44:24.338877299 +0000
|
||||
+++ binutils-2.35.1/gas/testsuite/gas/s390/s390.exp 2021-02-19 11:46:05.223554431 +0000
|
||||
@@ -31,6 +31,7 @@ if [expr [istarget "s390-*-*"] || [ista
|
||||
run_dump_test "zarch-z13" "{as -m64} {as -march=z13}"
|
||||
run_dump_test "zarch-arch12" "{as -m64} {as -march=arch12}"
|
||||
run_dump_test "zarch-arch13" "{as -m64} {as -march=arch13}"
|
||||
+ run_dump_test "zarch-arch14" "{as -m64} {as -march=arch14}"
|
||||
run_dump_test "zarch-reloc" "{as -m64}"
|
||||
run_dump_test "zarch-operands" "{as -m64} {as -march=z9-109}"
|
||||
run_dump_test "zarch-machine" "{as -m64} {as -march=z900}"
|
||||
Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.d
|
||||
Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.s
|
||||
diff -rup binutils.orig/include/opcode/s390.h binutils-2.35.1/include/opcode/s390.h
|
||||
--- binutils.orig/include/opcode/s390.h 2021-02-19 11:44:23.926878617 +0000
|
||||
+++ binutils-2.35.1/include/opcode/s390.h 2021-02-19 11:46:05.223554431 +0000
|
||||
@@ -44,6 +44,7 @@ enum s390_opcode_cpu_val
|
||||
S390_OPCODE_Z13,
|
||||
S390_OPCODE_ARCH12,
|
||||
S390_OPCODE_ARCH13,
|
||||
+ S390_OPCODE_ARCH14,
|
||||
S390_OPCODE_MAXCPU
|
||||
};
|
||||
|
||||
diff -rup binutils.orig/opcodes/s390-mkopc.c binutils-2.35.1/opcodes/s390-mkopc.c
|
||||
--- binutils.orig/opcodes/s390-mkopc.c 2021-02-19 11:44:23.947878550 +0000
|
||||
+++ binutils-2.35.1/opcodes/s390-mkopc.c 2021-02-19 11:46:05.223554431 +0000
|
||||
@@ -380,6 +380,8 @@ main (void)
|
||||
else if (strcmp (cpu_string, "z15") == 0
|
||||
|| strcmp (cpu_string, "arch13") == 0)
|
||||
min_cpu = S390_OPCODE_ARCH13;
|
||||
+ else if (strcmp (cpu_string, "arch14") == 0)
|
||||
+ min_cpu = S390_OPCODE_ARCH14;
|
||||
else {
|
||||
fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string);
|
||||
exit (1);
|
||||
Only in binutils-2.35.1/opcodes: s390-mkopc.c.orig
|
||||
diff -rup binutils.orig/opcodes/s390-opc.txt binutils-2.35.1/opcodes/s390-opc.txt
|
||||
--- binutils.orig/opcodes/s390-opc.txt 2021-02-19 11:44:23.943878563 +0000
|
||||
+++ binutils-2.35.1/opcodes/s390-opc.txt 2021-02-19 11:46:05.224554428 +0000
|
||||
@@ -2000,3 +2000,31 @@ e60000000052 vcvbg VRR_RV0UU "vector con
|
||||
# Message Security Assist Extension 9
|
||||
|
||||
b93a kdsa RRE_RR "compute digital signature authentication" arch13 zarch
|
||||
+
|
||||
+
|
||||
+# arch14 instructions
|
||||
+
|
||||
+e60000000074 vschp VRR_VVV0U0U " " arch14 zarch
|
||||
+e60000002074 vschsp VRR_VVV0U0 " " arch14 zarch
|
||||
+e60000003074 vschdp VRR_VVV0U0 " " arch14 zarch
|
||||
+e60000004074 vschxp VRR_VVV0U0 " " arch14 zarch
|
||||
+e6000000007c vscshp VRR_VVV " " arch14 zarch
|
||||
+e6000000007d vcsph VRR_VVV0U0 " " arch14 zarch
|
||||
+e60000000051 vclzdp VRR_VV0U2 " " arch14 zarch
|
||||
+e60000000070 vpkzr VRI_VVV0UU2 " " arch14 zarch
|
||||
+e60000000072 vsrpr VRI_VVV0UU2 " " arch14 zarch
|
||||
+e60000000054 vupkzh VRR_VV0U2 " " arch14 zarch
|
||||
+e6000000005c vupkzl VRR_VV0U2 " " arch14 zarch
|
||||
+
|
||||
+b93b nnpa RRE_00 " " arch14 zarch
|
||||
+e60000000056 vclfnh VRR_VV0UU2 " " arch14 zarch
|
||||
+e6000000005e vclfnl VRR_VV0UU2 " " arch14 zarch
|
||||
+e60000000075 vcrnf VRR_VVV0UU " " arch14 zarch
|
||||
+e6000000005d vcfn VRR_VV0UU2 " " arch14 zarch
|
||||
+e60000000055 vcnf VRR_VV0UU2 " " arch14 zarch
|
||||
+
|
||||
+b98B rdp RRF_RURR2 " " arch14 zarch optparm
|
||||
+
|
||||
+eb0000000071 lpswey SIY_URD " " arch14 zarch
|
||||
+b200 lbear S_RD " " arch14 zarch
|
||||
+b201 stbear S_RD " " arch14 zarch
|
||||
Only in binutils-2.35.1/opcodes: s390-opc.txt.orig
|
||||
772
binutils-s390-build.patch
Normal file
772
binutils-s390-build.patch
Normal file
|
|
@ -0,0 +1,772 @@
|
|||
diff -rup binutils.orig/libctf/ctf-create.c binutils-2.34.0/libctf/ctf-create.c
|
||||
--- binutils.orig/libctf/ctf-create.c 2020-06-16 12:06:28.466468753 +0100
|
||||
+++ binutils-2.34.0/libctf/ctf-create.c 2020-06-16 12:16:19.744482839 +0100
|
||||
@@ -871,7 +871,8 @@ ctf_add_encoded (ctf_file_t *fp, uint32_
|
||||
|
||||
if ((type = ctf_add_generic (fp, flag, name, kind, &dtd)) == CTF_ERR)
|
||||
return CTF_ERR; /* errno is set for us. */
|
||||
-
|
||||
+ if (dtd == NULL)
|
||||
+ return CTF_ERR;
|
||||
dtd->dtd_data.ctt_info = CTF_TYPE_INFO (kind, flag, 0);
|
||||
dtd->dtd_data.ctt_size = clp2 (P2ROUNDUP (ep->cte_bits, CHAR_BIT)
|
||||
/ CHAR_BIT);
|
||||
@@ -896,6 +897,8 @@ ctf_add_reftype (ctf_file_t *fp, uint32_
|
||||
|
||||
if ((type = ctf_add_generic (fp, flag, NULL, kind, &dtd)) == CTF_ERR)
|
||||
return CTF_ERR; /* errno is set for us. */
|
||||
+ if (dtd == NULL)
|
||||
+ return CTF_ERR;
|
||||
|
||||
dtd->dtd_data.ctt_info = CTF_TYPE_INFO (kind, flag, 0);
|
||||
dtd->dtd_data.ctt_type = (uint32_t) ref;
|
||||
@@ -958,6 +961,8 @@ ctf_add_slice (ctf_file_t *fp, uint32_t
|
||||
|
||||
if ((type = ctf_add_generic (fp, flag, NULL, CTF_K_SLICE, &dtd)) == CTF_ERR)
|
||||
return CTF_ERR; /* errno is set for us. */
|
||||
+ if (dtd == NULL)
|
||||
+ return CTF_ERR;
|
||||
|
||||
dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_SLICE, flag, 0);
|
||||
dtd->dtd_data.ctt_size = clp2 (P2ROUNDUP (ep->cte_bits, CHAR_BIT)
|
||||
@@ -1008,6 +1013,8 @@ ctf_add_array (ctf_file_t *fp, uint32_t
|
||||
|
||||
if ((type = ctf_add_generic (fp, flag, NULL, CTF_K_ARRAY, &dtd)) == CTF_ERR)
|
||||
return CTF_ERR; /* errno is set for us. */
|
||||
+ if (dtd == NULL)
|
||||
+ return CTF_ERR;
|
||||
|
||||
dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_ARRAY, flag, 0);
|
||||
dtd->dtd_data.ctt_size = 0;
|
||||
@@ -1075,6 +1082,8 @@ ctf_add_function (ctf_file_t *fp, uint32
|
||||
free (vdat);
|
||||
return CTF_ERR; /* errno is set for us. */
|
||||
}
|
||||
+ if (dtd == NULL)
|
||||
+ return CTF_ERR;
|
||||
|
||||
dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_FUNCTION, flag, vlen);
|
||||
dtd->dtd_data.ctt_type = (uint32_t) ctc->ctc_return;
|
||||
@@ -1104,6 +1113,8 @@ ctf_add_struct_sized (ctf_file_t *fp, ui
|
||||
else if ((type = ctf_add_generic (fp, flag, name, CTF_K_STRUCT,
|
||||
&dtd)) == CTF_ERR)
|
||||
return CTF_ERR; /* errno is set for us. */
|
||||
+ if (dtd == NULL)
|
||||
+ return CTF_ERR;
|
||||
|
||||
dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_STRUCT, flag, 0);
|
||||
|
||||
@@ -1141,6 +1152,8 @@ ctf_add_union_sized (ctf_file_t *fp, uin
|
||||
else if ((type = ctf_add_generic (fp, flag, name, CTF_K_UNION,
|
||||
&dtd)) == CTF_ERR)
|
||||
return CTF_ERR; /* errno is set for us */
|
||||
+ if (dtd == NULL)
|
||||
+ return CTF_ERR;
|
||||
|
||||
dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_UNION, flag, 0);
|
||||
|
||||
@@ -1177,6 +1190,8 @@ ctf_add_enum (ctf_file_t *fp, uint32_t f
|
||||
else if ((type = ctf_add_generic (fp, flag, name, CTF_K_ENUM,
|
||||
&dtd)) == CTF_ERR)
|
||||
return CTF_ERR; /* errno is set for us. */
|
||||
+ if (dtd == NULL)
|
||||
+ return CTF_ERR;
|
||||
|
||||
dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_ENUM, flag, 0);
|
||||
dtd->dtd_data.ctt_size = fp->ctf_dmodel->ctd_int;
|
||||
diff -rup binutils.orig/libctf/ctf-types.c binutils-2.34.0/libctf/ctf-types.c
|
||||
--- binutils.orig/libctf/ctf-types.c 2020-06-16 12:06:28.466468753 +0100
|
||||
+++ binutils-2.34.0/libctf/ctf-types.c 2020-06-16 12:10:58.033563365 +0100
|
||||
@@ -748,7 +748,7 @@ ctf_type_encoding (ctf_file_t *fp, ctf_i
|
||||
case CTF_K_SLICE:
|
||||
{
|
||||
const ctf_slice_t *slice;
|
||||
- ctf_encoding_t underlying_en;
|
||||
+ ctf_encoding_t underlying_en = {0};
|
||||
slice = &dtd->dtd_u.dtu_slice;
|
||||
|
||||
data = ctf_type_encoding (fp, slice->cts_type, &underlying_en);
|
||||
diff -rup binutils.orig/opcodes/s390-mkopc.c binutils-2.34.0/opcodes/s390-mkopc.c
|
||||
--- binutils.orig/opcodes/s390-mkopc.c 2020-06-16 12:06:28.447468816 +0100
|
||||
+++ binutils-2.34.0/opcodes/s390-mkopc.c 2020-06-16 12:17:10.783311417 +0100
|
||||
@@ -168,7 +168,7 @@ insertExpandedMnemonic (char *opcode, ch
|
||||
int mask_start, i = 0, tag_found = 0, reading_number = 0;
|
||||
int number_p = 0, suffix_p = 0, prefix_p = 0;
|
||||
const struct s390_cond_ext_format *ext_table;
|
||||
- int ext_table_length;
|
||||
+ int ext_table_length = 0;
|
||||
|
||||
if (!(tag = strpbrk (mnemonic, "*$")))
|
||||
{
|
||||
Only in binutils.orig/libctf: .#ctf-create.c
|
||||
diff -rup binutils.orig/libctf/ctf-create.c binutils-2.34.0/libctf/ctf-create.c
|
||||
--- binutils.orig/libctf/ctf-create.c 2020-06-16 14:49:06.080801319 +0100
|
||||
+++ binutils-2.34.0/libctf/ctf-create.c 2020-06-16 14:49:08.046794113 +0100
|
||||
@@ -798,6 +798,7 @@ ctf_add_generic (ctf_file_t *fp, uint32_
|
||||
{
|
||||
ctf_dtdef_t *dtd;
|
||||
ctf_id_t type;
|
||||
+ *rp = NULL;
|
||||
|
||||
if (flag != CTF_ADD_NONROOT && flag != CTF_ADD_ROOT)
|
||||
return (ctf_set_errno (fp, EINVAL));
|
||||
diff -rup binutils.orig/opcodes/fr30-ibld.c binutils-2.34.0/opcodes/fr30-ibld.c
|
||||
--- binutils.orig/opcodes/fr30-ibld.c 2020-06-16 14:49:06.074801341 +0100
|
||||
+++ binutils-2.34.0/opcodes/fr30-ibld.c 2020-06-16 16:43:31.428324833 +0100
|
||||
@@ -810,7 +810,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case FR30_OPERAND_DIR10 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value);
|
||||
value = ((value) << (2));
|
||||
fields->f_dir10 = value;
|
||||
@@ -821,7 +821,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case FR30_OPERAND_DIR9 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value);
|
||||
value = ((value) << (1));
|
||||
fields->f_dir9 = value;
|
||||
@@ -829,7 +829,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case FR30_OPERAND_DISP10 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 16, total_length, pc, & value);
|
||||
value = ((value) * (4));
|
||||
fields->f_disp10 = value;
|
||||
@@ -840,7 +840,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case FR30_OPERAND_DISP9 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 16, total_length, pc, & value);
|
||||
value = ((value) * (2));
|
||||
fields->f_disp9 = value;
|
||||
@@ -865,7 +865,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case FR30_OPERAND_LABEL12 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 5, 11, 16, total_length, pc, & value);
|
||||
value = ((((value) * (2))) + (((pc) + (2))));
|
||||
fields->f_rel12 = value;
|
||||
@@ -873,7 +873,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case FR30_OPERAND_LABEL9 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 8, 16, total_length, pc, & value);
|
||||
value = ((((value) * (2))) + (((pc) + (2))));
|
||||
fields->f_rel9 = value;
|
||||
@@ -881,7 +881,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case FR30_OPERAND_M4 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 16, total_length, pc, & value);
|
||||
value = ((value) | (-16));
|
||||
fields->f_m4 = value;
|
||||
@@ -911,7 +911,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case FR30_OPERAND_U10 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value);
|
||||
value = ((value) << (2));
|
||||
fields->f_u10 = value;
|
||||
@@ -928,7 +928,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case FR30_OPERAND_UDISP6 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 16, total_length, pc, & value);
|
||||
value = ((value) << (2));
|
||||
fields->f_udisp6 = value;
|
||||
|
||||
diff -rup binutils.orig/opcodes/fr30-ibld.c binutils-2.34.0/opcodes/fr30-ibld.c
|
||||
--- binutils.orig/opcodes/fr30-ibld.c 2020-06-16 17:10:22.540563440 +0100
|
||||
+++ binutils-2.34.0/opcodes/fr30-ibld.c 2020-06-16 17:10:48.966468906 +0100
|
||||
@@ -903,7 +903,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case FR30_OPERAND_S10 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 16, total_length, pc, & value);
|
||||
value = ((value) * (4));
|
||||
fields->f_s10 = value;
|
||||
Only in binutils-2.34.0/opcodes: fr30-ibld.c~
|
||||
--- binutils.orig/opcodes/m32c-ibld.c 2020-06-16 17:10:22.531563472 +0100
|
||||
+++ binutils-2.34.0/opcodes/m32c-ibld.c 2020-06-16 17:25:48.612258094 +0100
|
||||
@@ -1805,7 +1805,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_BIT32RNPREFIXED :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
|
||||
value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
|
||||
fields->f_dst32_rn_prefixed_QI = value;
|
||||
@@ -1813,7 +1813,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_BIT32RNUNPREFIXED :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
|
||||
value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
|
||||
fields->f_dst32_rn_unprefixed_QI = value;
|
||||
@@ -1824,7 +1824,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_BITBASE16_16_U16 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_16_u16 = value;
|
||||
@@ -1860,7 +1860,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
|
||||
if (length <= 0) break;
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & value);
|
||||
value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
|
||||
fields->f_dsp_16_s16 = value;
|
||||
@@ -1887,7 +1887,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
|
||||
if (length <= 0) break;
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_16_u16 = value;
|
||||
@@ -1903,7 +1903,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
|
||||
if (length <= 0) break;
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_16_u16 = value;
|
||||
@@ -1971,7 +1971,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
|
||||
if (length <= 0) break;
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_32_u16 = value;
|
||||
@@ -1996,7 +1996,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_16_S16 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & value);
|
||||
value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
|
||||
fields->f_dsp_16_s16 = value;
|
||||
@@ -2007,7 +2007,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_16_U16 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_16_u16 = value;
|
||||
@@ -2016,7 +2016,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
case M32C_OPERAND_DSP_16_U20 :
|
||||
{
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_16_u16 = value;
|
||||
@@ -2032,7 +2032,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
case M32C_OPERAND_DSP_16_U24 :
|
||||
{
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_16_u16 = value;
|
||||
@@ -2078,7 +2078,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
|
||||
if (length <= 0) break;
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_32_u16 = value;
|
||||
@@ -2094,7 +2094,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
|
||||
if (length <= 0) break;
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_32_u16 = value;
|
||||
@@ -2110,7 +2110,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_32_S16 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 16, 32, total_length, pc, & value);
|
||||
value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
|
||||
fields->f_dsp_32_s16 = value;
|
||||
@@ -2121,7 +2121,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_32_U16 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_32_u16 = value;
|
||||
@@ -2129,7 +2129,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_32_U20 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value);
|
||||
value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
|
||||
fields->f_dsp_32_u24 = value;
|
||||
@@ -2137,7 +2137,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_32_U24 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value);
|
||||
value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
|
||||
fields->f_dsp_32_u24 = value;
|
||||
@@ -2148,7 +2148,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_40_S16 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 16, 32, total_length, pc, & value);
|
||||
value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
|
||||
fields->f_dsp_40_s16 = value;
|
||||
@@ -2159,7 +2159,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_40_U16 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_40_u16 = value;
|
||||
@@ -2167,7 +2167,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_40_U20 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 20, 32, total_length, pc, & value);
|
||||
value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (983040))));
|
||||
fields->f_dsp_40_u20 = value;
|
||||
@@ -2175,7 +2175,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_40_U24 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 24, 32, total_length, pc, & value);
|
||||
value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
|
||||
fields->f_dsp_40_u24 = value;
|
||||
@@ -2186,7 +2186,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_48_S16 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 16, 32, total_length, pc, & value);
|
||||
value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
|
||||
fields->f_dsp_48_s16 = value;
|
||||
@@ -2197,7 +2197,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_48_U16 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_48_u16 = value;
|
||||
@@ -2206,7 +2206,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
case M32C_OPERAND_DSP_48_U20 :
|
||||
{
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_48_u16 = value;
|
||||
@@ -2222,7 +2222,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
case M32C_OPERAND_DSP_48_U24 :
|
||||
{
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_48_u16 = value;
|
||||
@@ -2240,7 +2240,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_8_S24 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 24, 32, total_length, pc, & value);
|
||||
value = ((((((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) & (255))) << (16))))) ^ (8388608))) - (8388608));
|
||||
fields->f_dsp_8_s24 = value;
|
||||
@@ -2251,7 +2251,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_8_U16 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_8_u16 = value;
|
||||
@@ -2259,7 +2259,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DSP_8_U24 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 24, 32, total_length, pc, & value);
|
||||
value = ((((((USI) (value) >> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16))));
|
||||
fields->f_dsp_8_u24 = value;
|
||||
@@ -2343,7 +2343,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DST32RNPREFIXEDHI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
|
||||
value = ((((value) + (2))) % (4));
|
||||
fields->f_dst32_rn_prefixed_HI = value;
|
||||
@@ -2351,7 +2351,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DST32RNPREFIXEDQI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
|
||||
value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
|
||||
fields->f_dst32_rn_prefixed_QI = value;
|
||||
@@ -2359,7 +2359,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DST32RNPREFIXEDSI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
|
||||
value = ((value) - (2));
|
||||
fields->f_dst32_rn_prefixed_SI = value;
|
||||
@@ -2367,7 +2367,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DST32RNUNPREFIXEDHI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
|
||||
value = ((((value) + (2))) % (4));
|
||||
fields->f_dst32_rn_unprefixed_HI = value;
|
||||
@@ -2375,7 +2375,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DST32RNUNPREFIXEDQI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
|
||||
value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
|
||||
fields->f_dst32_rn_unprefixed_QI = value;
|
||||
@@ -2383,7 +2383,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_DST32RNUNPREFIXEDSI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
|
||||
value = ((value) - (2));
|
||||
fields->f_dst32_rn_unprefixed_SI = value;
|
||||
@@ -2402,7 +2402,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_IMM_16_HI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & value);
|
||||
value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
|
||||
fields->f_dsp_16_s16 = value;
|
||||
@@ -2414,14 +2414,14 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
case M32C_OPERAND_IMM_16_SI :
|
||||
{
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_16_u16 = value;
|
||||
}
|
||||
if (length <= 0) break;
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_32_u16 = value;
|
||||
@@ -2454,7 +2454,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
|
||||
if (length <= 0) break;
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value);
|
||||
value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
|
||||
fields->f_dsp_32_u24 = value;
|
||||
@@ -2467,7 +2467,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_IMM_32_HI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 16, 32, total_length, pc, & value);
|
||||
value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
|
||||
fields->f_dsp_32_s16 = value;
|
||||
@@ -2486,7 +2486,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_IMM_40_HI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 16, 32, total_length, pc, & value);
|
||||
value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
|
||||
fields->f_dsp_40_s16 = value;
|
||||
@@ -2498,7 +2498,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
case M32C_OPERAND_IMM_40_SI :
|
||||
{
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 24, 32, total_length, pc, & value);
|
||||
value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
|
||||
fields->f_dsp_40_u24 = value;
|
||||
@@ -2513,7 +2513,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_IMM_48_HI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 16, 32, total_length, pc, & value);
|
||||
value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
|
||||
fields->f_dsp_48_s16 = value;
|
||||
@@ -2525,14 +2525,14 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
case M32C_OPERAND_IMM_48_SI :
|
||||
{
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_48_u16 = value;
|
||||
}
|
||||
if (length <= 0) break;
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 64, 0, 16, 32, total_length, pc, & value);
|
||||
value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))));
|
||||
fields->f_dsp_64_u16 = value;
|
||||
@@ -2567,7 +2567,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_IMM_8_HI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 16, 32, total_length, pc, & value);
|
||||
value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
|
||||
fields->f_dsp_8_s16 = value;
|
||||
@@ -2593,7 +2593,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_IMM1_S :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 1, 32, total_length, pc, & value);
|
||||
value = ((value) + (1));
|
||||
fields->f_imm1_S = value;
|
||||
@@ -2612,7 +2612,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_LAB_16_8 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 16, 8, 32, total_length, pc, & value);
|
||||
value = ((value) + (((pc) + (2))));
|
||||
fields->f_lab_16_8 = value;
|
||||
@@ -2620,7 +2620,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_LAB_24_8 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 24, 8, 32, total_length, pc, & value);
|
||||
value = ((value) + (((pc) + (2))));
|
||||
fields->f_lab_24_8 = value;
|
||||
@@ -2628,7 +2628,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_LAB_32_8 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 32, 0, 8, 32, total_length, pc, & value);
|
||||
value = ((value) + (((pc) + (2))));
|
||||
fields->f_lab_32_8 = value;
|
||||
@@ -2636,7 +2636,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_LAB_40_8 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 32, 8, 8, 32, total_length, pc, & value);
|
||||
value = ((value) + (((pc) + (2))));
|
||||
fields->f_lab_40_8 = value;
|
||||
@@ -2644,7 +2644,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_LAB_5_3 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_PCREL_ADDR), 0, 5, 3, 32, total_length, pc, & value);
|
||||
value = ((value) + (((pc) + (2))));
|
||||
fields->f_lab_5_3 = value;
|
||||
@@ -2652,7 +2652,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_LAB_8_16 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGN_OPT)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 16, 32, total_length, pc, & value);
|
||||
value = ((((((((((USI) (((value) & (65280))) >> (8))) | (((((value) & (255))) << (8))))) ^ (32768))) - (32768))) + (((pc) + (1))));
|
||||
fields->f_lab_8_16 = value;
|
||||
@@ -2660,7 +2660,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_LAB_8_24 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_ABS_ADDR), 0, 8, 24, 32, total_length, pc, & value);
|
||||
value = ((((((USI) (value) >> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16))));
|
||||
fields->f_lab_8_24 = value;
|
||||
@@ -2668,7 +2668,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_LAB_8_8 :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 8, 32, total_length, pc, & value);
|
||||
value = ((value) + (((pc) + (1))));
|
||||
fields->f_lab_8_8 = value;
|
||||
@@ -2757,7 +2757,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_SRC32RNPREFIXEDHI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value);
|
||||
value = ((((value) + (2))) % (4));
|
||||
fields->f_src32_rn_prefixed_HI = value;
|
||||
@@ -2765,7 +2765,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_SRC32RNPREFIXEDQI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value);
|
||||
value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
|
||||
fields->f_src32_rn_prefixed_QI = value;
|
||||
@@ -2773,7 +2773,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_SRC32RNPREFIXEDSI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value);
|
||||
value = ((value) - (2));
|
||||
fields->f_src32_rn_prefixed_SI = value;
|
||||
@@ -2781,7 +2781,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_SRC32RNUNPREFIXEDHI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value);
|
||||
value = ((((value) + (2))) % (4));
|
||||
fields->f_src32_rn_unprefixed_HI = value;
|
||||
@@ -2789,7 +2789,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_SRC32RNUNPREFIXEDQI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value);
|
||||
value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
|
||||
fields->f_src32_rn_unprefixed_QI = value;
|
||||
@@ -2797,7 +2797,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC
|
||||
break;
|
||||
case M32C_OPERAND_SRC32RNUNPREFIXEDSI :
|
||||
{
|
||||
- long value;
|
||||
+ long value = 0;
|
||||
length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value);
|
||||
value = ((value) - (2));
|
||||
fields->f_src32_rn_unprefixed_SI = value;
|
||||
--- binutils.orig/binutils/srconv.c 2020-06-16 17:10:22.251564474 +0100
|
||||
+++ binutils-2.34.0/binutils/srconv.c 2020-06-16 20:07:51.670025912 +0100
|
||||
@@ -492,6 +492,8 @@ wr_rl (struct coff_ofile *ptr ATTRIBUTE_
|
||||
rl.addr = r->offset;
|
||||
rl.bitloc = 0;
|
||||
rl.flen = 32; /* SH Specific. */
|
||||
+ rl.dunno = 0;
|
||||
+ rl.symn = 0;
|
||||
|
||||
/* What sort of reloc ? Look in the section to find out. */
|
||||
ref = r->symbol;
|
||||
--- binutils.orig/libctf/ctf-create.c 2020-07-24 15:33:26.100996335 +0100
|
||||
+++ binutils-2.35/libctf/ctf-create.c 2020-07-24 15:33:29.042977475 +0100
|
||||
@@ -1257,6 +1257,8 @@ ctf_add_forward (ctf_file_t *fp, uint32_
|
||||
|
||||
if ((type = ctf_add_generic (fp, flag, name, kind, &dtd)) == CTF_ERR)
|
||||
return CTF_ERR; /* errno is set for us. */
|
||||
+ if (dtd == NULL)
|
||||
+ return CTF_ERR;
|
||||
|
||||
dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_FORWARD, flag, 0);
|
||||
dtd->dtd_data.ctt_type = kind;
|
||||
27
binutils-special-sections-in-groups.patch
Normal file
27
binutils-special-sections-in-groups.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
--- binutils.orig/bfd/elf.c 2018-10-19 11:42:10.107277490 +0100
|
||||
+++ binutils-2.31.1/bfd/elf.c 2018-10-19 11:44:33.607105801 +0100
|
||||
@@ -830,7 +830,13 @@ setup_group (bfd *abfd, Elf_Internal_Shd
|
||||
}
|
||||
}
|
||||
|
||||
- if (elf_group_name (newsect) == NULL)
|
||||
+ if (elf_group_name (newsect) == NULL
|
||||
+ /* OS specific sections might be in a group (eg ARM's ARM_EXIDX section)
|
||||
+ but they will not have been added to the group because they do not
|
||||
+ have contents that the ELF code in the BFD library knows how to
|
||||
+ process. This is OK though - we rely upon the target backends to
|
||||
+ handle these sections for us. */
|
||||
+ && hdr->sh_type < SHT_LOOS)
|
||||
{
|
||||
/* xgettext:c-format */
|
||||
_bfd_error_handler (_("%pB: no group info for section '%pA'"),
|
||||
@@ -936,7 +942,8 @@ _bfd_elf_setup_sections (bfd *abfd)
|
||||
else if (idx->shdr->bfd_section)
|
||||
elf_sec_group (idx->shdr->bfd_section) = shdr->bfd_section;
|
||||
else if (idx->shdr->sh_type != SHT_RELA
|
||||
- && idx->shdr->sh_type != SHT_REL)
|
||||
+ && idx->shdr->sh_type != SHT_REL
|
||||
+ && idx->shdr->sh_type < SHT_LOOS)
|
||||
{
|
||||
/* There are some unknown sections in the group. */
|
||||
_bfd_error_handler
|
||||
19
binutils-strip-merge.patch
Normal file
19
binutils-strip-merge.patch
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
--- binutils.orig/binutils/objcopy.c 2020-10-06 14:53:19.264943750 +0100
|
||||
+++ binutils-2.35.1/binutils/objcopy.c 2020-10-06 14:53:47.002761889 +0100
|
||||
@@ -3313,14 +3313,12 @@ copy_object (bfd *ibfd, bfd *obfd, const
|
||||
/* It is likely that output sections are in the same order
|
||||
as the input sections, but do not assume that this is
|
||||
the case. */
|
||||
- if (strcmp (bfd_section_name (merged->sec),
|
||||
- bfd_section_name (osec)) != 0)
|
||||
+ if (merged->sec->output_section != osec)
|
||||
{
|
||||
for (merged = merged_note_sections;
|
||||
merged != NULL;
|
||||
merged = merged->next)
|
||||
- if (strcmp (bfd_section_name (merged->sec),
|
||||
- bfd_section_name (osec)) == 0)
|
||||
+ if (merged->sec->output_section == osec)
|
||||
break;
|
||||
|
||||
if (merged == NULL)
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
--- binutils.orig/ld/testsuite/ld-elf/linux-x86.exp 2024-01-24 11:52:35.288014542 +0000
|
||||
+++ binutils-2.41/ld/testsuite/ld-elf/linux-x86.exp 2024-01-24 17:31:39.356167357 +0000
|
||||
@@ -225,6 +225,10 @@ if { [check_ifunc_attribute_available] }
|
||||
# Old gcc silently ignores __attribute__ ((aligned())) with too big alignment.
|
||||
proc compiler_honours_aligned { } {
|
||||
global CC_FOR_TARGET READELF srcdir subdir
|
||||
+
|
||||
+ # Temporary fix for CentOS-10 kernel issue. (RHEL-22466)
|
||||
+ return 0
|
||||
+
|
||||
ld_compile $CC_FOR_TARGET $srcdir/$subdir/p_align-1.c tmpdir/p_align-1.o
|
||||
set output [run_host_cmd "$READELF" "-SW tmpdir/p_align-1.o"]
|
||||
if { [regexp { [.]data *PROGBITS .* 8388608[\n]} $output] } {
|
||||
1207
binutils-testsuite-failures.patch
Normal file
1207
binutils-testsuite-failures.patch
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
10
binutils-unexpected-form-20.patch
Normal file
10
binutils-unexpected-form-20.patch
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
--- binutils.orig/binutils/dwarf.c 2021-03-05 09:25:43.850258361 +0000
|
||||
+++ binutils-2.35.1/binutils/dwarf.c 2021-03-05 09:26:35.861895776 +0000
|
||||
@@ -2115,6 +2115,7 @@ get_type_abbrev_from_form (unsigned long
|
||||
switch (form)
|
||||
{
|
||||
case DW_FORM_GNU_ref_alt:
|
||||
+ case DW_FORM_ref_sig8:
|
||||
/* FIXME: We are unable to handle this form at the moment. */
|
||||
return NULL;
|
||||
|
||||
38
binutils-use-long-long.patch
Normal file
38
binutils-use-long-long.patch
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
diff -up binutils-2.25.orig/bfd/configure.ac binutils-2.25/bfd/configure.ac
|
||||
--- binutils-2.25.orig/bfd/configure.ac 2014-12-24 10:34:45.590491143 +0000
|
||||
+++ binutils-2.25/bfd/configure.ac 2014-12-24 10:36:12.997981992 +0000
|
||||
@@ -183,11 +183,13 @@ if test "x${ac_cv_sizeof_long}" = "x8";
|
||||
BFD_HOST_64BIT_LONG=1
|
||||
test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"
|
||||
test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"
|
||||
-elif test "x${ac_cv_sizeof_long_long}" = "x8"; then
|
||||
+fi
|
||||
+if test "x${ac_cv_sizeof_long_long}" = "x8"; then
|
||||
BFD_HOST_64BIT_LONG_LONG=1
|
||||
test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
|
||||
test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
|
||||
- if test "x${ac_cv_sizeof_void_p}" = "x8"; then
|
||||
+ if test "x${ac_cv_sizeof_void_p}" = "x8" \
|
||||
+ -a "x${ac_cv_sizeof_long}" != "x8"; then
|
||||
BFD_HOSTPTR_T="unsigned long long"
|
||||
fi
|
||||
fi
|
||||
diff -up ../binutils-2.20.51.0.7.original/bfd/configure ./bfd/configure
|
||||
--- a/bfd/configure 2010-04-08 15:23:58.000000000 +0100
|
||||
+++ b/bfd/configure 2010-04-08 15:24:06.000000000 +0100
|
||||
@@ -12819,11 +12819,13 @@
|
||||
BFD_HOST_64BIT_LONG=1
|
||||
test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"
|
||||
test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"
|
||||
-elif test "x${ac_cv_sizeof_long_long}" = "x8"; then
|
||||
+fi
|
||||
+if test "x${ac_cv_sizeof_long_long}" = "x8"; then
|
||||
BFD_HOST_64BIT_LONG_LONG=1
|
||||
test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
|
||||
test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
|
||||
- if test "x${ac_cv_sizeof_void_p}" = "x8"; then
|
||||
+ if test "x${ac_cv_sizeof_void_p}" = "x8" \
|
||||
+ -a "x${ac_cv_sizeof_long}" != "x8"; then
|
||||
BFD_HOSTPTR_T="unsigned long long"
|
||||
fi
|
||||
fi
|
||||
158
binutils-warnings.patch
Normal file
158
binutils-warnings.patch
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
|
||||
index 6ecfab5d..f8698213 100644
|
||||
--- a/binutils/dwarf.c
|
||||
+++ b/binutils/dwarf.c
|
||||
@@ -4914,7 +4914,7 @@ display_debug_lines_decoded (struct dwarf_section * section,
|
||||
else
|
||||
{
|
||||
newFileName = (char *) xmalloc (fileNameLength + 1);
|
||||
- strncpy (newFileName, fileName, fileNameLength + 1);
|
||||
+ strcpy (newFileName, fileName);
|
||||
}
|
||||
|
||||
if (!do_wide || (fileNameLength <= MAX_FILENAME_LENGTH))
|
||||
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
|
||||
index 3639bfbf..ed080a1a 100644
|
||||
--- a/libiberty/cp-demangle.c
|
||||
+++ b/libiberty/cp-demangle.c
|
||||
@@ -185,20 +185,6 @@ static void d_init_info (const char *, int, size_t, struct d_info *);
|
||||
#define CP_STATIC_IF_GLIBCPP_V3
|
||||
#endif /* ! defined(IN_GLIBCPP_V3) */
|
||||
|
||||
-/* See if the compiler supports dynamic arrays. */
|
||||
-
|
||||
-#ifdef __GNUC__
|
||||
-#define CP_DYNAMIC_ARRAYS
|
||||
-#else
|
||||
-#ifdef __STDC__
|
||||
-#ifdef __STDC_VERSION__
|
||||
-#if __STDC_VERSION__ >= 199901L && !__STDC_NO_VLA__
|
||||
-#define CP_DYNAMIC_ARRAYS
|
||||
-#endif /* __STDC_VERSION__ >= 199901L && !__STDC_NO_VLA__ */
|
||||
-#endif /* defined (__STDC_VERSION__) */
|
||||
-#endif /* defined (__STDC__) */
|
||||
-#endif /* ! defined (__GNUC__) */
|
||||
-
|
||||
/* We avoid pulling in the ctype tables, to prevent pulling in
|
||||
additional unresolved symbols when this code is used in a library.
|
||||
FIXME: Is this really a valid reason? This comes from the original
|
||||
@@ -4343,29 +4329,21 @@ cplus_demangle_print_callback (int options,
|
||||
d_print_init (&dpi, callback, opaque, dc);
|
||||
|
||||
{
|
||||
-#ifdef CP_DYNAMIC_ARRAYS
|
||||
- /* Avoid zero-length VLAs, which are prohibited by the C99 standard
|
||||
- and flagged as errors by Address Sanitizer. */
|
||||
- __extension__ struct d_saved_scope scopes[(dpi.num_saved_scopes > 0)
|
||||
- ? dpi.num_saved_scopes : 1];
|
||||
- __extension__ struct d_print_template temps[(dpi.num_copy_templates > 0)
|
||||
- ? dpi.num_copy_templates : 1];
|
||||
-
|
||||
- dpi.saved_scopes = scopes;
|
||||
- dpi.copy_templates = temps;
|
||||
-#else
|
||||
- dpi.saved_scopes = alloca (dpi.num_saved_scopes
|
||||
- * sizeof (*dpi.saved_scopes));
|
||||
- dpi.copy_templates = alloca (dpi.num_copy_templates
|
||||
- * sizeof (*dpi.copy_templates));
|
||||
-#endif
|
||||
-
|
||||
+ dpi.saved_scopes
|
||||
+ = (struct d_saved_scope *) xmalloc (dpi.num_saved_scopes
|
||||
+ * sizeof (*dpi.saved_scopes));
|
||||
+ dpi.copy_templates
|
||||
+ = (struct d_print_template *) xmalloc (dpi.num_copy_templates
|
||||
+ * sizeof (*dpi.copy_templates));
|
||||
d_print_comp (&dpi, options, dc);
|
||||
}
|
||||
|
||||
d_print_flush (&dpi);
|
||||
|
||||
- return ! d_print_saw_error (&dpi);
|
||||
+ int retval = ! d_print_saw_error (&dpi);
|
||||
+ free (dpi.saved_scopes);
|
||||
+ free (dpi.copy_templates);
|
||||
+ return retval;
|
||||
}
|
||||
|
||||
/* Turn components into a human readable string. OPTIONS is the
|
||||
@@ -6307,16 +6285,12 @@ d_demangle_callback (const char *mangled, int options,
|
||||
}
|
||||
|
||||
{
|
||||
-#ifdef CP_DYNAMIC_ARRAYS
|
||||
- __extension__ struct demangle_component comps[di.num_comps];
|
||||
- __extension__ struct demangle_component *subs[di.num_subs];
|
||||
-
|
||||
- di.comps = comps;
|
||||
- di.subs = subs;
|
||||
-#else
|
||||
- di.comps = alloca (di.num_comps * sizeof (*di.comps));
|
||||
- di.subs = alloca (di.num_subs * sizeof (*di.subs));
|
||||
-#endif
|
||||
+ di.comps
|
||||
+ = (struct demangle_component *) xmalloc (di.num_comps
|
||||
+ * sizeof (*di.comps));
|
||||
+ di.subs
|
||||
+ = (struct demangle_component **) xmalloc (di.num_subs
|
||||
+ * sizeof (*di.subs));
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@@ -6357,6 +6331,8 @@ d_demangle_callback (const char *mangled, int options,
|
||||
: 0;
|
||||
}
|
||||
|
||||
+ free (di.comps);
|
||||
+ free (di.subs);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -6588,16 +6564,12 @@ is_ctor_or_dtor (const char *mangled,
|
||||
cplus_demangle_init_info (mangled, DMGL_GNU_V3, strlen (mangled), &di);
|
||||
|
||||
{
|
||||
-#ifdef CP_DYNAMIC_ARRAYS
|
||||
- __extension__ struct demangle_component comps[di.num_comps];
|
||||
- __extension__ struct demangle_component *subs[di.num_subs];
|
||||
-
|
||||
- di.comps = comps;
|
||||
- di.subs = subs;
|
||||
-#else
|
||||
- di.comps = alloca (di.num_comps * sizeof (*di.comps));
|
||||
- di.subs = alloca (di.num_subs * sizeof (*di.subs));
|
||||
-#endif
|
||||
+ di.comps
|
||||
+ = (struct demangle_component *) xmalloc (di.num_comps
|
||||
+ * sizeof (*di.comps));
|
||||
+ di.subs
|
||||
+ = (struct demangle_component **) xmalloc (di.num_subs
|
||||
+ * sizeof (*di.subs));
|
||||
|
||||
dc = cplus_demangle_mangled_name (&di, 1);
|
||||
|
||||
@@ -6640,6 +6612,8 @@ is_ctor_or_dtor (const char *mangled,
|
||||
}
|
||||
}
|
||||
|
||||
+ free (di.comps);
|
||||
+ free (di.subs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c
|
||||
index e3f9f920..5dbe6f89 100644
|
||||
--- a/libiberty/make-relative-prefix.c
|
||||
+++ b/libiberty/make-relative-prefix.c
|
||||
@@ -259,10 +259,7 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix,
|
||||
#ifdef HAVE_HOST_EXECUTABLE_SUFFIX
|
||||
len += strlen (HOST_EXECUTABLE_SUFFIX);
|
||||
#endif
|
||||
- if (len < MAX_ALLOCA_SIZE)
|
||||
- nstore = (char *) alloca (len);
|
||||
- else
|
||||
- alloc_ptr = nstore = (char *) malloc (len);
|
||||
+ alloc_ptr = nstore = (char *) malloc (len);
|
||||
|
||||
startp = endp = temp;
|
||||
while (1)
|
||||
2418
binutils.spec
2418
binutils.spec
File diff suppressed because it is too large
Load diff
37455
binutils.unicode.patch
Normal file
37455
binutils.unicode.patch
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -5,11 +5,10 @@ decision_context: bodhi_update_push_stable
|
|||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation}
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-fast-lane.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-slow-lane.functional}
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
#
|
||||
# Build/PR gating tests for binutils
|
||||
#
|
||||
|
||||
/common:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/binutils.git
|
||||
ref: main
|
||||
name: /plans/build-gating/common
|
||||
|
||||
/kernel-rebuild:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/binutils.git
|
||||
ref: main
|
||||
name: /plans/build-gating/kernel-rebuild
|
||||
|
||||
adjust+:
|
||||
- because: "Plan to be ran when executed locally, or executed by CI system to gate a build or PR."
|
||||
# `commit` is used by Fedora CI, CentOS Stream CI, `build` by BaseOS CI
|
||||
when: >-
|
||||
trigger is defined
|
||||
and trigger != commit
|
||||
and trigger != build
|
||||
enabled: false
|
||||
6
plans/ci.fmf
Normal file
6
plans/ci.fmf
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
summary: CI Gating Plan
|
||||
discover:
|
||||
how: fmf
|
||||
directory: tests
|
||||
execute:
|
||||
how: beakerlib
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
#
|
||||
# Build/PR gating tests for binutils
|
||||
#
|
||||
|
||||
/common:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/binutils.git
|
||||
ref: main
|
||||
name: /plans/regression
|
||||
|
||||
adjust+:
|
||||
- because: "Plan to be ran when executed locally, or executed by CI system after updating an erratum/bodhi update."
|
||||
# `build` is used by Bodhi
|
||||
when: >-
|
||||
trigger is defined
|
||||
and trigger != build
|
||||
enabled: false
|
||||
2
sources
2
sources
|
|
@ -1,2 +1,2 @@
|
|||
SHA512 (binutils-with-gold-2.47.50-48c933a69a8.tar.xz) = c4300e4881227c431c0bbbb949a5ee5bc113701f993766418b152df7d46d9df378ebace9efffcb6e1f0b7e72ad716bbcccf5b6aa55851dc28216555b242d18a0
|
||||
SHA512 (binutils-2.35.2.tar.xz) = 9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348
|
||||
SHA512 (binutils-2.19.50.0.1-output-format.sed) = 2f8686b0c8af13c98cda056824c2820416f6e2d003f70b78ccf5314525b9ee3684d421dfa83e638a2d42d06ea4d4bdaf5226b64d6ec26f7ff59c44ffb2a23dd2
|
||||
|
|
|
|||
67
spec.binutils.cross
Normal file
67
spec.binutils.cross
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
|
||||
# Note - this is an rpm spec file, but it has been renamed in order to avoid
|
||||
# conflict with the real binutils.spec file.
|
||||
#
|
||||
# Its only use is to build a set of cross-binutils rpms by putting it into
|
||||
# the SPECS directory of an rpmbuild tree, installing the binutils source
|
||||
# rpm into the SOURCES directory and then running:
|
||||
#
|
||||
# rpmbuild -bb spec.binutils.cross
|
||||
|
||||
Summary: A meta collection of GNU binutils executables for cross builds
|
||||
Name: cross-binutils
|
||||
License: GPLv3+
|
||||
URL: https://sourceware.org/binutils
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# Configurable settings - adjust to match your needs:
|
||||
#
|
||||
|
||||
Version: 2.30
|
||||
Release: 89.el8
|
||||
|
||||
# The list of cross architectures to build.
|
||||
# Note: this list assumes that we are building on an x86_64-linux-gnu host.
|
||||
|
||||
%define arch_list aarch64-linux-gnu ppc64le-linux-gnu s390x-linux-gnu
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%define binutils_source_rpm binutils-%{version}-%{release}.src.rpm
|
||||
|
||||
Source: %{binutils_source_rpm}
|
||||
|
||||
# Provides: bundled(libiberty)
|
||||
|
||||
BuildRequires: autoconf automake
|
||||
BuildRequires: perl, sed, coreutils
|
||||
BuildRequires: gcc, bison
|
||||
BuildRequires: gettext, flex, zlib-devel
|
||||
BuildRequires: findutils, texinfo
|
||||
BuildRequires: dejagnu, zlib-static, glibc-static, sharutils, bc
|
||||
# BuildRequires: elfutils-debuginfod-client-devel
|
||||
BuildRequires: rpm-build
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%description
|
||||
Provides a collection of cross built binutils for the targets
|
||||
supported by RHEL (aarch64, ppc64le, s390x).
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%build
|
||||
|
||||
# Install the binutils sources.
|
||||
rpm -ivh %{_sourcedir}/%{binutils_source_rpm}
|
||||
|
||||
# Build each set of cross binutils individually.
|
||||
for f in %{arch_list}; do
|
||||
rpmbuild -bb --define "binutils_target $f" %{_specdir}/binutils.spec --without testsuite --without gold
|
||||
done
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
%changelog
|
||||
* Wed Nov 11 2020 Nick Clifton <nickc@redhat.com> - 2.35.1-14
|
||||
- First release of cross binutils rpm.
|
||||
2
tests/README
Normal file
2
tests/README
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
The test's Makefiles are not used in Fedora CI infrastructure. But are kept here
|
||||
for backward compatibility with traditional beakerlib test harness in RHEL.
|
||||
67
tests/Sanity/rebuild-kernel-and-reboot/Makefile
Normal file
67
tests/Sanity/rebuild-kernel-and-reboot/Makefile
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
# Copyright (c) 2009, 2012 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Rebuild kernel, install it, reboot, and check if we're running the correct
|
||||
# kernel. Tailored specificaly for binutils buildroot testing process.
|
||||
#
|
||||
# Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
#
|
||||
# Based on gcc/Sanity/rebuild-kernel by:
|
||||
# Author: Michal Nowak <mnowak@redhat.com>
|
||||
# Author: Marek Polacek <polacek@redhat.com>
|
||||
|
||||
|
||||
export TEST=/tools/binutils/Sanity/rebuild-kernel-and-reboot
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x ./runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Milos Prchlik <mprchlik@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Description: Rebuild kernel, install it, reboot, and check if we're running the correct kernel" >> $(METADATA)
|
||||
@echo "Type: Sanity" >> $(METADATA)
|
||||
@echo "TestTime: 20h" >> $(METADATA)
|
||||
@echo "RunFor: binutils" >> $(METADATA)
|
||||
@echo "Requires: binutils" >> $(METADATA)
|
||||
@echo "Requires: gcc" >> $(METADATA)
|
||||
@echo "Requires: yum-utils rng-tools" >> $(METADATA)
|
||||
@echo "Requires: rpm-build" >> $(METADATA)
|
||||
@echo "Requires: newt-devel python-devel perl-ExtUtils-Embed unifdef elfutils-libelf-devel" >> $(METADATA)
|
||||
@echo "Requires: elfutils-devel pciutils-devel" >> $(METADATA)
|
||||
@echo "Requires: wget hmaccalc binutils-devel glibc-static texinfo gdb ecj gcc-java ppl-devel cloog-ppl-devel graphviz gmp-devel mpfr-devel" >> $(METADATA)
|
||||
@echo "Requires: xmlto asciidoc net-tools pesign" >> $(METADATA)
|
||||
@echo "License: GPLv3+" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
20
tests/Sanity/rebuild-kernel-and-reboot/PURPOSE
Normal file
20
tests/Sanity/rebuild-kernel-and-reboot/PURPOSE
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
Rebuild kernel, install it, reboot, and check if we're running the correct
|
||||
kernel. Tailored specificaly for binutils buildroot testing process.
|
||||
|
||||
Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
|
||||
Based on gcc/Sanity/rebuild-kernel by:
|
||||
Author: Michal Nowak <mnowak@redhat.com>
|
||||
Author: Marek Polacek <polacek@redhat.com>
|
||||
|
||||
Using MACHINE_SET__STRONG host-filter for this test, by setting the "hardware"
|
||||
section in TCMS properly. That has several effects:
|
||||
|
||||
- kernel rebuild is very resoruce-intensive task, and having more powerful
|
||||
boxes for it is simply good,
|
||||
- this task will get its own boxes, not clobbered by additional kernel packages
|
||||
that are usually installed by other tasks in the same run. E.g.kernel-debuginfo,
|
||||
when installed, will conflict with freshly build kernel packages. This should
|
||||
workaround such situations,
|
||||
- this tasks reboots its boxes - should such reboot break something, don't ruin
|
||||
the whole run by it, right?
|
||||
62
tests/Sanity/rebuild-kernel-and-reboot/main.fmf
Normal file
62
tests/Sanity/rebuild-kernel-and-reboot/main.fmf
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
summary: Rebuild kernel, install it, reboot, and check if we're running the correct
|
||||
kernel
|
||||
description: |
|
||||
Rebuild kernel, install it, reboot, and check if we're running the correct
|
||||
kernel. Tailored specificaly for binutils buildroot testing process.
|
||||
|
||||
Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
|
||||
Based on gcc/Sanity/rebuild-kernel by:
|
||||
Author: Michal Nowak <mnowak@redhat.com>
|
||||
Author: Marek Polacek <polacek@redhat.com>
|
||||
|
||||
Using MACHINE_SET__STRONG host-filter for this test, by setting the "hardware"
|
||||
section in TCMS properly. That has several effects:
|
||||
|
||||
- kernel rebuild is very resoruce-intensive task, and having more powerful
|
||||
boxes for it is simply good,
|
||||
- this task will get its own boxes, not clobbered by additional kernel packages
|
||||
that are usually installed by other tasks in the same run. E.g.kernel-debuginfo,
|
||||
when installed, will conflict with freshly build kernel packages. This should
|
||||
workaround such situations,
|
||||
- this tasks reboots its boxes - should such reboot break something, don't ruin
|
||||
the whole run by it, right?
|
||||
contact:
|
||||
- Milos Prchlik <mprchlik@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
- gcc
|
||||
- yum-utils
|
||||
- rng-tools
|
||||
- rpm-build
|
||||
- newt-devel
|
||||
- python-devel
|
||||
- perl-ExtUtils-Embed
|
||||
- unifdef
|
||||
- elfutils-libelf-devel
|
||||
- elfutils-devel
|
||||
- pciutils-devel
|
||||
- wget
|
||||
- hmaccalc
|
||||
- binutils-devel
|
||||
- glibc-static
|
||||
- texinfo
|
||||
- gdb
|
||||
- ecj
|
||||
- gcc-java
|
||||
- ppl-devel
|
||||
- cloog-ppl-devel
|
||||
- graphviz
|
||||
- gmp-devel
|
||||
- mpfr-devel
|
||||
- xmlto
|
||||
- asciidoc
|
||||
- net-tools
|
||||
- pesign
|
||||
duration: 20h
|
||||
extra-summary: /tools/binutils/Sanity/rebuild-kernel-and-reboot
|
||||
extra-task: /tools/binutils/Sanity/rebuild-kernel-and-reboot
|
||||
200
tests/Sanity/rebuild-kernel-and-reboot/runtest.sh
Executable file
200
tests/Sanity/rebuild-kernel-and-reboot/runtest.sh
Executable file
|
|
@ -0,0 +1,200 @@
|
|||
#!/bin/bash
|
||||
# Copyright (c) 2009, 2012 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Rebuild kernel, install it, reboot, and check if we're running the correct
|
||||
# kernel. Tailored specificaly for binutils buildroot testing process.
|
||||
#
|
||||
# Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
#
|
||||
# Based on gcc/Sanity/rebuild-kernel by:
|
||||
# Author: Michal Nowak <mnowak@redhat.com>
|
||||
# Author: Marek Polacek <polacek@redhat.com>
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
export AVC_ERROR='+no_avc_check'
|
||||
|
||||
case "$JUST_BUILD" in
|
||||
0|[Ff][Aa][Ll][Ss][Ee]|[Nn][Oo])
|
||||
JUST_BUILD=no
|
||||
;;
|
||||
*)
|
||||
JUST_BUILD=yes
|
||||
;;
|
||||
esac
|
||||
|
||||
LD="${LD:-$(which ld)}"
|
||||
GCC="${GCC:-$(which gcc)}"
|
||||
|
||||
PACKAGE="${PACKAGE:-$(rpm --qf '%{name}\n' -qf $(which $LD) | head -1)}"
|
||||
GCC_PACKAGE="${GCC_PACKAGE:-$(rpm --qf '%{name}\n' -qf $(which $GCC) | head -1)}"
|
||||
|
||||
PACKAGES="${PACKAGES:-$PACKAGE}"
|
||||
|
||||
# Kernel package - usualy "kernel", but some trees may use different package
|
||||
# name (e.g. kernel-PAE).
|
||||
KERNEL="${KERNEL:-kernel}"
|
||||
|
||||
REQUIRES="${REQUIRES:-$KERNEL $GCC_PACKAGE glibc}"
|
||||
RPM_BUILD_ID="${RPM_BUILD_ID:-.LimeKitten}"
|
||||
|
||||
# Workaround possible restraint issues - restraint may fail to set REBOOTCOUNT properly.
|
||||
REBOOT_FLAG=/.rebuild-kernel-and-reboot.flag
|
||||
REBOOTCOUNT="${REBOOTCOUNT:-0}"
|
||||
|
||||
unset ARCH
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlLogInfo "PACKAGES=$PACKAGES"
|
||||
rlLogInfo "KERNEL=$KERNEL"
|
||||
rlLogInfo "REQUIRES=$REQUIRES"
|
||||
rlLogInfo "JUST_BUILD=$JUST_BUILD"
|
||||
rlLogInfo "COLLECTIONS=$COLLECTIONS"
|
||||
rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK"
|
||||
|
||||
# We'll use a lot of disk space (tens of GBs at least). The root FS
|
||||
# often is the most beefy one in CI environemnts. Let's use it but also
|
||||
# let's log what's actually available.
|
||||
export TMPDIR=/test_tmp_root
|
||||
rlRun "mkdir -p $TMPDIR"
|
||||
rlLogInfo "TMPDIR=$TMPDIR"
|
||||
rlLogInfo 'Disk space:'
|
||||
df -h | while read line; do
|
||||
rlLogInfo " $line"
|
||||
done
|
||||
|
||||
# We optionally need to skip checking for the presence of the metapackage
|
||||
# because that would pull in all the dependent toolset subrpms. We do not
|
||||
# always want that, especially in CI.
|
||||
_COLLECTIONS="$COLLECTIONS"
|
||||
if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then
|
||||
for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do
|
||||
rlLogInfo "ignoring metapackage check for collection $c"
|
||||
export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/})
|
||||
done
|
||||
fi
|
||||
|
||||
rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS"
|
||||
|
||||
rlAssertRpm --all
|
||||
|
||||
export COLLECTIONS="$_COLLECTIONS"
|
||||
|
||||
rlRun "AFTER_REBOOT=no"
|
||||
|
||||
if [ "$REBOOTCOUNT" != "0" ]; then
|
||||
rlLogInfo "Reboot count envvar is non-zero, update our flag"
|
||||
rlRun "AFTER_REBOOT=yes"
|
||||
elif [ -f "$REBOOT_FLAG" ]; then
|
||||
rlLogInfo "FS reboot flag exists, update our flag"
|
||||
rlRun "AFTER_REBOOT=yes"
|
||||
fi
|
||||
|
||||
if [ "$AFTER_REBOOT" = "no" ]; then
|
||||
# We optionally need to skip checking for the presence of the metapackage
|
||||
# because that would pull in all the dependent toolset subrpms. We do not
|
||||
# always want that, especially in CI.
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
|
||||
# Speed up keygen.
|
||||
rlRun "rngd -r /dev/hwrandom || rngd -r /dev/urandom"
|
||||
|
||||
# Get the SRPM.
|
||||
rlFetchSrcForInstalled "$KERNEL"
|
||||
|
||||
rlRun "SRPM=`find . -name '*.src.rpm'`"
|
||||
rlRun "SPECDIR=`rpm --define=\"_topdir $TmpDir\" --eval=%_specdir`"
|
||||
|
||||
rlRun "rpm -ivh --define=\"_topdir $TmpDir\" $SRPM"
|
||||
rlRun "SPECFILE=`find $SPECDIR/ -name '*.spec'`"
|
||||
|
||||
builddep_options="--nobest"
|
||||
rlRun "yum-builddep -y $builddep_options $SPECFILE"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
if [ "$AFTER_REBOOT" = "no" ]; then
|
||||
rlPhaseStartTest "Build"
|
||||
if [ "$RPM_BUILD_ID" != "" ]; then
|
||||
rlRun "sed -i \"s/# % define buildid .local/%define buildid $RPM_BUILD_ID/\" $SPECFILE"
|
||||
rlRun "sed -i \"s/# define buildid .local/%define buildid $RPM_BUILD_ID/\" $SPECFILE"
|
||||
fi
|
||||
|
||||
if [ "`rlGetPrimaryArch`" == "ppc64" ]; then
|
||||
TARGET="--target=ppc64"
|
||||
else
|
||||
TARGET="--target=$(uname -m)"
|
||||
fi
|
||||
|
||||
if rlRun "CC=$GCC rpmbuild --define=\"_topdir $TmpDir\" -bb $TARGET --clean $SPECFILE &> BUILD_LOG"; then
|
||||
rlRun "RPMBUILD_OK=yes"
|
||||
else
|
||||
rlLogInfo "rpmbuild kernel failed"
|
||||
rlRun "RPMBUILD_OK=no"
|
||||
fi
|
||||
rlBundleLogs "Build-log" BUILD_LOG
|
||||
rlPhaseEnd
|
||||
|
||||
# Install and boot the new kernel only if it's requested *and* the build was successful
|
||||
if [ "$JUST_BUILD" = 'no' ] && [ "$RPMBUILD_OK" = "yes" ]; then
|
||||
rlPhaseStartTest "Install"
|
||||
RPMS="$(ls -1 $TmpDir/RPMS/*/*.rpm | grep -v kernel-selftests-internal | tr '\n' ' ')"
|
||||
|
||||
rlRun "yum localinstall -y --disablerepo=\* $RPMS"
|
||||
|
||||
rlLogInfo "$(rpm -qa | grep kernel | sort)"
|
||||
|
||||
# Update the boot configuration
|
||||
if [ "$(arch)" = "s390x" ]; then
|
||||
rlRun "grubby --info=ALL"
|
||||
rlLogInfo "Default kernel is $(grubby --default-kernel), index $(grubby --default-index)"
|
||||
rlRun "KERNEL_FILE=$(ls -1 /boot/vmlinuz-*${RPM_BUILD_ID}.$(arch))"
|
||||
rlRun "ls -al $KERNEL_FILE"
|
||||
rlRun "grubby --set-default $KERNEL_FILE"
|
||||
rlLogInfo "Default kernel is $(grubby --default-kernel), index $(grubby --default-index)"
|
||||
rlRun "zipl"
|
||||
else
|
||||
rlRun "grub2-set-default 2"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Reboot"
|
||||
rlRun "touch $REBOOT_FLAG"
|
||||
|
||||
rlLog "Rebooting ..."
|
||||
rhts-reboot
|
||||
rlPhaseEnd
|
||||
fi
|
||||
fi
|
||||
|
||||
# Verify the build ID only if its install and boot were requested
|
||||
if [ "$JUST_BUILD" = 'no' ]; then
|
||||
rlPhaseStartTest "Test"
|
||||
if ! [ "$AFTER_REBOOT" = 'yes' ]; then
|
||||
rlFail 'Not rebooted. Probably rhts-reboot did not work.'
|
||||
fi
|
||||
rlLogInfo "$(uname -a)"
|
||||
rlRun "uname -r | grep $RPM_BUILD_ID"
|
||||
rlPhaseEnd
|
||||
fi
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
Loading…
Add table
Add a link
Reference in a new issue