Compare commits
No commits in common. "c8" and "c9-beta" have entirely different histories.
@ -1,2 +1 @@
|
||||
574d3b5650413d6ee65195a4f5ecbddc3a38f718 SOURCES/binutils-2.30.tar.xz
|
||||
d3e5c9fc829ed40648110da6fe46c2fb1ed8aadb SOURCES/standards.info.gz
|
||||
2dd8d1ce34dc7b1cb2073123e30c4901221835b0 SOURCES/binutils-2.35.2.tar.xz
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1 @@
|
||||
SOURCES/binutils-2.30.tar.xz
|
||||
SOURCES/standards.info.gz
|
||||
SOURCES/binutils-2.35.2.tar.xz
|
||||
|
@ -1,21 +0,0 @@
|
||||
--- a/bfd/Makefile.am 2012-03-06 14:00:33.229957572 +0000
|
||||
+++ b/bfd/Makefile.am 2012-04-27 16:46:05.410974817 +0100
|
||||
@@ -18,7 +18,7 @@
|
||||
bfdlibdir = @bfdlibdir@
|
||||
bfdincludedir = @bfdincludedir@
|
||||
bfdlib_LTLIBRARIES = libbfd.la
|
||||
-bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h
|
||||
+bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
|
||||
else !INSTALL_LIBBFD
|
||||
# Empty these so that the respective installation directories will not be created.
|
||||
bfdlibdir =
|
||||
--- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:23:35.054721634 +0000
|
||||
+++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:25:59.292607840 +0000
|
||||
@@ -350,6 +350,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel
|
||||
@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)/demangle.h \
|
||||
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2)
|
||||
@INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@
|
||||
@INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la
|
File diff suppressed because it is too large
Load Diff
@ -1,14 +0,0 @@
|
||||
diff -rup binutils.orig/ld/ldmain.c binutils-2.28/ld/ldmain.c
|
||||
--- binutils.orig/ld/ldmain.c 2017-06-09 09:08:26.954016429 +0100
|
||||
+++ binutils-2.28/ld/ldmain.c 2017-06-09 09:09:11.307490976 +0100
|
||||
@@ -923,6 +923,10 @@ multiple_definition (struct bfd_link_inf
|
||||
obfd = h->u.def.section->owner;
|
||||
break;
|
||||
case bfd_link_hash_indirect:
|
||||
+ /* PR 21074: The GOLD linker can produce multiple indirect
|
||||
+ refences to the same symbol. These can be ignored. */
|
||||
+ if (bfd_is_ind_section (nsec))
|
||||
+ return;
|
||||
osec = bfd_ind_section_ptr;
|
||||
oval = 0;
|
||||
obfd = NULL;
|
@ -1,6 +1,6 @@
|
||||
--- binutils.orig/binutils/readelf.c 2018-01-22 15:48:10.450701702 +0000
|
||||
+++ binutils-2.30.0/binutils/readelf.c 2018-01-22 15:55:26.739588657 +0000
|
||||
@@ -19019,75 +19019,85 @@ process_file (char * file_name)
|
||||
--- 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];
|
||||
@ -61,64 +61,85 @@
|
||||
if (fread (armag, SARMAG, 1, filedata->handle) != 1)
|
||||
{
|
||||
- error (_("%s: Failed to read file's magic number\n"), file_name);
|
||||
- fclose (filedata->handle);
|
||||
+ error (_("Failed to read file's magic number\n"));
|
||||
fclose (filedata->handle);
|
||||
- free (filedata);
|
||||
- return FALSE;
|
||||
- }
|
||||
-
|
||||
- filedata->file_size = (bfd_size_type) statbuf.st_size;
|
||||
-
|
||||
- if (memcmp (armag, ARMAG, SARMAG) == 0)
|
||||
- {
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
filedata->file_size = (bfd_size_type) statbuf.st_size;
|
||||
|
||||
if (memcmp (armag, ARMAG, SARMAG) == 0)
|
||||
{
|
||||
- if (! process_archive (filedata, FALSE))
|
||||
- ret = FALSE;
|
||||
- }
|
||||
- else if (memcmp (armag, ARMAGT, SARMAG) == 0)
|
||||
- {
|
||||
+ if (process_archive (filedata, FALSE))
|
||||
+ ret = TRUE;
|
||||
}
|
||||
else if (memcmp (armag, ARMAGT, SARMAG) == 0)
|
||||
{
|
||||
- if ( ! process_archive (filedata, TRUE))
|
||||
- ret = FALSE;
|
||||
+ error (_("Failed to read file's magic number\n"));
|
||||
+ if (process_archive (filedata, TRUE))
|
||||
+ ret = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (do_archive_index)
|
||||
if (do_archive_index && !check_all)
|
||||
- error (_("File %s is not an archive so its index cannot be displayed.\n"),
|
||||
- file_name);
|
||||
+ filedata->file_size = (bfd_size_type) statbuf.st_size;
|
||||
+ error (_("Not an archive so its index cannot be displayed.\n"));
|
||||
|
||||
rewind (filedata->handle);
|
||||
filedata->archive_file_size = filedata->archive_file_offset = 0;
|
||||
|
||||
- rewind (filedata->handle);
|
||||
- archive_file_size = archive_file_offset = 0;
|
||||
-
|
||||
- if (! process_object (filedata))
|
||||
- ret = FALSE;
|
||||
+ if (memcmp (armag, ARMAG, SARMAG) == 0)
|
||||
+ {
|
||||
+ if (process_archive (filedata, FALSE))
|
||||
+ ret = TRUE;
|
||||
+ }
|
||||
+ else if (memcmp (armag, ARMAGT, SARMAG) == 0)
|
||||
+ {
|
||||
+ if (process_archive (filedata, TRUE))
|
||||
+ ret = TRUE;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (do_archive_index)
|
||||
+ error (_("Not an archive so its index cannot be displayed.\n"));
|
||||
+
|
||||
+ rewind (filedata->handle);
|
||||
+ archive_file_size = archive_file_offset = 0;
|
||||
+
|
||||
+ if (process_object (filedata))
|
||||
+ ret = TRUE;
|
||||
+ }
|
||||
}
|
||||
|
||||
fclose (filedata->handle);
|
||||
- fclose (filedata->handle);
|
||||
- free (filedata->section_headers);
|
||||
- free (filedata->program_headers);
|
||||
- free (filedata->string_table);
|
||||
- free (filedata->dump.dump_sects);
|
||||
- free (filedata);
|
||||
+ done:
|
||||
free (filedata);
|
||||
+ 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;
|
||||
|
||||
return ret;
|
||||
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;
|
||||
}
|
||||
|
||||
|
265
SOURCES/binutils-2.29-revert-PLT-elision.patch
Normal file
265
SOURCES/binutils-2.29-revert-PLT-elision.patch
Normal file
@ -0,0 +1,265 @@
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 13:32:39.335065263 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 15:03:55.649727195 +0000
|
||||
@@ -2,6 +2,7 @@
|
||||
#readelf: -S --wide
|
||||
#as: --32
|
||||
|
||||
+#pass
|
||||
#...
|
||||
+\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 13:32:39.329065335 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 15:04:20.803430034 +0000
|
||||
@@ -3,7 +3,6 @@
|
||||
#readelf: -d --wide
|
||||
#as: --32
|
||||
|
||||
-#failif
|
||||
#...
|
||||
+0x[0-9a-f]+ +\(PLTREL.*
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 13:32:39.336065251 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 15:03:00.413379749 +0000
|
||||
@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
|
||||
-
|
||||
+#...
|
||||
Symbol table '\.dynsym' contains [0-9]+ entries:
|
||||
+Num: +Value +Size Type +Bind +Vis +Ndx Name
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 13:32:39.330065323 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 15:03:28.928042882 +0000
|
||||
@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
|
||||
-
|
||||
+#...
|
||||
Symbol table '\.dynsym' contains [0-9]+ entries:
|
||||
+Num: +Value +Size Type +Bind +Vis +Ndx Name
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 13:32:39.415064300 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 15:08:39.333375801 +0000
|
||||
@@ -2,8 +2,4 @@
|
||||
#readelf: -S --wide
|
||||
#as: --64
|
||||
|
||||
-#...
|
||||
- +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
|
||||
-#...
|
||||
- +\[ *[0-9]+\] \.got\.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+18 +.*
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 13:32:39.404064432 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 15:08:59.031143095 +0000
|
||||
@@ -3,7 +3,6 @@
|
||||
#readelf: -d --wide
|
||||
#as: --64
|
||||
|
||||
-#failif
|
||||
#...
|
||||
+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
|
||||
@@ -1,4 +1,3 @@
|
||||
-#failif
|
||||
#...
|
||||
[0-9a-f ]+R_X86_64_JUMP_SLOT +0+ +bar \+ 0
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 13:32:39.412064336 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 15:15:09.918750288 +0000
|
||||
@@ -20,6 +20,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=00000000000001c8..00000000000001d4
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 13:32:39.413064324 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 15:16:08.227055104 +0000
|
||||
@@ -20,6 +20,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=00000000000001c8..00000000000001d4
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 13:32:39.413064324 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 15:16:20.115913358 +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 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 13:32:39.411064348 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 15:16:29.012807282 +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 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
|
||||
@@ -14,6 +14,7 @@ Section Headers:
|
||||
+\[[ 0-9]+\] .dynsym +.*
|
||||
+\[[ 0-9]+\] .dynstr +.*
|
||||
+\[[ 0-9]+\] .rela.dyn +.*
|
||||
+#pass
|
||||
+\[[ 0-9]+\] .plt +.*
|
||||
+\[[ 0-9]+\] .plt.got +.*
|
||||
+\[[ 0-9]+\] .text +PROGBITS +0+1000 0+1000 0+31a 00 +AX +0 +0 4096
|
||||
--- binutils.orig/bfd/elfxx-x86.c 2018-01-22 15:59:25.875788033 +0000
|
||||
+++ binutils-2.30.0/bfd/elfxx-x86.c 2018-01-22 16:00:20.789146597 +0000
|
||||
@@ -107,7 +107,7 @@ elf_x86_allocate_dynrelocs (struct elf_l
|
||||
plt_entry_size = htab->plt.plt_entry_size;
|
||||
|
||||
resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh);
|
||||
-
|
||||
+#if 0
|
||||
/* We can't use the GOT PLT if pointer equality is needed since
|
||||
finish_dynamic_symbol won't clear symbol value and the dynamic
|
||||
linker won't update the GOT slot. We will get into an infinite
|
||||
@@ -125,7 +125,7 @@ elf_x86_allocate_dynrelocs (struct elf_l
|
||||
/* Use the GOT PLT. */
|
||||
eh->plt_got.refcount = 1;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
/* Since STT_GNU_IFUNC symbol must go through PLT, we handle it
|
||||
here if it is defined and referenced in a non-shared object. */
|
||||
if (h->type == STT_GNU_IFUNC
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pr20830.d 2018-07-09 09:49:51.277239857 +0100
|
||||
+++ binutils-2.30.90/ld/testsuite/ld-i386/pr20830.d 2018-07-09 10:32:41.113356733 +0100
|
||||
@@ -19,7 +19,7 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r8 \(eip\) at cfa-4
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
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
|
@ -1,147 +0,0 @@
|
||||
From 279b2f94168ee91e02ccd070d27c983fc001fe12 Mon Sep 17 00:00:00 2001
|
||||
From: Renlin Li <renlin.li@arm.com>
|
||||
Date: Sat, 3 Feb 2018 13:18:17 +0000
|
||||
Subject: [PATCH] [PR22764][LD][AARCH64]Allow R_AARCH64_ABS16 and
|
||||
R_AARCH64_ABS32 against absolution symbol or undefine symbol in shared
|
||||
object.
|
||||
|
||||
The assumption that R_AARCH64_ABS16 and R_AARCH64_ABS32 relocation in LP64 abi
|
||||
will be used to generate an address does not hold for absolute symbol.
|
||||
In this case, it is a value fixed at static linking time.
|
||||
|
||||
The condition to check the relocations is relax to allow absolute symbol and
|
||||
undefined symbol case.
|
||||
|
||||
bfd/
|
||||
|
||||
2018-02-05 Renlin Li <renlin.li@arm.com>
|
||||
|
||||
PR ld/22764
|
||||
* elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the
|
||||
R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the
|
||||
check for writeable section as well.
|
||||
|
||||
ld/
|
||||
|
||||
2018-02-05 Renlin Li <renlin.li@arm.com>
|
||||
|
||||
PR ld/22764
|
||||
* testsuite/ld-aarch64/emit-relocs-258.s: Define symbol as an address.
|
||||
* testsuite/ld-aarch64/emit-relocs-259.s: Likewise.
|
||||
* testsuite/ld-aarch64/aarch64-elf.exp: Run new test.
|
||||
* testsuite/ld-aarch64/pr22764.s: New.
|
||||
* testsuite/ld-aarch64/pr22764.d: New.
|
||||
---
|
||||
bfd/ChangeLog | 7 +++++++
|
||||
bfd/elfnn-aarch64.c | 15 ++++++++++++---
|
||||
ld/ChangeLog | 8 ++++++++
|
||||
ld/testsuite/ld-aarch64/aarch64-elf.exp | 1 +
|
||||
ld/testsuite/ld-aarch64/emit-relocs-258.s | 3 ++-
|
||||
ld/testsuite/ld-aarch64/emit-relocs-259.s | 3 ++-
|
||||
ld/testsuite/ld-aarch64/pr22764.d | 18 ++++++++++++++++++
|
||||
ld/testsuite/ld-aarch64/pr22764.s | 6 ++++++
|
||||
8 files changed, 56 insertions(+), 5 deletions(-)
|
||||
create mode 100644 ld/testsuite/ld-aarch64/pr22764.d
|
||||
create mode 100644 ld/testsuite/ld-aarch64/pr22764.s
|
||||
|
||||
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
|
||||
index af448f9..2737773 100644
|
||||
--- a/bfd/elfnn-aarch64.c
|
||||
+++ b/bfd/elfnn-aarch64.c
|
||||
@@ -7189,10 +7189,19 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
#if ARCH_SIZE == 64
|
||||
case BFD_RELOC_AARCH64_32:
|
||||
#endif
|
||||
- if (bfd_link_pic (info)
|
||||
- && (sec->flags & SEC_ALLOC) != 0
|
||||
- && (sec->flags & SEC_READONLY) != 0)
|
||||
+ if (bfd_link_pic (info) && (sec->flags & SEC_ALLOC) != 0)
|
||||
{
|
||||
+ if (h != NULL
|
||||
+ /* This is an absolute symbol. It represents a value instead
|
||||
+ of an address. */
|
||||
+ && ((h->root.type == bfd_link_hash_defined
|
||||
+ && bfd_is_abs_section (h->root.u.def.section))
|
||||
+ /* This is an undefined symbol. */
|
||||
+ || h->root.type == bfd_link_hash_undefined))
|
||||
+ break;
|
||||
+
|
||||
+ /* For local symbols, defined global symbols in a non-ABS section,
|
||||
+ it is assumed that the value is an address. */
|
||||
int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START;
|
||||
_bfd_error_handler
|
||||
/* xgettext:c-format */
|
||||
diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp
|
||||
index 2602a43..c67ffb1 100644
|
||||
--- a/ld/testsuite/ld-aarch64/aarch64-elf.exp
|
||||
+++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp
|
||||
@@ -285,6 +285,7 @@ run_dump_test "pr17415"
|
||||
run_dump_test_lp64 "tprel_g2_overflow"
|
||||
run_dump_test "tprel_add_lo12_overflow"
|
||||
run_dump_test "protected-data"
|
||||
+run_dump_test_lp64 "pr22764"
|
||||
|
||||
# ifunc tests
|
||||
run_dump_test "ifunc-1"
|
||||
diff --git a/ld/testsuite/ld-aarch64/emit-relocs-258.s b/ld/testsuite/ld-aarch64/emit-relocs-258.s
|
||||
index f724776..87bb657 100644
|
||||
--- a/ld/testsuite/ld-aarch64/emit-relocs-258.s
|
||||
+++ b/ld/testsuite/ld-aarch64/emit-relocs-258.s
|
||||
@@ -1,5 +1,6 @@
|
||||
+.global dummy
|
||||
.text
|
||||
-
|
||||
+dummy:
|
||||
ldr x0, .L1
|
||||
|
||||
.L1:
|
||||
diff --git a/ld/testsuite/ld-aarch64/emit-relocs-259.s b/ld/testsuite/ld-aarch64/emit-relocs-259.s
|
||||
index 7e1ba3c..0977c9d 100644
|
||||
--- a/ld/testsuite/ld-aarch64/emit-relocs-259.s
|
||||
+++ b/ld/testsuite/ld-aarch64/emit-relocs-259.s
|
||||
@@ -1,5 +1,6 @@
|
||||
+.global dummy
|
||||
.text
|
||||
-
|
||||
+dummy:
|
||||
ldr x0, .L1
|
||||
|
||||
.L1:
|
||||
diff --git a/ld/testsuite/ld-aarch64/pr22764.d b/ld/testsuite/ld-aarch64/pr22764.d
|
||||
new file mode 100644
|
||||
index 0000000..997519f
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-aarch64/pr22764.d
|
||||
@@ -0,0 +1,18 @@
|
||||
+#source: pr22764.s
|
||||
+#ld: -shared -T relocs.ld -defsym sym_abs1=0x1 -defsym sym_abs2=0x2 -defsym sym_abs3=0x3 -e0 --emit-relocs
|
||||
+#notarget: aarch64_be-*-*
|
||||
+#objdump: -dr
|
||||
+#...
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+0000000000010000 \<\.text\>:
|
||||
+ 10000: d503201f nop
|
||||
+ ...
|
||||
+ 10004: R_AARCH64_ABS64 sym_abs1
|
||||
+ 1000c: 00000002 \.word 0x00000002
|
||||
+ 1000c: R_AARCH64_ABS32 sym_abs2
|
||||
+ 10010: 0003 \.short 0x0003
|
||||
+ 10010: R_AARCH64_ABS16 sym_abs3
|
||||
+ 10012: 0000 \.short 0x0000
|
||||
+ 10014: d503201f nop
|
||||
diff --git a/ld/testsuite/ld-aarch64/pr22764.s b/ld/testsuite/ld-aarch64/pr22764.s
|
||||
new file mode 100644
|
||||
index 0000000..25e36b4
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-aarch64/pr22764.s
|
||||
@@ -0,0 +1,6 @@
|
||||
+ .text
|
||||
+ nop
|
||||
+ .xword sym_abs1
|
||||
+ .word sym_abs2
|
||||
+ .short sym_abs3
|
||||
+ nop
|
||||
--
|
||||
2.9.3
|
937
SOURCES/binutils-AArch64-EFI.patch
Normal file
937
SOURCES/binutils-AArch64-EFI.patch
Normal file
@ -0,0 +1,937 @@
|
||||
diff -rup binutils.orig/bfd/.gitignore binutils-2.35.2/bfd/.gitignore
|
||||
--- binutils.orig/bfd/.gitignore 2021-11-30 13:38:24.349744247 +0000
|
||||
+++ binutils-2.35.2/bfd/.gitignore 2021-11-30 13:38:37.236657064 +0000
|
||||
@@ -11,6 +11,7 @@
|
||||
/peigen.c
|
||||
/pepigen.c
|
||||
/pex64igen.c
|
||||
+/pe-aarch64igen.c
|
||||
/stmp-bfd-h
|
||||
/targmatch.h
|
||||
|
||||
diff -rup binutils.orig/bfd/Makefile.am binutils-2.35.2/bfd/Makefile.am
|
||||
--- binutils.orig/bfd/Makefile.am 2021-11-30 13:38:24.358744186 +0000
|
||||
+++ binutils-2.35.2/bfd/Makefile.am 2021-11-30 13:38:37.237657058 +0000
|
||||
@@ -571,7 +571,9 @@ BFD64_BACKENDS = \
|
||||
mach-o-aarch64.lo \
|
||||
mach-o-x86-64.lo \
|
||||
mmo.lo \
|
||||
+ pe-aarch64igen.lo \
|
||||
pe-x86_64.lo \
|
||||
+ pei-aarch64lo \
|
||||
pei-ia64.lo \
|
||||
pei-x86_64.lo \
|
||||
pepigen.lo \
|
||||
@@ -611,6 +613,7 @@ BFD64_BACKENDS_CFILES = \
|
||||
mach-o-x86-64.c \
|
||||
mmo.c \
|
||||
pe-x86_64.c \
|
||||
+ pei-aarch64.c \
|
||||
pei-ia64.c \
|
||||
pei-x86_64.c \
|
||||
vms-alpha.c
|
||||
@@ -670,7 +673,7 @@ BUILD_CFILES = \
|
||||
elf32-aarch64.c elf64-aarch64.c \
|
||||
elf32-ia64.c elf64-ia64.c \
|
||||
elf32-riscv.c elf64-riscv.c \
|
||||
- peigen.c pepigen.c pex64igen.c
|
||||
+ peigen.c pepigen.c pex64igen.c pe-aarch64igen.c
|
||||
|
||||
CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
|
||||
|
||||
@@ -866,6 +869,10 @@ pex64igen.c: peXXigen.c
|
||||
echo "#line 1 \"peXXigen.c\"" > $@
|
||||
$(SED) -e s/XX/pex64/g < $< >> $@
|
||||
|
||||
+pe-aarch64igen.c: peXXigen.c
|
||||
+ echo "#line 1 \"peXXigen.c\"" > $@
|
||||
+ $(SED) -e s/XX/peAArch64/g < $< >> $@
|
||||
+
|
||||
BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/diagnostics.h
|
||||
LOCAL_H_DEPS= libbfd.h sysdep.h config.h bfd_stdint.h
|
||||
$(BFD32_LIBS) \
|
||||
diff -rup binutils.orig/bfd/Makefile.in binutils-2.35.2/bfd/Makefile.in
|
||||
--- binutils.orig/bfd/Makefile.in 2021-11-30 13:38:24.346744267 +0000
|
||||
+++ binutils-2.35.2/bfd/Makefile.in 2021-11-30 13:38:37.238657051 +0000
|
||||
@@ -997,7 +997,9 @@ BFD64_BACKENDS = \
|
||||
mach-o-aarch64.lo \
|
||||
mach-o-x86-64.lo \
|
||||
mmo.lo \
|
||||
+ pe-aarch64igen.lo \
|
||||
pe-x86_64.lo \
|
||||
+ pei-aarch64.lo \
|
||||
pei-ia64.lo \
|
||||
pei-x86_64.lo \
|
||||
pepigen.lo \
|
||||
@@ -1037,6 +1039,7 @@ BFD64_BACKENDS_CFILES = \
|
||||
mach-o-x86-64.c \
|
||||
mmo.c \
|
||||
pe-x86_64.c \
|
||||
+ pei-aarch64.c \
|
||||
pei-ia64.c \
|
||||
pei-x86_64.c \
|
||||
vms-alpha.c
|
||||
@@ -1095,7 +1098,7 @@ BUILD_CFILES = \
|
||||
elf32-aarch64.c elf64-aarch64.c \
|
||||
elf32-ia64.c elf64-ia64.c \
|
||||
elf32-riscv.c elf64-riscv.c \
|
||||
- peigen.c pepigen.c pex64igen.c
|
||||
+ peigen.c pepigen.c pex64igen.c pe-aarch64igen.c
|
||||
|
||||
CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
|
||||
SOURCE_HFILES = \
|
||||
@@ -1556,9 +1559,11 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-ppc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-sh.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-x86_64.Plo@am__quote@
|
||||
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-aarch64.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peigen.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pepigen.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pex64igen.Plo@am__quote@
|
||||
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe-aarch64igen.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppcboot.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reloc.Plo@am__quote@
|
||||
@@ -1996,6 +2001,11 @@ pepigen.c : peXXigen.c
|
||||
pex64igen.c: peXXigen.c
|
||||
echo "#line 1 \"peXXigen.c\"" > $@
|
||||
$(SED) -e s/XX/pex64/g < $< >> $@
|
||||
+
|
||||
+pe-aarch64igen.c: peXXigen.c
|
||||
+ echo "#line 1 \"peXXigen.c\"" > $@
|
||||
+ $(SED) -e s/XX/peAArch64/g < $< >> $@
|
||||
+
|
||||
$(BFD32_LIBS) \
|
||||
$(BFD64_LIBS) \
|
||||
$(ALL_MACHINES) \
|
||||
diff -rup binutils.orig/bfd/bfd.c binutils-2.35.2/bfd/bfd.c
|
||||
--- binutils.orig/bfd/bfd.c 2021-11-30 13:38:24.344744281 +0000
|
||||
+++ binutils-2.35.2/bfd/bfd.c 2021-11-30 13:38:37.239657044 +0000
|
||||
@@ -1747,6 +1747,7 @@ bfd_get_sign_extend_vma (bfd *abfd)
|
||||
|| strcmp (name, "pei-i386") == 0
|
||||
|| strcmp (name, "pe-x86-64") == 0
|
||||
|| strcmp (name, "pei-x86-64") == 0
|
||||
+ || strcmp (name, "pei-aarch64-little") == 0
|
||||
|| strcmp (name, "pe-arm-wince-little") == 0
|
||||
|| strcmp (name, "pei-arm-wince-little") == 0
|
||||
|| strcmp (name, "aixcoff-rs6000") == 0
|
||||
diff -rup binutils.orig/bfd/coffcode.h binutils-2.35.2/bfd/coffcode.h
|
||||
--- binutils.orig/bfd/coffcode.h 2021-11-30 13:38:24.345744274 +0000
|
||||
+++ binutils-2.35.2/bfd/coffcode.h 2021-11-30 13:38:37.242657024 +0000
|
||||
@@ -2195,6 +2195,12 @@ coff_set_arch_mach_hook (bfd *abfd, void
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
+#ifdef AARCH64MAGIC
|
||||
+ case AARCH64MAGIC:
|
||||
+ arch = bfd_arch_aarch64;
|
||||
+ machine = internal_f->f_flags & F_AARCH64_ARCHITECTURE_MASK;
|
||||
+ break;
|
||||
+#endif
|
||||
#ifdef Z80MAGIC
|
||||
case Z80MAGIC:
|
||||
arch = bfd_arch_z80;
|
||||
@@ -2751,6 +2757,12 @@ coff_set_flags (bfd * abfd,
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
+#ifdef AARCH64MAGIC
|
||||
+ case bfd_arch_aarch64:
|
||||
+ * magicp = AARCH64MAGIC;
|
||||
+ return TRUE;
|
||||
+#endif
|
||||
+
|
||||
#ifdef ARMMAGIC
|
||||
case bfd_arch_arm:
|
||||
#ifdef ARM_WINCE
|
||||
@@ -3841,7 +3853,7 @@ coff_write_object_contents (bfd * abfd)
|
||||
internal_f.f_flags |= IMAGE_FILE_LARGE_ADDRESS_AWARE;
|
||||
#endif
|
||||
|
||||
-#ifndef COFF_WITH_pex64
|
||||
+#if !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
#ifdef COFF_WITH_PE
|
||||
internal_f.f_flags |= IMAGE_FILE_32BIT_MACHINE;
|
||||
#else
|
||||
@@ -3895,6 +3907,11 @@ coff_write_object_contents (bfd * abfd)
|
||||
internal_a.magic = IMAGE_NT_OPTIONAL_HDR_MAGIC;
|
||||
#endif
|
||||
|
||||
+#if defined(AARCH64)
|
||||
+#define __A_MAGIC_SET__
|
||||
+ internal_a.magic = ZMAGIC;
|
||||
+#endif
|
||||
+
|
||||
#if defined MCORE_PE
|
||||
#define __A_MAGIC_SET__
|
||||
internal_a.magic = IMAGE_NT_OPTIONAL_HDR_MAGIC;
|
||||
diff -rup binutils.orig/bfd/config.bfd binutils-2.35.2/bfd/config.bfd
|
||||
--- binutils.orig/bfd/config.bfd 2021-11-30 13:38:24.358744186 +0000
|
||||
+++ binutils-2.35.2/bfd/config.bfd 2021-11-30 13:41:24.512525484 +0000
|
||||
@@ -256,12 +256,12 @@ case "${targ}" in
|
||||
;;
|
||||
aarch64-*-linux*)
|
||||
targ_defvec=aarch64_elf64_le_vec
|
||||
- targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"
|
||||
+ targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec aarch64_pei_vec"
|
||||
want64=true
|
||||
;;
|
||||
aarch64_be-*-linux*)
|
||||
targ_defvec=aarch64_elf64_be_vec
|
||||
- targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec"
|
||||
+ targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec aarch64_pei_vec"
|
||||
want64=true
|
||||
;;
|
||||
alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
|
||||
diff -rup binutils.orig/bfd/configure binutils-2.35.2/bfd/configure
|
||||
--- binutils.orig/bfd/configure 2021-11-30 13:38:24.358744186 +0000
|
||||
+++ binutils-2.35.2/bfd/configure 2021-11-30 13:38:37.250656970 +0000
|
||||
@@ -14738,6 +14738,7 @@ do
|
||||
aarch64_elf64_le_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
|
||||
aarch64_elf64_le_cloudabi_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
|
||||
aarch64_mach_o_vec) tb="$tb mach-o-aarch64.lo"; target_size=64 ;;
|
||||
+ aarch64_pei_vec) tb="$tb pei-aarch64.lo pe-aarch64igen.lo $coff"; target_size=64 ;;
|
||||
alpha_ecoff_le_vec) tb="$tb coff-alpha.lo ecoff.lo $ecoff"; target_size=64 ;;
|
||||
alpha_elf64_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
|
||||
alpha_elf64_fbsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
|
||||
diff -rup binutils.orig/bfd/configure.ac binutils-2.35.2/bfd/configure.ac
|
||||
--- binutils.orig/bfd/configure.ac 2021-11-30 13:38:24.354744213 +0000
|
||||
+++ binutils-2.35.2/bfd/configure.ac 2021-11-30 13:38:37.251656963 +0000
|
||||
@@ -450,6 +450,7 @@ do
|
||||
aarch64_elf64_le_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
|
||||
aarch64_elf64_le_cloudabi_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
|
||||
aarch64_mach_o_vec) tb="$tb mach-o-aarch64.lo"; target_size=64 ;;
|
||||
+ aarch64_pei_vec) tb="$tb pei-aarch64.lo pe-aarch64igen.lo $coff"; target_size=64 ;;
|
||||
alpha_ecoff_le_vec) tb="$tb coff-alpha.lo ecoff.lo $ecoff"; target_size=64 ;;
|
||||
alpha_elf64_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
|
||||
alpha_elf64_fbsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
|
||||
diff -rup binutils.orig/bfd/libpei.h binutils-2.35.2/bfd/libpei.h
|
||||
--- binutils.orig/bfd/libpei.h 2021-11-30 13:38:24.355744206 +0000
|
||||
+++ binutils-2.35.2/bfd/libpei.h 2021-11-30 13:41:57.744300692 +0000
|
||||
@@ -275,6 +275,41 @@
|
||||
#define _bfd_XXi_write_codeview_record _bfd_pepi_write_codeview_record
|
||||
#define _bfd_XXi_slurp_codeview_record _bfd_pepi_slurp_codeview_record
|
||||
|
||||
+#elif defined COFF_WITH_peAArch64
|
||||
+
|
||||
+#define GET_OPTHDR_IMAGE_BASE H_GET_64
|
||||
+#define PUT_OPTHDR_IMAGE_BASE H_PUT_64
|
||||
+#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
|
||||
+#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
|
||||
+#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
|
||||
+#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
|
||||
+#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
|
||||
+#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
|
||||
+#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
|
||||
+#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
|
||||
+#define GET_PDATA_ENTRY bfd_get_32
|
||||
+
|
||||
+#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_peAArch64_bfd_copy_private_bfd_data_common
|
||||
+#define _bfd_XX_bfd_copy_private_section_data _bfd_peAArch64_bfd_copy_private_section_data
|
||||
+#define _bfd_XX_get_symbol_info _bfd_peAArch64_get_symbol_info
|
||||
+#define _bfd_XX_only_swap_filehdr_out _bfd_peAArch64_only_swap_filehdr_out
|
||||
+#define _bfd_XX_print_private_bfd_data_common _bfd_peAArch64_print_private_bfd_data_common
|
||||
+#define _bfd_XXi_final_link_postscript _bfd_peAArch64i_final_link_postscript
|
||||
+#define _bfd_XXi_only_swap_filehdr_out _bfd_peAArch64i_only_swap_filehdr_out
|
||||
+#define _bfd_XXi_swap_aouthdr_in _bfd_peAArch64i_swap_aouthdr_in
|
||||
+#define _bfd_XXi_swap_aouthdr_out _bfd_peAArch64i_swap_aouthdr_out
|
||||
+#define _bfd_XXi_swap_aux_in _bfd_peAArch64i_swap_aux_in
|
||||
+#define _bfd_XXi_swap_aux_out _bfd_peAArch64i_swap_aux_out
|
||||
+#define _bfd_XXi_swap_lineno_in _bfd_peAArch64i_swap_lineno_in
|
||||
+#define _bfd_XXi_swap_lineno_out _bfd_peAArch64i_swap_lineno_out
|
||||
+#define _bfd_XXi_swap_scnhdr_out _bfd_peAArch64i_swap_scnhdr_out
|
||||
+#define _bfd_XXi_swap_sym_in _bfd_peAArch64i_swap_sym_in
|
||||
+#define _bfd_XXi_swap_sym_out _bfd_peAArch64i_swap_sym_out
|
||||
+#define _bfd_XXi_swap_debugdir_in _bfd_peAArch64i_swap_debugdir_in
|
||||
+#define _bfd_XXi_swap_debugdir_out _bfd_peAArch64i_swap_debugdir_out
|
||||
+#define _bfd_XXi_write_codeview_record _bfd_peAArch64i_write_codeview_record
|
||||
+#define _bfd_XXi_slurp_codeview_record _bfd_peAArch64i_slurp_codeview_record
|
||||
+
|
||||
#else /* !COFF_WITH_pep */
|
||||
|
||||
#define GET_OPTHDR_IMAGE_BASE H_GET_32
|
||||
@@ -368,4 +403,5 @@ bfd_boolean _bfd_pe_print_ce_compressed_
|
||||
bfd_boolean _bfd_pe64_print_ce_compressed_pdata (bfd *, void *);
|
||||
bfd_boolean _bfd_pex64_print_ce_compressed_pdata (bfd *, void *);
|
||||
bfd_boolean _bfd_pep_print_ce_compressed_pdata (bfd *, void *);
|
||||
+bfd_boolean _bfd_peAArch64_print_ce_compressed_pdata (bfd *, void *);
|
||||
|
||||
diff -rup binutils.orig/bfd/peXXigen.c binutils-2.35.2/bfd/peXXigen.c
|
||||
--- binutils.orig/bfd/peXXigen.c 2021-11-30 13:38:24.352744227 +0000
|
||||
+++ binutils-2.35.2/bfd/peXXigen.c 2021-11-30 13:38:37.255656936 +0000
|
||||
@@ -60,8 +60,9 @@
|
||||
on this code has a chance of getting something accomplished without
|
||||
wasting too much time. */
|
||||
|
||||
-/* This expands into COFF_WITH_pe, COFF_WITH_pep, or COFF_WITH_pex64
|
||||
- depending on whether we're compiling for straight PE or PE+. */
|
||||
+/* This expands into COFF_WITH_pe, COFF_WITH_pep, COFF_WITH_pex64 or
|
||||
+ COFF_WITH_peAArch64 depending on whether we're compiling for straight
|
||||
+ PE or PE+. */
|
||||
#define COFF_WITH_XX
|
||||
|
||||
#include "sysdep.h"
|
||||
@@ -87,6 +88,8 @@
|
||||
# include "coff/x86_64.h"
|
||||
#elif defined COFF_WITH_pep
|
||||
# include "coff/ia64.h"
|
||||
+#elif defined COFF_WITH_peAArch64
|
||||
+# include "coff/aarch64.h"
|
||||
#else
|
||||
# include "coff/i386.h"
|
||||
#endif
|
||||
@@ -96,7 +99,7 @@
|
||||
#include "libpei.h"
|
||||
#include "safe-ctype.h"
|
||||
|
||||
-#if defined COFF_WITH_pep || defined COFF_WITH_pex64
|
||||
+#if defined COFF_WITH_pep || defined COFF_WITH_pex64 || defined COFF_WITH_peAArch64
|
||||
# undef AOUTSZ
|
||||
# define AOUTSZ PEPAOUTSZ
|
||||
# define PEAOUTHDR PEPAOUTHDR
|
||||
@@ -485,7 +488,7 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd,
|
||||
aouthdr_int->text_start =
|
||||
GET_AOUTHDR_TEXT_START (abfd, aouthdr_ext->text_start);
|
||||
|
||||
-#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
/* PE32+ does not have data_start member! */
|
||||
aouthdr_int->data_start =
|
||||
GET_AOUTHDR_DATA_START (abfd, aouthdr_ext->data_start);
|
||||
@@ -571,7 +574,7 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd,
|
||||
if (aouthdr_int->entry)
|
||||
{
|
||||
aouthdr_int->entry += a->ImageBase;
|
||||
-#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
aouthdr_int->entry &= 0xffffffff;
|
||||
#endif
|
||||
}
|
||||
@@ -579,12 +582,12 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd,
|
||||
if (aouthdr_int->tsize)
|
||||
{
|
||||
aouthdr_int->text_start += a->ImageBase;
|
||||
-#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
aouthdr_int->text_start &= 0xffffffff;
|
||||
#endif
|
||||
}
|
||||
|
||||
-#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
/* PE32+ does not have data_start member! */
|
||||
if (aouthdr_int->dsize)
|
||||
{
|
||||
@@ -653,7 +656,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, v
|
||||
if (aouthdr_in->tsize)
|
||||
{
|
||||
aouthdr_in->text_start -= ib;
|
||||
-#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
aouthdr_in->text_start &= 0xffffffff;
|
||||
#endif
|
||||
}
|
||||
@@ -661,7 +664,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, v
|
||||
if (aouthdr_in->dsize)
|
||||
{
|
||||
aouthdr_in->data_start -= ib;
|
||||
-#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
aouthdr_in->data_start &= 0xffffffff;
|
||||
#endif
|
||||
}
|
||||
@@ -669,7 +672,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, v
|
||||
if (aouthdr_in->entry)
|
||||
{
|
||||
aouthdr_in->entry -= ib;
|
||||
-#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
aouthdr_in->entry &= 0xffffffff;
|
||||
#endif
|
||||
}
|
||||
@@ -773,7 +776,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, v
|
||||
PUT_AOUTHDR_TEXT_START (abfd, aouthdr_in->text_start,
|
||||
aouthdr_out->standard.text_start);
|
||||
|
||||
-#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
/* PE32+ does not have data_start member! */
|
||||
PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start,
|
||||
aouthdr_out->standard.data_start);
|
||||
@@ -1886,7 +1889,7 @@ pe_print_edata (bfd * abfd, void * vfile
|
||||
static bfd_boolean
|
||||
pe_print_pdata (bfd * abfd, void * vfile)
|
||||
{
|
||||
-#if defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
# define PDATA_ROW_SIZE (3 * 8)
|
||||
#else
|
||||
# define PDATA_ROW_SIZE (5 * 4)
|
||||
@@ -1913,7 +1916,7 @@ pe_print_pdata (bfd * abfd, void * vfile
|
||||
|
||||
fprintf (file,
|
||||
_("\nThe Function Table (interpreted .pdata section contents)\n"));
|
||||
-#if defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
fprintf (file,
|
||||
_(" vma:\t\t\tBegin Address End Address Unwind Info\n"));
|
||||
#else
|
||||
@@ -1950,7 +1953,7 @@ pe_print_pdata (bfd * abfd, void * vfile
|
||||
bfd_vma eh_handler;
|
||||
bfd_vma eh_data;
|
||||
bfd_vma prolog_end_addr;
|
||||
-#if !defined(COFF_WITH_pep) || defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) || defined(COFF_WITH_pex64) || defined(COFF_WITH_peAArch64)
|
||||
int em_data;
|
||||
#endif
|
||||
|
||||
@@ -1968,7 +1971,7 @@ pe_print_pdata (bfd * abfd, void * vfile
|
||||
/* We are probably into the padding of the section now. */
|
||||
break;
|
||||
|
||||
-#if !defined(COFF_WITH_pep) || defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) || defined(COFF_WITH_pex64) || defined(COFF_WITH_peAArch64)
|
||||
em_data = ((eh_handler & 0x1) << 2) | (prolog_end_addr & 0x3);
|
||||
#endif
|
||||
eh_handler &= ~(bfd_vma) 0x3;
|
||||
@@ -1979,7 +1982,7 @@ pe_print_pdata (bfd * abfd, void * vfile
|
||||
bfd_fprintf_vma (abfd, file, begin_addr); fputc (' ', file);
|
||||
bfd_fprintf_vma (abfd, file, end_addr); fputc (' ', file);
|
||||
bfd_fprintf_vma (abfd, file, eh_handler);
|
||||
-#if !defined(COFF_WITH_pep) || defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) || defined(COFF_WITH_pex64) || defined(COFF_WITH_peAArch64)
|
||||
fputc (' ', file);
|
||||
bfd_fprintf_vma (abfd, file, eh_data); fputc (' ', file);
|
||||
bfd_fprintf_vma (abfd, file, prolog_end_addr);
|
||||
@@ -2894,7 +2897,7 @@ _bfd_XX_print_private_bfd_data_common (b
|
||||
bfd_fprintf_vma (abfd, file, i->AddressOfEntryPoint);
|
||||
fprintf (file, "\nBaseOfCode\t\t");
|
||||
bfd_fprintf_vma (abfd, file, i->BaseOfCode);
|
||||
-#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
/* PE32+ does not have BaseOfData member! */
|
||||
fprintf (file, "\nBaseOfData\t\t");
|
||||
bfd_fprintf_vma (abfd, file, i->BaseOfData);
|
||||
@@ -3163,7 +3166,7 @@ _bfd_XX_get_symbol_info (bfd * abfd, asy
|
||||
coff_get_symbol_info (abfd, symbol, ret);
|
||||
}
|
||||
|
||||
-#if !defined(COFF_WITH_pep) && defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && defined(COFF_WITH_pex64) && defined(COFF_WITH_peAArch64)
|
||||
static int
|
||||
sort_x64_pdata (const void *l, const void *r)
|
||||
{
|
||||
@@ -4595,7 +4598,7 @@ _bfd_XXi_final_link_postscript (bfd * ab
|
||||
the TLS data directory consists of 4 pointers, followed
|
||||
by two 4-byte integer. This implies that the total size
|
||||
is different for 32-bit and 64-bit executables. */
|
||||
-#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
pe_data (abfd)->pe_opthdr.DataDirectory[PE_TLS_TABLE].Size = 0x18;
|
||||
#else
|
||||
pe_data (abfd)->pe_opthdr.DataDirectory[PE_TLS_TABLE].Size = 0x28;
|
||||
@@ -4604,7 +4607,7 @@ _bfd_XXi_final_link_postscript (bfd * ab
|
||||
|
||||
/* If there is a .pdata section and we have linked pdata finally, we
|
||||
need to sort the entries ascending. */
|
||||
-#if !defined(COFF_WITH_pep) && defined(COFF_WITH_pex64)
|
||||
+#if !defined(COFF_WITH_pep) && defined(COFF_WITH_pex64) && defined(COFF_WITH_peAArch64)
|
||||
{
|
||||
asection *sec = bfd_get_section_by_name (abfd, ".pdata");
|
||||
|
||||
Only in binutils-2.35.2/bfd: pei-aarch64.c
|
||||
diff -rup binutils.orig/bfd/peicode.h binutils-2.35.2/bfd/peicode.h
|
||||
--- binutils.orig/bfd/peicode.h 2021-11-30 13:38:24.354744213 +0000
|
||||
+++ binutils-2.35.2/bfd/peicode.h 2021-11-30 13:38:37.256656929 +0000
|
||||
@@ -231,7 +231,7 @@ coff_swap_scnhdr_in (bfd * abfd, void *
|
||||
{
|
||||
scnhdr_int->s_vaddr += pe_data (abfd)->pe_opthdr.ImageBase;
|
||||
/* Do not cut upper 32-bits for 64-bit vma. */
|
||||
-#ifndef COFF_WITH_pex64
|
||||
+#if !defined(COFF_WITH_pex64) && !defined(COFF_WITH_peAArch64)
|
||||
scnhdr_int->s_vaddr &= 0xffffffff;
|
||||
#endif
|
||||
}
|
||||
@@ -738,6 +738,16 @@ static jump_table jtab[] =
|
||||
},
|
||||
#endif
|
||||
|
||||
+#ifdef AARCH64MAGIC
|
||||
+/* We don't currently support jumping to DLLs, so if
|
||||
+ someone does try emit a runtime trap. Through UDF #0. */
|
||||
+ { AARCH64MAGIC,
|
||||
+ { 0x00, 0x00, 0x00, 0x00 },
|
||||
+ 4, 0
|
||||
+ },
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
#ifdef ARMPEMAGIC
|
||||
{ ARMPEMAGIC,
|
||||
{ 0x00, 0xc0, 0x9f, 0xe5, 0x00, 0xf0,
|
||||
@@ -910,7 +920,7 @@ pe_ILF_build_a_bfd (bfd * abfd,
|
||||
/* See PR 20907 for a reproducer. */
|
||||
goto error_return;
|
||||
|
||||
-#ifdef COFF_WITH_pex64
|
||||
+#if defined(COFF_WITH_pex64) || defined(COFF_WITH_peAArch64)
|
||||
((unsigned int *) id4->contents)[0] = ordinal;
|
||||
((unsigned int *) id4->contents)[1] = 0x80000000;
|
||||
((unsigned int *) id5->contents)[0] = ordinal;
|
||||
@@ -1206,6 +1216,12 @@ pe_ILF_object_p (bfd * abfd)
|
||||
#endif
|
||||
break;
|
||||
|
||||
+ case IMAGE_FILE_MACHINE_ARM64:
|
||||
+#ifdef AARCH64MAGIC
|
||||
+ magic = AARCH64MAGIC;
|
||||
+#endif
|
||||
+ break;
|
||||
+
|
||||
case IMAGE_FILE_MACHINE_THUMB:
|
||||
#ifdef THUMBPEMAGIC
|
||||
{
|
||||
diff -rup binutils.orig/bfd/targets.c binutils-2.35.2/bfd/targets.c
|
||||
--- binutils.orig/bfd/targets.c 2021-11-30 13:38:24.354744213 +0000
|
||||
+++ binutils-2.35.2/bfd/targets.c 2021-11-30 13:38:37.257656922 +0000
|
||||
@@ -668,6 +668,7 @@ extern const bfd_target aarch64_elf64_be
|
||||
extern const bfd_target aarch64_elf64_le_vec;
|
||||
extern const bfd_target aarch64_elf64_le_cloudabi_vec;
|
||||
extern const bfd_target aarch64_mach_o_vec;
|
||||
+extern const bfd_target aarch64_pei_vec;
|
||||
extern const bfd_target alpha_ecoff_le_vec;
|
||||
extern const bfd_target alpha_elf64_vec;
|
||||
extern const bfd_target alpha_elf64_fbsd_vec;
|
||||
@@ -983,6 +984,7 @@ static const bfd_target * const _bfd_tar
|
||||
&aarch64_elf64_le_vec,
|
||||
&aarch64_elf64_le_cloudabi_vec,
|
||||
&aarch64_mach_o_vec,
|
||||
+ &aarch64_pei_vec,
|
||||
#endif
|
||||
|
||||
#ifdef BFD64
|
||||
diff -rup binutils.orig/binutils/NEWS binutils-2.35.2/binutils/NEWS
|
||||
--- binutils.orig/binutils/NEWS 2021-11-30 13:38:23.874747460 +0000
|
||||
+++ binutils-2.35.2/binutils/NEWS 2021-11-30 13:42:31.024075560 +0000
|
||||
@@ -1,5 +1,8 @@
|
||||
-*- text -*-
|
||||
|
||||
+* Support for efi-app-aarch64, efi-rtdrv-aarch64 and efi-bsdrv-aarch64 has been
|
||||
+ added to objcopy in order to enable UEFI development using binutils.
|
||||
+
|
||||
Changes in 2.35:
|
||||
|
||||
* Changed readelf's display of symbol names when wide mode is not enabled.
|
||||
diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.2/binutils/objcopy.c
|
||||
--- binutils.orig/binutils/objcopy.c 2021-11-30 13:38:23.874747460 +0000
|
||||
+++ binutils-2.35.2/binutils/objcopy.c 2021-11-30 13:38:37.260656902 +0000
|
||||
@@ -4950,6 +4950,13 @@ convert_efi_target (char *efi)
|
||||
/* Change x86_64 to x86-64. */
|
||||
efi[7] = '-';
|
||||
}
|
||||
+ else if (strcmp (efi + 4, "aarch64") == 0)
|
||||
+ {
|
||||
+ /* Change aarch64 to aarch64-little. */
|
||||
+ efi = (char *) xrealloc (efi, strlen (efi) + 7);
|
||||
+ char *t = "aarch64-little";
|
||||
+ strcpy (efi + 4, t);
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Allocate and return a pointer to a struct section_add, initializing the
|
||||
diff -rup binutils.orig/include/coff/pe.h binutils-2.35.2/include/coff/pe.h
|
||||
--- binutils.orig/include/coff/pe.h 2021-11-30 13:38:23.827747778 +0000
|
||||
+++ binutils-2.35.2/include/coff/pe.h 2021-11-30 13:38:37.261656895 +0000
|
||||
@@ -132,6 +132,7 @@
|
||||
#define IMAGE_FILE_MACHINE_AM33 0x01d3
|
||||
#define IMAGE_FILE_MACHINE_AMD64 0x8664
|
||||
#define IMAGE_FILE_MACHINE_ARM 0x01c0
|
||||
+#define IMAGE_FILE_MACHINE_ARM64 0xaa64
|
||||
#define IMAGE_FILE_MACHINE_AXP64 IMAGE_FILE_MACHINE_ALPHA64
|
||||
#define IMAGE_FILE_MACHINE_CEE 0xc0ee
|
||||
#define IMAGE_FILE_MACHINE_CEF 0x0cef
|
||||
--- /dev/null 2021-11-30 07:48:35.901044247 +0000
|
||||
+++ binutils-2.35.2/bfd/coff-aarch64.c 2021-11-30 13:43:11.774799879 +0000
|
||||
@@ -0,0 +1,165 @@
|
||||
+/* BFD back-end for AArch64 COFF files.
|
||||
+ Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of BFD, the Binary File Descriptor library.
|
||||
+
|
||||
+ 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, write to the Free Software
|
||||
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
||||
+ MA 02110-1301, USA. */
|
||||
+
|
||||
+
|
||||
+#ifndef COFF_WITH_peAArch64
|
||||
+#define COFF_WITH_peAArch64
|
||||
+#endif
|
||||
+
|
||||
+/* Note we have to make sure not to include headers twice.
|
||||
+ Not all headers are wrapped in #ifdef guards, so we define
|
||||
+ PEI_HEADERS to prevent double including here. */
|
||||
+#ifndef PEI_HEADERS
|
||||
+#include "sysdep.h"
|
||||
+#include "bfd.h"
|
||||
+#include "libbfd.h"
|
||||
+#include "coff/aarch64.h"
|
||||
+#include "coff/internal.h"
|
||||
+#include "coff/pe.h"
|
||||
+#include "libcoff.h"
|
||||
+#include "libiberty.h"
|
||||
+#endif
|
||||
+
|
||||
+#include "libcoff.h"
|
||||
+
|
||||
+/* The page size is a guess based on ELF. */
|
||||
+
|
||||
+#define COFF_PAGE_SIZE 0x1000
|
||||
+
|
||||
+/* All users of this file have bfd_octets_per_byte (abfd, sec) == 1. */
|
||||
+#define OCTETS_PER_BYTE(ABFD, SEC) 1
|
||||
+
|
||||
+#ifndef PCRELOFFSET
|
||||
+#define PCRELOFFSET TRUE
|
||||
+#endif
|
||||
+
|
||||
+/* Currently we don't handle any relocations. */
|
||||
+static reloc_howto_type pe_aarch64_std_reloc_howto[] =
|
||||
+ {
|
||||
+
|
||||
+ };
|
||||
+
|
||||
+#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER 2
|
||||
+#define COFF_PAGE_SIZE 0x1000
|
||||
+
|
||||
+#ifndef NUM_ELEM
|
||||
+#define NUM_ELEM(a) ((sizeof (a)) / sizeof ((a)[0]))
|
||||
+#endif
|
||||
+
|
||||
+#define NUM_RELOCS NUM_ELEM (pe_aarch64_std_reloc_howto)
|
||||
+
|
||||
+#define RTYPE2HOWTO(cache_ptr, dst) \
|
||||
+ (cache_ptr)->howto = NULL
|
||||
+
|
||||
+#ifndef bfd_pe_print_pdata
|
||||
+#define bfd_pe_print_pdata NULL
|
||||
+#endif
|
||||
+
|
||||
+/* Return TRUE if this relocation should
|
||||
+ appear in the output .reloc section. */
|
||||
+
|
||||
+static bfd_boolean
|
||||
+in_reloc_p (bfd * abfd ATTRIBUTE_UNUSED,
|
||||
+ reloc_howto_type * howto)
|
||||
+{
|
||||
+ return !howto->pc_relative;
|
||||
+}
|
||||
+
|
||||
+#include "coffcode.h"
|
||||
+
|
||||
+/* Target vectors. */
|
||||
+const bfd_target
|
||||
+#ifdef TARGET_SYM
|
||||
+ TARGET_SYM =
|
||||
+#else
|
||||
+ aarch64_pei_vec =
|
||||
+#endif
|
||||
+{
|
||||
+#ifdef TARGET_NAME
|
||||
+ TARGET_NAME,
|
||||
+#else
|
||||
+ "pei-aarch64-little", /* Name. */
|
||||
+#endif
|
||||
+ bfd_target_coff_flavour,
|
||||
+ BFD_ENDIAN_LITTLE, /* Data byte order is little. */
|
||||
+ BFD_ENDIAN_LITTLE, /* Header byte order is little. */
|
||||
+
|
||||
+ (HAS_RELOC | EXEC_P /* Object flags. */
|
||||
+ | HAS_LINENO | HAS_DEBUG
|
||||
+ | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS),
|
||||
+
|
||||
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* Section flags. */
|
||||
+#if defined(COFF_WITH_PE)
|
||||
+ | SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_READONLY | SEC_DEBUGGING
|
||||
+#endif
|
||||
+ | SEC_CODE | SEC_DATA | SEC_EXCLUDE ),
|
||||
+
|
||||
+#ifdef TARGET_UNDERSCORE
|
||||
+ TARGET_UNDERSCORE, /* Leading underscore. */
|
||||
+#else
|
||||
+ 0, /* Leading underscore. */
|
||||
+#endif
|
||||
+ '/', /* Ar_pad_char. */
|
||||
+ 15, /* Ar_max_namelen. */
|
||||
+ 0, /* match priority. */
|
||||
+
|
||||
+ /* Data conversion functions. */
|
||||
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
|
||||
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
|
||||
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Data. */
|
||||
+ /* Header conversion functions. */
|
||||
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
|
||||
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
|
||||
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Hdrs. */
|
||||
+
|
||||
+ /* Note that we allow an object file to be treated as a core file as well. */
|
||||
+ { /* bfd_check_format. */
|
||||
+ _bfd_dummy_target,
|
||||
+ coff_object_p,
|
||||
+ bfd_generic_archive_p,
|
||||
+ coff_object_p
|
||||
+ },
|
||||
+ { /* bfd_set_format. */
|
||||
+ _bfd_bool_bfd_false_error,
|
||||
+ coff_mkobject,
|
||||
+ _bfd_generic_mkarchive,
|
||||
+ _bfd_bool_bfd_false_error
|
||||
+ },
|
||||
+ { /* bfd_write_contents. */
|
||||
+ _bfd_bool_bfd_false_error,
|
||||
+ coff_write_object_contents,
|
||||
+ _bfd_write_archive_contents,
|
||||
+ _bfd_bool_bfd_false_error
|
||||
+ },
|
||||
+
|
||||
+ BFD_JUMP_TABLE_GENERIC (coff),
|
||||
+ BFD_JUMP_TABLE_COPY (coff),
|
||||
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
|
||||
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
|
||||
+ BFD_JUMP_TABLE_SYMBOLS (coff),
|
||||
+ BFD_JUMP_TABLE_RELOCS (coff),
|
||||
+ BFD_JUMP_TABLE_WRITE (coff),
|
||||
+ BFD_JUMP_TABLE_LINK (coff),
|
||||
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
|
||||
+
|
||||
+ NULL,
|
||||
+
|
||||
+ COFF_SWAP_TABLE
|
||||
+};
|
||||
--- /dev/null 2021-11-30 07:48:35.901044247 +0000
|
||||
+++ binutils-2.35.2/include/coff/aarch64.h 2021-11-30 13:38:37.261656895 +0000
|
||||
@@ -0,0 +1,63 @@
|
||||
+/* AArch64 COFF support for BFD.
|
||||
+ Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of BFD, the Binary File Descriptor library.
|
||||
+
|
||||
+ 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, write to the Free Software Foundation,
|
||||
+ Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
+
|
||||
+#define COFFAARCH64 1
|
||||
+
|
||||
+#define L_LNNO_SIZE 2
|
||||
+#define INCLUDE_COMDAT_FIELDS_IN_AUXENT
|
||||
+#include "coff/external.h"
|
||||
+
|
||||
+#define F_AARCH64_ARCHITECTURE_MASK (0x4000)
|
||||
+
|
||||
+#define AARCH64MAGIC 0xaa64 /* From Microsoft specification. */
|
||||
+
|
||||
+#undef BADMAG
|
||||
+#define BADMAG(x) ((x).f_magic != AARCH64MAGIC)
|
||||
+#define AARCH64 1 /* Customize coffcode.h. */
|
||||
+
|
||||
+#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
|
||||
+
|
||||
+#define OMAGIC 0404 /* Object files, eg as output. */
|
||||
+#define ZMAGIC IMAGE_NT_OPTIONAL_HDR64_MAGIC /* Demand load format, eg normal ld output 0x10b. */
|
||||
+#define STMAGIC 0401 /* Target shlib. */
|
||||
+#define SHMAGIC 0443 /* Host shlib. */
|
||||
+
|
||||
+/* define some NT default values */
|
||||
+/* #define NT_IMAGE_BASE 0x400000 moved to internal.h */
|
||||
+#define NT_SECTION_ALIGNMENT 0x1000
|
||||
+#define NT_FILE_ALIGNMENT 0x200
|
||||
+#define NT_DEF_RESERVE 0x100000
|
||||
+#define NT_DEF_COMMIT 0x1000
|
||||
+
|
||||
+/* We use the .rdata section to hold read only data. */
|
||||
+#define _LIT ".rdata"
|
||||
+
|
||||
+/********************** RELOCATION DIRECTIVES **********************/
|
||||
+struct external_reloc
|
||||
+{
|
||||
+ char r_vaddr[4];
|
||||
+ char r_symndx[4];
|
||||
+ char r_type[2];
|
||||
+ char r_offset[4];
|
||||
+};
|
||||
+
|
||||
+#define RELOC struct external_reloc
|
||||
+#define RELSZ 14
|
||||
+
|
||||
+#define ARM_NOTE_SECTION ".note"
|
||||
--- /dev/null 2021-11-30 07:48:35.901044247 +0000
|
||||
+++ binutils-2.35.2/binutils/testsuite/binutils-all/aarch64/pei-aarch64-little.s 2021-11-30 13:38:37.260656902 +0000
|
||||
@@ -0,0 +1,42 @@
|
||||
+ .arch armv8-a
|
||||
+ .text
|
||||
+ .align 2
|
||||
+ .global foo
|
||||
+ .type foo, %function
|
||||
+foo:
|
||||
+.LFB0:
|
||||
+ .cfi_startproc
|
||||
+ sub sp, sp, #16
|
||||
+ .cfi_def_cfa_offset 16
|
||||
+ str w0, [sp, 12]
|
||||
+ ldr w0, [sp, 12]
|
||||
+ mul w0, w0, w0
|
||||
+ add sp, sp, 16
|
||||
+ .cfi_def_cfa_offset 0
|
||||
+ ret
|
||||
+ .cfi_endproc
|
||||
+.LFE0:
|
||||
+ .size foo, .-foo
|
||||
+ .align 2
|
||||
+ .global main
|
||||
+ .type main, %function
|
||||
+main:
|
||||
+.LFB1:
|
||||
+ .cfi_startproc
|
||||
+ stp x29, x30, [sp, -16]!
|
||||
+ .cfi_def_cfa_offset 16
|
||||
+ .cfi_offset 29, -16
|
||||
+ .cfi_offset 30, -8
|
||||
+ mov x29, sp
|
||||
+ mov w0, 5
|
||||
+ bl foo
|
||||
+ ldp x29, x30, [sp], 16
|
||||
+ .cfi_restore 30
|
||||
+ .cfi_restore 29
|
||||
+ .cfi_def_cfa_offset 0
|
||||
+ ret
|
||||
+ .cfi_endproc
|
||||
+.LFE1:
|
||||
+ .size main, .-main
|
||||
+ .ident "GCC: (fsf-trunk.2870) 12.0.0 20210930 (experimental)"
|
||||
+ .section .note.GNU-stack,"",@progbits
|
||||
--- /dev/null 2021-11-30 07:48:35.901044247 +0000
|
||||
+++ binutils-2.35.2/binutils/testsuite/binutils-all/aarch64/pei-aarch64-little.d 2021-11-30 13:38:37.260656902 +0000
|
||||
@@ -0,0 +1,16 @@
|
||||
+#skip: aarch64_be-*-*
|
||||
+#ld: -e0
|
||||
+#PROG: objcopy
|
||||
+#objcopy: -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* -j .reloc --target=efi-app-aarch64
|
||||
+#objdump: -h -f
|
||||
+#name: Check if efi app format is recognized
|
||||
+
|
||||
+.*: file format pei-aarch64-little
|
||||
+architecture: aarch64, flags 0x00000132:
|
||||
+EXEC_P, HAS_SYMS, HAS_LOCALS, D_PAGED
|
||||
+start address 0x0000000000000000
|
||||
+
|
||||
+Sections:
|
||||
+Idx Name Size VMA LMA File off Algn
|
||||
+ 0 \.text 00000030 0[^ ]+ 0[^ ]+ 0[^ ]+ 2\*\*2
|
||||
+ CONTENTS, ALLOC, LOAD, READONLY, CODE
|
||||
--- /dev/null 2021-11-30 07:48:35.901044247 +0000
|
||||
+++ binutils-2.35.2/bfd/pei-aarch64.c 2021-11-30 13:38:37.255656936 +0000
|
||||
@@ -0,0 +1,75 @@
|
||||
+/* BFD back-end for AArch64 PE IMAGE COFF files.
|
||||
+ Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of BFD, the Binary File Descriptor library.
|
||||
+
|
||||
+ 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, write to the Free Software
|
||||
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
||||
+ MA 02110-1301, USA. */
|
||||
+
|
||||
+#include "sysdep.h"
|
||||
+#include "bfd.h"
|
||||
+
|
||||
+#define TARGET_SYM aarch64_pei_vec
|
||||
+#define TARGET_NAME "pei-aarch64-little"
|
||||
+#define TARGET_ARCHITECTURE bfd_arch_aarch64
|
||||
+#define TARGET_PAGESIZE 4096
|
||||
+#define TARGET_BIG_ENDIAN 0
|
||||
+#define TARGET_ARCHIVE 0
|
||||
+#define TARGET_PRIORITY 0
|
||||
+
|
||||
+#define COFF_IMAGE_WITH_PE
|
||||
+/* Rename the above into.. */
|
||||
+#define COFF_WITH_peAArch64
|
||||
+#define COFF_WITH_PE
|
||||
+#define PCRELOFFSET TRUE
|
||||
+
|
||||
+/* Long section names not allowed in executable images, only object files. */
|
||||
+#define COFF_LONG_SECTION_NAMES 0
|
||||
+
|
||||
+#define COFF_SECTION_ALIGNMENT_ENTRIES \
|
||||
+{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \
|
||||
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
|
||||
+{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \
|
||||
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
|
||||
+{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \
|
||||
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
|
||||
+{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \
|
||||
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
|
||||
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
|
||||
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
|
||||
+{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \
|
||||
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
|
||||
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \
|
||||
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \
|
||||
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \
|
||||
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }
|
||||
+
|
||||
+#define PEI_HEADERS
|
||||
+#include "sysdep.h"
|
||||
+#include "bfd.h"
|
||||
+#include "libbfd.h"
|
||||
+#include "coff/aarch64.h"
|
||||
+#include "coff/internal.h"
|
||||
+#include "coff/pe.h"
|
||||
+#include "libcoff.h"
|
||||
+#include "libpei.h"
|
||||
+#include "libiberty.h"
|
||||
+
|
||||
+/* Make sure we're setting a 64-bit format. */
|
||||
+#undef AOUTSZ
|
||||
+#define AOUTSZ PEPAOUTSZ
|
||||
+#define PEAOUTHDR PEPAOUTHDR
|
||||
+
|
||||
+#include "coff-aarch64.c"
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/aarch64/pei-aarch64-little.d 2024-06-04 14:00:51.569526147 +0100
|
||||
+++ binutils-2.35.2/binutils/testsuite/binutils-all/aarch64/pei-aarch64-little.d 2024-06-04 14:00:59.049544354 +0100
|
||||
@@ -12,5 +12,5 @@ start address 0x0000000000000000
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn
|
||||
- 0 \.text 00000030 0[^ ]+ 0[^ ]+ 0[^ ]+ 2\*\*2
|
||||
+ 0 \.text 00000030 0[^ ]+ 0[^ ]+ 0[^ ]+ 2\*\*12
|
||||
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
@ -1,373 +0,0 @@
|
||||
diff -pruN binutils-2.30.orig/gold/aarch64.cc binutils-2.30/gold/aarch64.cc
|
||||
--- binutils-2.30.orig/gold/aarch64.cc 2019-03-28 06:50:31.813828734 -0400
|
||||
+++ binutils-2.30/gold/aarch64.cc 2019-03-28 06:50:46.993954670 -0400
|
||||
@@ -6478,6 +6478,17 @@ Target_aarch64<size, big_endian>::Scan::
|
||||
gold_error(_("%s: unsupported reloc %u in pos independent link."),
|
||||
object->name().c_str(), r_type);
|
||||
}
|
||||
+ // Make a PLT entry if necessary.
|
||||
+ if (gsym->needs_plt_entry())
|
||||
+ {
|
||||
+ target->make_plt_entry(symtab, layout, gsym);
|
||||
+ // Since this is not a PC-relative relocation, we may be
|
||||
+ // taking the address of a function. In that case we need to
|
||||
+ // set the entry in the dynamic symbol table to the address of
|
||||
+ // the PLT entry.
|
||||
+ if (gsym->is_from_dynobj() && !parameters->options().shared())
|
||||
+ gsym->set_needs_dynsym_value();
|
||||
+ }
|
||||
break;
|
||||
|
||||
case elfcpp::R_AARCH64_LD_PREL_LO19: // 273
|
||||
diff -pruN binutils-2.30.orig/gold/ChangeLog binutils-2.30/gold/ChangeLog
|
||||
--- binutils-2.30.orig/gold/ChangeLog 2018-01-27 10:08:21.000000000 -0500
|
||||
+++ binutils-2.30/gold/ChangeLog 2019-03-28 06:52:51.924999245 -0400
|
||||
@@ -1,3 +1,14 @@
|
||||
+2019-02-19 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
|
||||
+
|
||||
+ PR gold/23870
|
||||
+ * aarch64.cc (Target_aarch64::Scan::global): Check if a symbol with
|
||||
+ R_AARCH64_MOVW_.ABS_* relocations requires a PLT entry.
|
||||
+ * testsuite/Makefile.am: Add aarch64_pr23870 test case.
|
||||
+ * testsuite/Makefile.in: Regenerate.
|
||||
+ * testsuite/aarch64_pr23870_bar.c: New file.
|
||||
+ * testsuite/aarch64_pr23870_foo.c: New file.
|
||||
+ * testsuite/aarch64_pr23870_main.S: New file.
|
||||
+
|
||||
2018-01-27 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
This is the 2.30 release:
|
||||
diff -pruN binutils-2.30.orig/gold/testsuite/aarch64_pr23870_bar.c binutils-2.30/gold/testsuite/aarch64_pr23870_bar.c
|
||||
--- binutils-2.30.orig/gold/testsuite/aarch64_pr23870_bar.c 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ binutils-2.30/gold/testsuite/aarch64_pr23870_bar.c 2019-03-28 06:50:46.993954670 -0400
|
||||
@@ -0,0 +1,6 @@
|
||||
+void bar (void);
|
||||
+
|
||||
+void bar ()
|
||||
+{
|
||||
+ return;
|
||||
+}
|
||||
diff -pruN binutils-2.30.orig/gold/testsuite/aarch64_pr23870_foo.c binutils-2.30/gold/testsuite/aarch64_pr23870_foo.c
|
||||
--- binutils-2.30.orig/gold/testsuite/aarch64_pr23870_foo.c 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ binutils-2.30/gold/testsuite/aarch64_pr23870_foo.c 2019-03-28 06:50:46.993954670 -0400
|
||||
@@ -0,0 +1,6 @@
|
||||
+void foo (void (*bar)(void));
|
||||
+
|
||||
+void foo (void (*bar)(void))
|
||||
+{
|
||||
+ bar();
|
||||
+}
|
||||
diff -pruN binutils-2.30.orig/gold/testsuite/aarch64_pr23870_main.S binutils-2.30/gold/testsuite/aarch64_pr23870_main.S
|
||||
--- binutils-2.30.orig/gold/testsuite/aarch64_pr23870_main.S 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ binutils-2.30/gold/testsuite/aarch64_pr23870_main.S 2019-03-28 06:50:46.993954670 -0400
|
||||
@@ -0,0 +1,15 @@
|
||||
+
|
||||
+ .text
|
||||
+ .globl main
|
||||
+ .type main,#function
|
||||
+main:
|
||||
+ stp x29, x30, [sp,#-16]!
|
||||
+ mov x29, sp
|
||||
+ movz x0, #:abs_g3:bar
|
||||
+ movk x0, #:abs_g2_nc:bar
|
||||
+ movk x0, #:abs_g1_nc:bar
|
||||
+ movk x0, #:abs_g0_nc:bar
|
||||
+ add x0, x0, #0x0
|
||||
+ bl foo
|
||||
+ ldp x29, x30, [sp],#16
|
||||
+ ret
|
||||
diff -pruN binutils-2.30.orig/gold/testsuite/Makefile.am binutils-2.30/gold/testsuite/Makefile.am
|
||||
--- binutils-2.30.orig/gold/testsuite/Makefile.am 2019-03-28 06:50:31.563826660 -0400
|
||||
+++ binutils-2.30/gold/testsuite/Makefile.am 2019-03-28 06:50:46.993954670 -0400
|
||||
@@ -3144,6 +3144,26 @@ pr22266: pr22266_main.o pr22266_ar.o gcc
|
||||
pr22266_ar.o: pr22266_a.o gcctestdir/ld
|
||||
gcctestdir/ld -r -T $(srcdir)/pr22266_script.t -o $@ pr22266_a.o
|
||||
|
||||
+if DEFAULT_TARGET_AARCH64
|
||||
+
|
||||
+check_PROGRAMS += aarch64_pr23870
|
||||
+aarch64_pr23870_SOURCES = aarch64_pr23870_foo.c
|
||||
+aarch64_pr23870_DEPENDENCIES = \
|
||||
+ gcctestdir/ld gcctestdir/as aarch64_pr23870_main.o \
|
||||
+ aarch64_pr23870_foo.o aarch64_pr23870_bar.so
|
||||
+aarch64_pr23870_LDFLAGS = -Wl,-R,. -L. -Wl,-l:aarch64_pr23870_bar.so
|
||||
+aarch64_pr23870_LDADD = aarch64_pr23870_main.o
|
||||
+aarch64_pr23870_main.o: aarch64_pr23870_main.S
|
||||
+ $(COMPILE) -c -o $@ $<
|
||||
+aarch64_pr23870_foo.o: aarch64_pr23870_foo.c
|
||||
+ $(COMPILE) -c -o $@ $<
|
||||
+aarch64_pr23870_bar.o: aarch64_pr23870_bar.c
|
||||
+ $(COMPILE) -c -fPIC -o $@ $<
|
||||
+aarch64_pr23870_bar.so: aarch64_pr23870_bar.o
|
||||
+ $(COMPILE) -shared -o $@ $<
|
||||
+
|
||||
+endif DEFAULT_TARGET_AARCH64
|
||||
+
|
||||
endif GCC
|
||||
endif NATIVE_LINKER
|
||||
|
||||
diff -pruN binutils-2.30.orig/gold/testsuite/Makefile.in binutils-2.30/gold/testsuite/Makefile.in
|
||||
--- binutils-2.30.orig/gold/testsuite/Makefile.in 2019-03-28 06:50:31.573826743 -0400
|
||||
+++ binutils-2.30/gold/testsuite/Makefile.in 2019-03-28 06:59:26.518313455 -0400
|
||||
@@ -70,7 +70,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
|
||||
$(am__EXEEXT_31) $(am__EXEEXT_32) $(am__EXEEXT_33) \
|
||||
$(am__EXEEXT_34) $(am__EXEEXT_35) $(am__EXEEXT_36) \
|
||||
$(am__EXEEXT_37) $(am__EXEEXT_38) $(am__EXEEXT_39) \
|
||||
- $(am__EXEEXT_40) $(am__EXEEXT_41)
|
||||
+ $(am__EXEEXT_40) $(am__EXEEXT_41) $(am__EXEEXT_42)
|
||||
@NATIVE_OR_CROSS_LINKER_TRUE@am__append_1 = object_unittest \
|
||||
@NATIVE_OR_CROSS_LINKER_TRUE@ binary_unittest leb128_unittest \
|
||||
@NATIVE_OR_CROSS_LINKER_TRUE@ overflow_unittest
|
||||
@@ -817,27 +817,28 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_84 = gnu_property_test.sh
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_85 = gnu_property_test.stdout
|
||||
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_86 = pr22266
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_87 = aarch64_pr23870
|
||||
|
||||
# These tests work with native and cross linkers.
|
||||
|
||||
# Test script section order.
|
||||
-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_87 = script_test_10.sh
|
||||
-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_88 = script_test_10.stdout
|
||||
-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_89 = script_test_10
|
||||
+@NATIVE_OR_CROSS_LINKER_TRUE@am__append_88 = script_test_10.sh
|
||||
+@NATIVE_OR_CROSS_LINKER_TRUE@am__append_89 = script_test_10.stdout
|
||||
+@NATIVE_OR_CROSS_LINKER_TRUE@am__append_90 = script_test_10
|
||||
|
||||
# These tests work with cross linkers only.
|
||||
-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_90 = split_i386.sh
|
||||
-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_91 = split_i386_1.stdout split_i386_2.stdout \
|
||||
+@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_91 = split_i386.sh
|
||||
+@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_92 = split_i386_1.stdout split_i386_2.stdout \
|
||||
@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout
|
||||
|
||||
-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_92 = split_i386_1 split_i386_2 split_i386_3 \
|
||||
+@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_93 = split_i386_1 split_i386_2 split_i386_3 \
|
||||
@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_i386_4 split_i386_r
|
||||
|
||||
-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_93 = split_x86_64.sh \
|
||||
+@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_94 = split_x86_64.sh \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_plt_1.sh \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_1.sh \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_2.sh
|
||||
-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_94 = split_x86_64_1.stdout \
|
||||
+@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_95 = split_x86_64_1.stdout \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_2.stdout \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_3.stdout \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_4.stdout \
|
||||
@@ -845,14 +846,14 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_plt_1.stdout \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_1.stdout \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_2.stdout
|
||||
-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_95 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \
|
||||
+@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_96 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_4 split_x86_64_r
|
||||
|
||||
-@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_96 = split_x32.sh
|
||||
-@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_97 = split_x32_1.stdout split_x32_2.stdout \
|
||||
+@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_97 = split_x32.sh
|
||||
+@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_98 = split_x32_1.stdout split_x32_2.stdout \
|
||||
@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x32_3.stdout split_x32_4.stdout split_x32_r.stdout
|
||||
|
||||
-@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_98 = split_x32_1 split_x32_2 split_x32_3 \
|
||||
+@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_99 = split_x32_1 split_x32_2 split_x32_3 \
|
||||
@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x32_4 split_x32_r
|
||||
|
||||
|
||||
@@ -873,7 +874,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
|
||||
# Check Thumb to ARM farcall veneers
|
||||
|
||||
# Check handling of --target1-abs, --target1-rel and --target2 options
|
||||
-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_99 = arm_abs_global.sh \
|
||||
+@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_100 = arm_abs_global.sh \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_in_range.sh \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_out_of_range.sh \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_fix_v4bx.sh \
|
||||
@@ -896,7 +897,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_got_rel.sh
|
||||
|
||||
# The test demonstrates why the constructor of a target object should not access options.
|
||||
-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_100 = arm_abs_global.stdout \
|
||||
+@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_101 = arm_abs_global.stdout \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range.stdout \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range.stdout \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range.stdout \
|
||||
@@ -949,7 +950,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_abs.stdout \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_got_rel.stdout \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target_lazy_init
|
||||
-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_101 = arm_abs_global \
|
||||
+@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_102 = arm_abs_global \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range \
|
||||
@@ -1000,20 +1001,20 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_abs \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_got_rel \
|
||||
@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target_lazy_init
|
||||
-@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_102 = aarch64_reloc_none.sh \
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_103 = aarch64_reloc_none.sh \
|
||||
@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_relocs.sh \
|
||||
@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ pr21430.sh \
|
||||
@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_tlsdesc.sh
|
||||
-@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_103 = aarch64_reloc_none.stdout \
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_104 = aarch64_reloc_none.stdout \
|
||||
@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_relocs.stdout \
|
||||
@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ pr21430.stdout \
|
||||
@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_tlsdesc.stdout
|
||||
-@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_104 = aarch64_reloc_none \
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_105 = aarch64_reloc_none \
|
||||
@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_relocs \
|
||||
@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ pr21430 \
|
||||
@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_tlsdesc
|
||||
-@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_105 = split_s390.sh
|
||||
-@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_106 = split_s390_z1.stdout split_s390_z2.stdout split_s390_z3.stdout \
|
||||
+@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_106 = split_s390.sh
|
||||
+@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_107 = split_s390_z1.stdout split_s390_z2.stdout split_s390_z3.stdout \
|
||||
@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z4.stdout split_s390_n1.stdout split_s390_n2.stdout \
|
||||
@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_a1.stdout split_s390_a2.stdout split_s390_z1_ns.stdout \
|
||||
@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z2_ns.stdout split_s390_z3_ns.stdout split_s390_z4_ns.stdout \
|
||||
@@ -1025,7 +1026,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
|
||||
@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_z4_ns.stdout split_s390x_n1_ns.stdout \
|
||||
@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_n2_ns.stdout split_s390x_r.stdout
|
||||
|
||||
-@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_107 = split_s390_z1 split_s390_z2 split_s390_z3 \
|
||||
+@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_108 = split_s390_z1 split_s390_z2 split_s390_z3 \
|
||||
@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z4 split_s390_n1 split_s390_n2 split_s390_a1 \
|
||||
@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_a2 split_s390_z1_ns split_s390_z2_ns split_s390_z3_ns \
|
||||
@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z4_ns split_s390_n1_ns split_s390_n2_ns split_s390_r \
|
||||
@@ -1034,10 +1035,10 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
|
||||
@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_z1_ns split_s390x_z2_ns split_s390x_z3_ns \
|
||||
@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_z4_ns split_s390x_n1_ns split_s390x_n2_ns split_s390x_r
|
||||
|
||||
-@DEFAULT_TARGET_X86_64_TRUE@am__append_108 = *.dwo *.dwp
|
||||
-@DEFAULT_TARGET_X86_64_TRUE@am__append_109 = dwp_test_1.sh \
|
||||
+@DEFAULT_TARGET_X86_64_TRUE@am__append_109 = *.dwo *.dwp
|
||||
+@DEFAULT_TARGET_X86_64_TRUE@am__append_110 = dwp_test_1.sh \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@ dwp_test_2.sh
|
||||
-@DEFAULT_TARGET_X86_64_TRUE@am__append_110 = dwp_test_1.stdout \
|
||||
+@DEFAULT_TARGET_X86_64_TRUE@am__append_111 = dwp_test_1.stdout \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@ dwp_test_2.stdout
|
||||
subdir = testsuite
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
|
||||
@@ -1243,6 +1244,11 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_40 = \
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_x86_64_bnd_test$(EXEEXT)
|
||||
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_41 = pr22266$(EXEEXT)
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_42 = aarch64_pr23870$(EXEEXT)
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am_aarch64_pr23870_OBJECTS = aarch64_pr23870_foo.$(OBJEXT)
|
||||
+aarch64_pr23870_OBJECTS = $(am_aarch64_pr23870_OBJECTS)
|
||||
+aarch64_pr23870_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
+ $(aarch64_pr23870_LDFLAGS) $(LDFLAGS) -o $@
|
||||
basic_pic_test_SOURCES = basic_pic_test.c
|
||||
basic_pic_test_OBJECTS = basic_pic_test.$(OBJEXT)
|
||||
basic_pic_test_LDADD = $(LDADD)
|
||||
@@ -2392,7 +2398,7 @@ am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
CCLD = $(CC)
|
||||
CXXLD = $(CXX)
|
||||
-SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c basic_pie_test.c \
|
||||
+SOURCES = $(libgoldtest_a_SOURCES) $(aarch64_pr23870_SOURCES) basic_pic_test.c basic_pie_test.c \
|
||||
basic_static_pic_test.c basic_static_test.c basic_test.c \
|
||||
$(binary_test_SOURCES) $(binary_unittest_SOURCES) \
|
||||
$(common_test_1_SOURCES) $(common_test_2_SOURCES) \
|
||||
@@ -2830,9 +2836,9 @@ MOSTLYCLEANFILES = *.so *.syms *.stdout
|
||||
$(am__append_34) $(am__append_37) $(am__append_41) \
|
||||
$(am__append_47) $(am__append_51) $(am__append_52) \
|
||||
$(am__append_58) $(am__append_78) $(am__append_81) \
|
||||
- $(am__append_83) $(am__append_89) $(am__append_92) \
|
||||
- $(am__append_95) $(am__append_98) $(am__append_101) \
|
||||
- $(am__append_104) $(am__append_107) $(am__append_108)
|
||||
+ $(am__append_83) $(am__append_90) $(am__append_93) \
|
||||
+ $(am__append_96) $(am__append_99) $(am__append_102) \
|
||||
+ $(am__append_105) $(am__append_108) $(am__append_109)
|
||||
|
||||
# We will add to these later, for each individual test. Note
|
||||
# that we add each test under check_SCRIPTS or check_PROGRAMS;
|
||||
@@ -2842,17 +2848,17 @@ check_SCRIPTS = $(am__append_2) $(am__ap
|
||||
$(am__append_45) $(am__append_49) $(am__append_53) \
|
||||
$(am__append_56) $(am__append_62) $(am__append_73) \
|
||||
$(am__append_76) $(am__append_79) $(am__append_84) \
|
||||
- $(am__append_87) $(am__append_90) $(am__append_93) \
|
||||
- $(am__append_96) $(am__append_99) $(am__append_102) \
|
||||
- $(am__append_105) $(am__append_109)
|
||||
+ $(am__append_88) $(am__append_91) $(am__append_94) \
|
||||
+ $(am__append_97) $(am__append_100) $(am__append_103) \
|
||||
+ $(am__append_106) $(am__append_110)
|
||||
check_DATA = $(am__append_3) $(am__append_20) $(am__append_24) \
|
||||
$(am__append_30) $(am__append_36) $(am__append_43) \
|
||||
$(am__append_46) $(am__append_50) $(am__append_54) \
|
||||
$(am__append_57) $(am__append_63) $(am__append_74) \
|
||||
$(am__append_77) $(am__append_80) $(am__append_85) \
|
||||
- $(am__append_88) $(am__append_91) $(am__append_94) \
|
||||
- $(am__append_97) $(am__append_100) $(am__append_103) \
|
||||
- $(am__append_106) $(am__append_110)
|
||||
+ $(am__append_89) $(am__append_92) $(am__append_95) \
|
||||
+ $(am__append_98) $(am__append_101) $(am__append_104) \
|
||||
+ $(am__append_107) $(am__append_111)
|
||||
BUILT_SOURCES = $(am__append_40)
|
||||
TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
|
||||
|
||||
@@ -3408,6 +3414,13 @@ LDADD = libgoldtest.a ../libgold.a ../..
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS) -Wl,-z,bndplt
|
||||
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_SOURCES = aarch64_pr23870_foo.c
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_DEPENDENCIES = \
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld gcctestdir/as aarch64_pr23870_main.o \
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ aarch64_pr23870_foo.o aarch64_pr23870_bar.so
|
||||
+
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_LDFLAGS = -Wl,-R,. -L. -Wl,-l:aarch64_pr23870_bar.so
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_LDADD = aarch64_pr23870_main.o
|
||||
@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
|
||||
@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
|
||||
@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200
|
||||
@@ -3457,6 +3470,11 @@ libgoldtest.a: $(libgoldtest_a_OBJECTS)
|
||||
|
||||
clean-checkPROGRAMS:
|
||||
-test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
|
||||
+
|
||||
+aarch64_pr23870$(EXEEXT): $(aarch64_pr23870_OBJECTS) $(aarch64_pr23870_DEPENDENCIES) $(EXTRA_aarch64_pr23870_DEPENDENCIES)
|
||||
+ @rm -f aarch64_pr23870$(EXEEXT)
|
||||
+ $(AM_V_CCLD)$(aarch64_pr23870_LINK) $(aarch64_pr23870_OBJECTS) $(aarch64_pr23870_LDADD) $(LIBS)
|
||||
+
|
||||
@GCC_FALSE@basic_pic_test$(EXEEXT): $(basic_pic_test_OBJECTS) $(basic_pic_test_DEPENDENCIES) $(EXTRA_basic_pic_test_DEPENDENCIES)
|
||||
@GCC_FALSE@ @rm -f basic_pic_test$(EXEEXT)
|
||||
@GCC_FALSE@ $(LINK) $(basic_pic_test_OBJECTS) $(basic_pic_test_LDADD) $(LIBS)
|
||||
@@ -4397,6 +4415,7 @@ mostlyclean-compile:
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aarch64_pr23870_foo.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_pic_test.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_pie_test.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_static_pic_test.Po@am__quote@
|
||||
@@ -5741,6 +5760,13 @@ pr22266.log: pr22266$(EXEEXT)
|
||||
@p='pr22266$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
|
||||
gnu_property_test.sh.log: gnu_property_test.sh
|
||||
@p='gnu_property_test.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
|
||||
+aarch64_pr23870.log: aarch64_pr23870$(EXEEXT)
|
||||
+ @p='aarch64_pr23870$(EXEEXT)'; \
|
||||
+ b='aarch64_pr23870'; \
|
||||
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
+ --log-file $$b.log --trs-file $$b.trs \
|
||||
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
.test.log:
|
||||
@p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
|
||||
@am__EXEEXT_TRUE@.test$(EXEEXT).log:
|
||||
@@ -7414,6 +7440,14 @@ uninstall-am:
|
||||
@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ pr22266_main.o pr22266_ar.o
|
||||
@GCC_TRUE@@NATIVE_LINKER_TRUE@pr22266_ar.o: pr22266_a.o gcctestdir/ld
|
||||
@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -r -T $(srcdir)/pr22266_script.t -o $@ pr22266_a.o
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_main.o: aarch64_pr23870_main.S
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -o $@ $<
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_foo.o: aarch64_pr23870_foo.c
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -o $@ $<
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_bar.o: aarch64_pr23870_bar.c
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $<
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_bar.so: aarch64_pr23870_bar.o
|
||||
+@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -shared -o $@ $<
|
||||
@NATIVE_OR_CROSS_LINKER_TRUE@script_test_10.o: script_test_10.s
|
||||
@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $<
|
||||
@NATIVE_OR_CROSS_LINKER_TRUE@script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld
|
130
SOURCES/binutils-AArch64-missing-assembler-tests-1.patch
Normal file
130
SOURCES/binutils-AArch64-missing-assembler-tests-1.patch
Normal file
@ -0,0 +1,130 @@
|
||||
From 7e5de6cc9202b3e60a0bec954a59e3550923d710 Mon Sep 17 00:00:00 2001
|
||||
From: Alice Carlotti <alice.carlotti@arm.com>
|
||||
Date: Sun, 20 Apr 2025 23:07:31 +0100
|
||||
Subject: [PATCH] aarch64: Add new test addsub-carry.d
|
||||
|
||||
All instructions were previously untested.
|
||||
---
|
||||
gas/testsuite/gas/aarch64/addsub-carry.d | 53 ++++++++++++++++++++++++
|
||||
gas/testsuite/gas/aarch64/addsub-carry.s | 49 ++++++++++++++++++++++
|
||||
2 files changed, 102 insertions(+)
|
||||
create mode 100644 gas/testsuite/gas/aarch64/addsub-carry.d
|
||||
create mode 100644 gas/testsuite/gas/aarch64/addsub-carry.s
|
||||
|
||||
diff --git a/gas/testsuite/gas/aarch64/addsub-carry.d b/gas/testsuite/gas/aarch64/addsub-carry.d
|
||||
new file mode 100644
|
||||
index 00000000000..9b32d51f77d
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/addsub-carry.d
|
||||
@@ -0,0 +1,53 @@
|
||||
+#as: -march=armv8-a
|
||||
+#objdump: -dr
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+0+ <\.text>:
|
||||
+ *[0-9a-f]+: 1a000000 adc w0, w0, w0
|
||||
+ *[0-9a-f]+: 1a00001f adc wzr, w0, w0
|
||||
+ *[0-9a-f]+: 1a0003e0 adc w0, wzr, w0
|
||||
+ *[0-9a-f]+: 1a1f0000 adc w0, w0, wzr
|
||||
+ *[0-9a-f]+: 9a000000 adc x0, x0, x0
|
||||
+ *[0-9a-f]+: 9a00001f adc xzr, x0, x0
|
||||
+ *[0-9a-f]+: 9a0003e0 adc x0, xzr, x0
|
||||
+ *[0-9a-f]+: 9a1f0000 adc x0, x0, xzr
|
||||
+ *[0-9a-f]+: 3a000000 adcs w0, w0, w0
|
||||
+ *[0-9a-f]+: 3a00001f adcs wzr, w0, w0
|
||||
+ *[0-9a-f]+: 3a0003e0 adcs w0, wzr, w0
|
||||
+ *[0-9a-f]+: 3a1f0000 adcs w0, w0, wzr
|
||||
+ *[0-9a-f]+: ba000000 adcs x0, x0, x0
|
||||
+ *[0-9a-f]+: ba00001f adcs xzr, x0, x0
|
||||
+ *[0-9a-f]+: ba0003e0 adcs x0, xzr, x0
|
||||
+ *[0-9a-f]+: ba1f0000 adcs x0, x0, xzr
|
||||
+ *[0-9a-f]+: 5a000000 sbc w0, w0, w0
|
||||
+ *[0-9a-f]+: 5a00001f sbc wzr, w0, w0
|
||||
+ *[0-9a-f]+: 5a0003e0 ngc w0, w0
|
||||
+ *[0-9a-f]+: 5a1f0000 sbc w0, w0, wzr
|
||||
+ *[0-9a-f]+: da000000 sbc x0, x0, x0
|
||||
+ *[0-9a-f]+: da00001f sbc xzr, x0, x0
|
||||
+ *[0-9a-f]+: da0003e0 ngc x0, x0
|
||||
+ *[0-9a-f]+: da1f0000 sbc x0, x0, xzr
|
||||
+ *[0-9a-f]+: 7a000000 sbcs w0, w0, w0
|
||||
+ *[0-9a-f]+: 7a00001f sbcs wzr, w0, w0
|
||||
+ *[0-9a-f]+: 7a0003e0 ngcs w0, w0
|
||||
+ *[0-9a-f]+: 7a1f0000 sbcs w0, w0, wzr
|
||||
+ *[0-9a-f]+: fa000000 sbcs x0, x0, x0
|
||||
+ *[0-9a-f]+: fa00001f sbcs xzr, x0, x0
|
||||
+ *[0-9a-f]+: fa0003e0 ngcs x0, x0
|
||||
+ *[0-9a-f]+: fa1f0000 sbcs x0, x0, xzr
|
||||
+ *[0-9a-f]+: 5a0003e0 ngc w0, w0
|
||||
+ *[0-9a-f]+: 5a0003ff ngc wzr, w0
|
||||
+ *[0-9a-f]+: 5a1f03e0 ngc w0, wzr
|
||||
+ *[0-9a-f]+: da0003e0 ngc x0, x0
|
||||
+ *[0-9a-f]+: da0003ff ngc xzr, x0
|
||||
+ *[0-9a-f]+: da1f03e0 ngc x0, xzr
|
||||
+ *[0-9a-f]+: 7a0003e0 ngcs w0, w0
|
||||
+ *[0-9a-f]+: 7a0003ff ngcs wzr, w0
|
||||
+ *[0-9a-f]+: 7a1f03e0 ngcs w0, wzr
|
||||
+ *[0-9a-f]+: fa0003e0 ngcs x0, x0
|
||||
+ *[0-9a-f]+: fa0003ff ngcs xzr, x0
|
||||
+ *[0-9a-f]+: fa1f03e0 ngcs x0, xzr
|
||||
diff --git a/gas/testsuite/gas/aarch64/addsub-carry.s b/gas/testsuite/gas/aarch64/addsub-carry.s
|
||||
new file mode 100644
|
||||
index 00000000000..89f2ec15fc2
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/addsub-carry.s
|
||||
@@ -0,0 +1,49 @@
|
||||
+ adc w0, w0, w0
|
||||
+ adc wzr, w0, w0
|
||||
+ adc w0, wzr, w0
|
||||
+ adc w0, w0, wzr
|
||||
+ adc x0, x0, x0
|
||||
+ adc xzr, x0, x0
|
||||
+ adc x0, xzr, x0
|
||||
+ adc x0, x0, xzr
|
||||
+
|
||||
+ adcs w0, w0, w0
|
||||
+ adcs wzr, w0, w0
|
||||
+ adcs w0, wzr, w0
|
||||
+ adcs w0, w0, wzr
|
||||
+ adcs x0, x0, x0
|
||||
+ adcs xzr, x0, x0
|
||||
+ adcs x0, xzr, x0
|
||||
+ adcs x0, x0, xzr
|
||||
+
|
||||
+ sbc w0, w0, w0
|
||||
+ sbc wzr, w0, w0
|
||||
+ sbc w0, wzr, w0
|
||||
+ sbc w0, w0, wzr
|
||||
+ sbc x0, x0, x0
|
||||
+ sbc xzr, x0, x0
|
||||
+ sbc x0, xzr, x0
|
||||
+ sbc x0, x0, xzr
|
||||
+
|
||||
+ sbcs w0, w0, w0
|
||||
+ sbcs wzr, w0, w0
|
||||
+ sbcs w0, wzr, w0
|
||||
+ sbcs w0, w0, wzr
|
||||
+ sbcs x0, x0, x0
|
||||
+ sbcs xzr, x0, x0
|
||||
+ sbcs x0, xzr, x0
|
||||
+ sbcs x0, x0, xzr
|
||||
+
|
||||
+ ngc w0, w0
|
||||
+ ngc wzr, w0
|
||||
+ ngc w0, wzr
|
||||
+ ngc x0, x0
|
||||
+ ngc xzr, x0
|
||||
+ ngc x0, xzr
|
||||
+
|
||||
+ ngcs w0, w0
|
||||
+ ngcs wzr, w0
|
||||
+ ngcs w0, wzr
|
||||
+ ngcs x0, x0
|
||||
+ ngcs xzr, x0
|
||||
+ ngcs x0, xzr
|
||||
--
|
||||
2.50.1
|
||||
|
83
SOURCES/binutils-AArch64-missing-assembler-tests-10.patch
Normal file
83
SOURCES/binutils-AArch64-missing-assembler-tests-10.patch
Normal file
@ -0,0 +1,83 @@
|
||||
From f495cce64504db4b66a23479022c887fa04a1242 Mon Sep 17 00:00:00 2001
|
||||
From: Alice Carlotti <alice.carlotti@arm.com>
|
||||
Date: Sun, 20 Apr 2025 23:12:00 +0100
|
||||
Subject: [PATCH] aarch64: Add new test exception-generation.d
|
||||
|
||||
svc and dcps* were already tested, but are included here as part of the
|
||||
same encoding group.
|
||||
---
|
||||
.../gas/aarch64/exception-generation.d | 28 +++++++++++++++++++
|
||||
.../gas/aarch64/exception-generation.s | 26 +++++++++++++++++
|
||||
2 files changed, 54 insertions(+)
|
||||
create mode 100644 gas/testsuite/gas/aarch64/exception-generation.d
|
||||
create mode 100644 gas/testsuite/gas/aarch64/exception-generation.s
|
||||
|
||||
diff --git a/gas/testsuite/gas/aarch64/exception-generation.d b/gas/testsuite/gas/aarch64/exception-generation.d
|
||||
new file mode 100644
|
||||
index 00000000000..e35cccd5831
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/exception-generation.d
|
||||
@@ -0,0 +1,28 @@
|
||||
+#as: -march=armv8-a
|
||||
+#objdump: -dr
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+0+ <\.text>:
|
||||
+ *[0-9a-f]+: d4000001 svc #0x0
|
||||
+ *[0-9a-f]+: d41fffe1 svc #0xffff
|
||||
+ *[0-9a-f]+: d4000002 hvc #0x0
|
||||
+ *[0-9a-f]+: d41fffe2 hvc #0xffff
|
||||
+ *[0-9a-f]+: d4000003 smc #0x0
|
||||
+ *[0-9a-f]+: d41fffe3 smc #0xffff
|
||||
+ *[0-9a-f]+: d4200000 brk #0x0
|
||||
+ *[0-9a-f]+: d43fffe0 brk #0xffff
|
||||
+ *[0-9a-f]+: d4400000 hlt #0x0
|
||||
+ *[0-9a-f]+: d45fffe0 hlt #0xffff
|
||||
+ *[0-9a-f]+: d4a00001 dcps1
|
||||
+ *[0-9a-f]+: d4a00001 dcps1
|
||||
+ *[0-9a-f]+: d4bfffe1 dcps1 #0xffff
|
||||
+ *[0-9a-f]+: d4a00002 dcps2
|
||||
+ *[0-9a-f]+: d4a00002 dcps2
|
||||
+ *[0-9a-f]+: d4bfffe2 dcps2 #0xffff
|
||||
+ *[0-9a-f]+: d4a00003 dcps3
|
||||
+ *[0-9a-f]+: d4a00003 dcps3
|
||||
+ *[0-9a-f]+: d4bfffe3 dcps3 #0xffff
|
||||
diff --git a/gas/testsuite/gas/aarch64/exception-generation.s b/gas/testsuite/gas/aarch64/exception-generation.s
|
||||
new file mode 100644
|
||||
index 00000000000..56294fe57cd
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/exception-generation.s
|
||||
@@ -0,0 +1,26 @@
|
||||
+ svc #0
|
||||
+ svc #65535
|
||||
+
|
||||
+ hvc #0
|
||||
+ hvc #65535
|
||||
+
|
||||
+ smc #0
|
||||
+ smc #65535
|
||||
+
|
||||
+ brk #0
|
||||
+ brk #65535
|
||||
+
|
||||
+ hlt #0
|
||||
+ hlt #65535
|
||||
+
|
||||
+ dcps1
|
||||
+ dcps1 #0
|
||||
+ dcps1 #65535
|
||||
+
|
||||
+ dcps2
|
||||
+ dcps2 #0
|
||||
+ dcps2 #65535
|
||||
+
|
||||
+ dcps3
|
||||
+ dcps3 #0
|
||||
+ dcps3 #65535
|
||||
--
|
||||
2.50.1
|
||||
|
153
SOURCES/binutils-AArch64-missing-assembler-tests-11.patch
Normal file
153
SOURCES/binutils-AArch64-missing-assembler-tests-11.patch
Normal file
@ -0,0 +1,153 @@
|
||||
From 37c162f51a3f1399b0cd3bc2b744d41432119762 Mon Sep 17 00:00:00 2001
|
||||
From: Alice Carlotti <alice.carlotti@arm.com>
|
||||
Date: Sun, 20 Apr 2025 23:10:33 +0100
|
||||
Subject: [PATCH] aarch64: Add new test ldst-unpriv.d
|
||||
|
||||
All instructions were previously untested.
|
||||
---
|
||||
gas/testsuite/gas/aarch64/ldst-unpriv.d | 61 +++++++++++++++++++++++
|
||||
gas/testsuite/gas/aarch64/ldst-unpriv.s | 64 +++++++++++++++++++++++++
|
||||
2 files changed, 125 insertions(+)
|
||||
create mode 100644 gas/testsuite/gas/aarch64/ldst-unpriv.d
|
||||
create mode 100644 gas/testsuite/gas/aarch64/ldst-unpriv.s
|
||||
|
||||
diff --git a/gas/testsuite/gas/aarch64/ldst-unpriv.d b/gas/testsuite/gas/aarch64/ldst-unpriv.d
|
||||
new file mode 100644
|
||||
index 00000000000..9c33678b28f
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/ldst-unpriv.d
|
||||
@@ -0,0 +1,61 @@
|
||||
+#as: -march=armv8-a
|
||||
+#objdump: -dr
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+0+ <\.text>:
|
||||
+ *[0-9a-f]+: 38000800 sttrb w0, \[x0\]
|
||||
+ *[0-9a-f]+: 3800081f sttrb wzr, \[x0\]
|
||||
+ *[0-9a-f]+: 38000be0 sttrb w0, \[sp\]
|
||||
+ *[0-9a-f]+: 381ff800 sttrb w0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: 38400800 ldtrb w0, \[x0\]
|
||||
+ *[0-9a-f]+: 3840081f ldtrb wzr, \[x0\]
|
||||
+ *[0-9a-f]+: 38400be0 ldtrb w0, \[sp\]
|
||||
+ *[0-9a-f]+: 385ff800 ldtrb w0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: 38800800 ldtrsb x0, \[x0\]
|
||||
+ *[0-9a-f]+: 3880081f ldtrsb xzr, \[x0\]
|
||||
+ *[0-9a-f]+: 38800be0 ldtrsb x0, \[sp\]
|
||||
+ *[0-9a-f]+: 389ff800 ldtrsb x0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: 38c00800 ldtrsb w0, \[x0\]
|
||||
+ *[0-9a-f]+: 38c0081f ldtrsb wzr, \[x0\]
|
||||
+ *[0-9a-f]+: 38c00be0 ldtrsb w0, \[sp\]
|
||||
+ *[0-9a-f]+: 38dff800 ldtrsb w0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: 78000800 sttrh w0, \[x0\]
|
||||
+ *[0-9a-f]+: 7800081f sttrh wzr, \[x0\]
|
||||
+ *[0-9a-f]+: 78000be0 sttrh w0, \[sp\]
|
||||
+ *[0-9a-f]+: 781ff800 sttrh w0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: 78400800 ldtrh w0, \[x0\]
|
||||
+ *[0-9a-f]+: 7840081f ldtrh wzr, \[x0\]
|
||||
+ *[0-9a-f]+: 78400be0 ldtrh w0, \[sp\]
|
||||
+ *[0-9a-f]+: 785ff800 ldtrh w0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: 78800800 ldtrsh x0, \[x0\]
|
||||
+ *[0-9a-f]+: 7880081f ldtrsh xzr, \[x0\]
|
||||
+ *[0-9a-f]+: 78800be0 ldtrsh x0, \[sp\]
|
||||
+ *[0-9a-f]+: 789ff800 ldtrsh x0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: 78c00800 ldtrsh w0, \[x0\]
|
||||
+ *[0-9a-f]+: 78c0081f ldtrsh wzr, \[x0\]
|
||||
+ *[0-9a-f]+: 78c00be0 ldtrsh w0, \[sp\]
|
||||
+ *[0-9a-f]+: 78dff800 ldtrsh w0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: b8000800 sttr w0, \[x0\]
|
||||
+ *[0-9a-f]+: b800081f sttr wzr, \[x0\]
|
||||
+ *[0-9a-f]+: b8000be0 sttr w0, \[sp\]
|
||||
+ *[0-9a-f]+: b81ff800 sttr w0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: b8400800 ldtr w0, \[x0\]
|
||||
+ *[0-9a-f]+: b840081f ldtr wzr, \[x0\]
|
||||
+ *[0-9a-f]+: b8400be0 ldtr w0, \[sp\]
|
||||
+ *[0-9a-f]+: b85ff800 ldtr w0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: b8800800 ldtrsw x0, \[x0\]
|
||||
+ *[0-9a-f]+: b880081f ldtrsw xzr, \[x0\]
|
||||
+ *[0-9a-f]+: b8800be0 ldtrsw x0, \[sp\]
|
||||
+ *[0-9a-f]+: b89ff800 ldtrsw x0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: f8000800 sttr x0, \[x0\]
|
||||
+ *[0-9a-f]+: f800081f sttr xzr, \[x0\]
|
||||
+ *[0-9a-f]+: f8000be0 sttr x0, \[sp\]
|
||||
+ *[0-9a-f]+: f81ff800 sttr x0, \[x0, #-1\]
|
||||
+ *[0-9a-f]+: f8400800 ldtr x0, \[x0\]
|
||||
+ *[0-9a-f]+: f840081f ldtr xzr, \[x0\]
|
||||
+ *[0-9a-f]+: f8400be0 ldtr x0, \[sp\]
|
||||
+ *[0-9a-f]+: f85ff800 ldtr x0, \[x0, #-1\]
|
||||
diff --git a/gas/testsuite/gas/aarch64/ldst-unpriv.s b/gas/testsuite/gas/aarch64/ldst-unpriv.s
|
||||
new file mode 100644
|
||||
index 00000000000..52f6461ce97
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/ldst-unpriv.s
|
||||
@@ -0,0 +1,64 @@
|
||||
+ sttrb w0, [x0]
|
||||
+ sttrb wzr, [x0, #0]
|
||||
+ sttrb w0, [sp]
|
||||
+ sttrb w0, [x0, #-1]
|
||||
+
|
||||
+ ldtrb w0, [x0]
|
||||
+ ldtrb wzr, [x0, #0]
|
||||
+ ldtrb w0, [sp]
|
||||
+ ldtrb w0, [x0, #-1]
|
||||
+
|
||||
+ ldtrsb x0, [x0]
|
||||
+ ldtrsb xzr, [x0, #0]
|
||||
+ ldtrsb x0, [sp]
|
||||
+ ldtrsb x0, [x0, #-1]
|
||||
+
|
||||
+ ldtrsb w0, [x0]
|
||||
+ ldtrsb wzr, [x0, #0]
|
||||
+ ldtrsb w0, [sp]
|
||||
+ ldtrsb w0, [x0, #-1]
|
||||
+
|
||||
+ sttrh w0, [x0]
|
||||
+ sttrh wzr, [x0, #0]
|
||||
+ sttrh w0, [sp]
|
||||
+ sttrh w0, [x0, #-1]
|
||||
+
|
||||
+ ldtrh w0, [x0]
|
||||
+ ldtrh wzr, [x0, #0]
|
||||
+ ldtrh w0, [sp]
|
||||
+ ldtrh w0, [x0, #-1]
|
||||
+
|
||||
+ ldtrsh x0, [x0]
|
||||
+ ldtrsh xzr, [x0, #0]
|
||||
+ ldtrsh x0, [sp]
|
||||
+ ldtrsh x0, [x0, #-1]
|
||||
+
|
||||
+ ldtrsh w0, [x0]
|
||||
+ ldtrsh wzr, [x0, #0]
|
||||
+ ldtrsh w0, [sp]
|
||||
+ ldtrsh w0, [x0, #-1]
|
||||
+
|
||||
+ sttr w0, [x0]
|
||||
+ sttr wzr, [x0, #0]
|
||||
+ sttr w0, [sp]
|
||||
+ sttr w0, [x0, #-1]
|
||||
+
|
||||
+ ldtr w0, [x0]
|
||||
+ ldtr wzr, [x0, #0]
|
||||
+ ldtr w0, [sp]
|
||||
+ ldtr w0, [x0, #-1]
|
||||
+
|
||||
+ ldtrsw x0, [x0]
|
||||
+ ldtrsw xzr, [x0, #0]
|
||||
+ ldtrsw x0, [sp]
|
||||
+ ldtrsw x0, [x0, #-1]
|
||||
+
|
||||
+ sttr x0, [x0]
|
||||
+ sttr xzr, [x0, #0]
|
||||
+ sttr x0, [sp]
|
||||
+ sttr x0, [x0, #-1]
|
||||
+
|
||||
+ ldtr x0, [x0]
|
||||
+ ldtr xzr, [x0, #0]
|
||||
+ ldtr x0, [sp]
|
||||
+ ldtr x0, [x0, #-1]
|
||||
--
|
||||
2.50.1
|
||||
|
40
SOURCES/binutils-AArch64-missing-assembler-tests-12.patch
Normal file
40
SOURCES/binutils-AArch64-missing-assembler-tests-12.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From 727964dd52f5e6d1a42cf0a12508bb0ee4e23833 Mon Sep 17 00:00:00 2001
|
||||
From: Alice Carlotti <alice.carlotti@arm.com>
|
||||
Date: Sun, 20 Apr 2025 23:20:44 +0100
|
||||
Subject: [PATCH] aarch64: Add tests for csdb and eret to system.d
|
||||
|
||||
---
|
||||
--- binutils-2.35.2.orig/gas/testsuite/gas/aarch64/system.s 2025-07-22 08:52:03.803039248 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/aarch64/system.s 2025-07-22 09:07:13.082237231 +0100
|
||||
@@ -1,5 +1,6 @@
|
||||
.text
|
||||
drps
|
||||
+ eret
|
||||
|
||||
//
|
||||
// HINTS
|
||||
@@ -11,6 +12,7 @@
|
||||
wfi
|
||||
sev
|
||||
sevl
|
||||
+ csdb
|
||||
|
||||
.macro all_hints from=0, to=127
|
||||
hint \from
|
||||
--- binutils-2.35.2.orig/gas/testsuite/gas/aarch64/system.d 2025-07-22 08:52:03.809039283 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/aarch64/system.d 2025-07-22 09:07:49.780518903 +0100
|
||||
@@ -6,12 +6,14 @@ Disassembly of section \.text:
|
||||
|
||||
0+ <.*>:
|
||||
.*: d6bf03e0 drps
|
||||
+.*: d69f03e0 eret
|
||||
.*: d503201f nop
|
||||
.*: d503203f yield
|
||||
.*: d503205f wfe
|
||||
.*: d503207f wfi
|
||||
.*: d503209f sev
|
||||
.*: d50320bf sevl
|
||||
+.*: d503229f csdb
|
||||
.*: d503201f nop
|
||||
.*: d503203f yield
|
||||
.*: d503205f wfe
|
390
SOURCES/binutils-AArch64-missing-assembler-tests-2.patch
Normal file
390
SOURCES/binutils-AArch64-missing-assembler-tests-2.patch
Normal file
@ -0,0 +1,390 @@
|
||||
From 6fb41cbeebaf0e36affb0037c182edf938aae0d3 Mon Sep 17 00:00:00 2001
|
||||
From: Alice Carlotti <alice.carlotti@arm.com>
|
||||
Date: Sun, 20 Apr 2025 23:02:01 +0100
|
||||
Subject: [PATCH] aarch64: Add new test advsimd-copy.d
|
||||
|
||||
Only smov and the second dup variant were previously untested. However,
|
||||
the only test for umov was a disassembly test with -M no-aliases, and
|
||||
the first dup variant was only tested in assembly in diagnostic.d with
|
||||
the non-architectural syntax `dup v0.2d, v1.2d[0]`.
|
||||
---
|
||||
gas/testsuite/gas/aarch64/advsimd-copy.d | 178 ++++++++++++++++++++++
|
||||
gas/testsuite/gas/aarch64/advsimd-copy.s | 181 +++++++++++++++++++++++
|
||||
2 files changed, 359 insertions(+)
|
||||
create mode 100644 gas/testsuite/gas/aarch64/advsimd-copy.d
|
||||
create mode 100644 gas/testsuite/gas/aarch64/advsimd-copy.s
|
||||
|
||||
diff --git a/gas/testsuite/gas/aarch64/advsimd-copy.d b/gas/testsuite/gas/aarch64/advsimd-copy.d
|
||||
new file mode 100644
|
||||
index 00000000000..59ade08186d
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/advsimd-copy.d
|
||||
@@ -0,0 +1,178 @@
|
||||
+#as: -march=armv8-a
|
||||
+#objdump: -dr
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+0+ <\.text>:
|
||||
+ *[0-9a-f]+: 0e010400 dup v0\.8b, v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 0e01041f dup v31\.8b, v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 0e0107e0 dup v0\.8b, v31\.b\[0\]
|
||||
+ *[0-9a-f]+: 0e1f0400 dup v0\.8b, v0\.b\[15\]
|
||||
+ *[0-9a-f]+: 0e020400 dup v0\.4h, v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 0e02041f dup v31\.4h, v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 0e0207e0 dup v0\.4h, v31\.h\[0\]
|
||||
+ *[0-9a-f]+: 0e1e0400 dup v0\.4h, v0\.h\[7\]
|
||||
+ *[0-9a-f]+: 0e040400 dup v0\.2s, v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 0e04041f dup v31\.2s, v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 0e0407e0 dup v0\.2s, v31\.s\[0\]
|
||||
+ *[0-9a-f]+: 0e1c0400 dup v0\.2s, v0\.s\[3\]
|
||||
+ *[0-9a-f]+: 4e010400 dup v0\.16b, v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 4e01041f dup v31\.16b, v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 4e0107e0 dup v0\.16b, v31\.b\[0\]
|
||||
+ *[0-9a-f]+: 4e1f0400 dup v0\.16b, v0\.b\[15\]
|
||||
+ *[0-9a-f]+: 4e020400 dup v0\.8h, v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 4e02041f dup v31\.8h, v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 4e0207e0 dup v0\.8h, v31\.h\[0\]
|
||||
+ *[0-9a-f]+: 4e1e0400 dup v0\.8h, v0\.h\[7\]
|
||||
+ *[0-9a-f]+: 4e040400 dup v0\.4s, v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 4e04041f dup v31\.4s, v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 4e0407e0 dup v0\.4s, v31\.s\[0\]
|
||||
+ *[0-9a-f]+: 4e1c0400 dup v0\.4s, v0\.s\[3\]
|
||||
+ *[0-9a-f]+: 4e080400 dup v0\.2d, v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 4e08041f dup v31\.2d, v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 4e0807e0 dup v0\.2d, v31\.d\[0\]
|
||||
+ *[0-9a-f]+: 4e180400 dup v0.2d, v0.d\[1\]
|
||||
+ *[0-9a-f]+: 0e010c00 dup v0\.8b, w0
|
||||
+ *[0-9a-f]+: 0e010c1f dup v31\.8b, w0
|
||||
+ *[0-9a-f]+: 0e010fe0 dup v0\.8b, wzr
|
||||
+ *[0-9a-f]+: 0e020c00 dup v0\.4h, w0
|
||||
+ *[0-9a-f]+: 0e020c1f dup v31\.4h, w0
|
||||
+ *[0-9a-f]+: 0e020fe0 dup v0\.4h, wzr
|
||||
+ *[0-9a-f]+: 0e040c00 dup v0\.2s, w0
|
||||
+ *[0-9a-f]+: 0e040c1f dup v31\.2s, w0
|
||||
+ *[0-9a-f]+: 0e040fe0 dup v0\.2s, wzr
|
||||
+ *[0-9a-f]+: 4e010c00 dup v0\.16b, w0
|
||||
+ *[0-9a-f]+: 4e010c1f dup v31\.16b, w0
|
||||
+ *[0-9a-f]+: 4e010fe0 dup v0\.16b, wzr
|
||||
+ *[0-9a-f]+: 4e020c00 dup v0\.8h, w0
|
||||
+ *[0-9a-f]+: 4e020c1f dup v31\.8h, w0
|
||||
+ *[0-9a-f]+: 4e020fe0 dup v0\.8h, wzr
|
||||
+ *[0-9a-f]+: 4e040c00 dup v0\.4s, w0
|
||||
+ *[0-9a-f]+: 4e040c1f dup v31\.4s, w0
|
||||
+ *[0-9a-f]+: 4e040fe0 dup v0\.4s, wzr
|
||||
+ *[0-9a-f]+: 4e080c00 dup v0\.2d, x0
|
||||
+ *[0-9a-f]+: 4e080c1f dup v31\.2d, x0
|
||||
+ *[0-9a-f]+: 4e080fe0 dup v0\.2d, xzr
|
||||
+ *[0-9a-f]+: 0e150c00 dup v0\.8b, w0
|
||||
+ *[0-9a-f]+: 4e180c00 dup v0\.2d, x0
|
||||
+ *[0-9a-f]+: 0e012c00 smov w0, v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 0e012c1f smov wzr, v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 0e012fe0 smov w0, v31\.b\[0\]
|
||||
+ *[0-9a-f]+: 0e1f2c00 smov w0, v0\.b\[15\]
|
||||
+ *[0-9a-f]+: 0e022c00 smov w0, v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 0e022c1f smov wzr, v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 0e022fe0 smov w0, v31\.h\[0\]
|
||||
+ *[0-9a-f]+: 0e1e2c00 smov w0, v0\.h\[7\]
|
||||
+ *[0-9a-f]+: 4e012c00 smov x0, v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 4e012c1f smov xzr, v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 4e012fe0 smov x0, v31\.b\[0\]
|
||||
+ *[0-9a-f]+: 4e1f2c00 smov x0, v0\.b\[15\]
|
||||
+ *[0-9a-f]+: 4e022c00 smov x0, v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 4e022c1f smov xzr, v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 4e022fe0 smov x0, v31\.h\[0\]
|
||||
+ *[0-9a-f]+: 4e1e2c00 smov x0, v0\.h\[7\]
|
||||
+ *[0-9a-f]+: 4e042c00 smov x0, v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 4e042c1f smov xzr, v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 4e042fe0 smov x0, v31\.s\[0\]
|
||||
+ *[0-9a-f]+: 4e1c2c00 smov x0, v0\.s\[3\]
|
||||
+ *[0-9a-f]+: 0e013c00 umov w0, v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 0e013c1f umov wzr, v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 0e013fe0 umov w0, v31\.b\[0\]
|
||||
+ *[0-9a-f]+: 0e1f3c00 umov w0, v0\.b\[15\]
|
||||
+ *[0-9a-f]+: 0e023c00 umov w0, v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 0e023c1f umov wzr, v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 0e023fe0 umov w0, v31\.h\[0\]
|
||||
+ *[0-9a-f]+: 0e1e3c00 umov w0, v0\.h\[7\]
|
||||
+ *[0-9a-f]+: 0e043c00 mov w0, v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 0e043c1f mov wzr, v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 0e043fe0 mov w0, v31\.s\[0\]
|
||||
+ *[0-9a-f]+: 0e1c3c00 mov w0, v0\.s\[3\]
|
||||
+ *[0-9a-f]+: 4e083c00 mov x0, v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 4e083c1f mov xzr, v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 4e083fe0 mov x0, v31\.d\[0\]
|
||||
+ *[0-9a-f]+: 4e183c00 mov x0, v0\.d\[1\]
|
||||
+ *[0-9a-f]+: 0e043c00 mov w0, v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 0e043c1f mov wzr, v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 0e043fe0 mov w0, v31\.s\[0\]
|
||||
+ *[0-9a-f]+: 0e1c3c00 mov w0, v0\.s\[3\]
|
||||
+ *[0-9a-f]+: 4e083c00 mov x0, v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 4e083c1f mov xzr, v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 4e083fe0 mov x0, v31\.d\[0\]
|
||||
+ *[0-9a-f]+: 4e183c00 mov x0, v0\.d\[1\]
|
||||
+ *[0-9a-f]+: 4e011c00 mov v0\.b\[0\], w0
|
||||
+ *[0-9a-f]+: 4e011c1f mov v31\.b\[0\], w0
|
||||
+ *[0-9a-f]+: 4e011fe0 mov v0\.b\[0\], wzr
|
||||
+ *[0-9a-f]+: 4e1f1c00 mov v0\.b\[15\], w0
|
||||
+ *[0-9a-f]+: 4e021c00 mov v0\.h\[0\], w0
|
||||
+ *[0-9a-f]+: 4e021c1f mov v31\.h\[0\], w0
|
||||
+ *[0-9a-f]+: 4e021fe0 mov v0\.h\[0\], wzr
|
||||
+ *[0-9a-f]+: 4e1e1c00 mov v0\.h\[7\], w0
|
||||
+ *[0-9a-f]+: 4e041c00 mov v0\.s\[0\], w0
|
||||
+ *[0-9a-f]+: 4e041c1f mov v31\.s\[0\], w0
|
||||
+ *[0-9a-f]+: 4e041fe0 mov v0\.s\[0\], wzr
|
||||
+ *[0-9a-f]+: 4e1c1c00 mov v0\.s\[3\], w0
|
||||
+ *[0-9a-f]+: 4e081c00 mov v0\.d\[0\], x0
|
||||
+ *[0-9a-f]+: 4e081c1f mov v31\.d\[0\], x0
|
||||
+ *[0-9a-f]+: 4e081fe0 mov v0\.d\[0\], xzr
|
||||
+ *[0-9a-f]+: 4e181c00 mov v0\.d\[1\], x0
|
||||
+ *[0-9a-f]+: 4e011c00 mov v0\.b\[0\], w0
|
||||
+ *[0-9a-f]+: 4e011c1f mov v31\.b\[0\], w0
|
||||
+ *[0-9a-f]+: 4e011fe0 mov v0\.b\[0\], wzr
|
||||
+ *[0-9a-f]+: 4e1f1c00 mov v0\.b\[15\], w0
|
||||
+ *[0-9a-f]+: 4e021c00 mov v0\.h\[0\], w0
|
||||
+ *[0-9a-f]+: 4e021c1f mov v31\.h\[0\], w0
|
||||
+ *[0-9a-f]+: 4e021fe0 mov v0\.h\[0\], wzr
|
||||
+ *[0-9a-f]+: 4e1e1c00 mov v0\.h\[7\], w0
|
||||
+ *[0-9a-f]+: 4e041c00 mov v0\.s\[0\], w0
|
||||
+ *[0-9a-f]+: 4e041c1f mov v31\.s\[0\], w0
|
||||
+ *[0-9a-f]+: 4e041fe0 mov v0\.s\[0\], wzr
|
||||
+ *[0-9a-f]+: 4e1c1c00 mov v0\.s\[3\], w0
|
||||
+ *[0-9a-f]+: 4e081c00 mov v0\.d\[0\], x0
|
||||
+ *[0-9a-f]+: 4e081c1f mov v31\.d\[0\], x0
|
||||
+ *[0-9a-f]+: 4e081fe0 mov v0\.d\[0\], xzr
|
||||
+ *[0-9a-f]+: 4e181c00 mov v0\.d\[1\], x0
|
||||
+ *[0-9a-f]+: 6e010400 mov v0\.b\[0\], v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 6e01041f mov v31\.b\[0\], v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 6e0107e0 mov v0\.b\[0\], v31\.b\[0\]
|
||||
+ *[0-9a-f]+: 6e1f0400 mov v0\.b\[15\], v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 6e017c00 mov v0\.b\[0\], v0\.b\[15\]
|
||||
+ *[0-9a-f]+: 6e020400 mov v0\.h\[0\], v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 6e02041f mov v31\.h\[0\], v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 6e0207e0 mov v0\.h\[0\], v31\.h\[0\]
|
||||
+ *[0-9a-f]+: 6e1e0400 mov v0\.h\[7\], v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 6e027400 mov v0\.h\[0\], v0\.h\[7\]
|
||||
+ *[0-9a-f]+: 6e040400 mov v0\.s\[0\], v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 6e04041f mov v31\.s\[0\], v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 6e0407e0 mov v0\.s\[0\], v31\.s\[0\]
|
||||
+ *[0-9a-f]+: 6e1c0400 mov v0\.s\[3\], v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 6e046400 mov v0\.s\[0\], v0\.s\[3\]
|
||||
+ *[0-9a-f]+: 6e080400 mov v0\.d\[0\], v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 6e08041f mov v31\.d\[0\], v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 6e0807e0 mov v0\.d\[0\], v31\.d\[0\]
|
||||
+ *[0-9a-f]+: 6e180400 mov v0\.d\[1\], v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 6e084400 mov v0\.d\[0\], v0\.d\[1\]
|
||||
+ *[0-9a-f]+: 6e022c00 mov v0\.h\[0\], v0\.h\[2\]
|
||||
+ *[0-9a-f]+: 6e083c00 mov v0\.d\[0\], v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 6e010400 mov v0\.b\[0\], v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 6e01041f mov v31\.b\[0\], v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 6e0107e0 mov v0\.b\[0\], v31\.b\[0\]
|
||||
+ *[0-9a-f]+: 6e1f0400 mov v0\.b\[15\], v0\.b\[0\]
|
||||
+ *[0-9a-f]+: 6e017c00 mov v0\.b\[0\], v0\.b\[15\]
|
||||
+ *[0-9a-f]+: 6e020400 mov v0\.h\[0\], v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 6e02041f mov v31\.h\[0\], v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 6e0207e0 mov v0\.h\[0\], v31\.h\[0\]
|
||||
+ *[0-9a-f]+: 6e1e0400 mov v0\.h\[7\], v0\.h\[0\]
|
||||
+ *[0-9a-f]+: 6e027400 mov v0\.h\[0\], v0\.h\[7\]
|
||||
+ *[0-9a-f]+: 6e040400 mov v0\.s\[0\], v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 6e04041f mov v31\.s\[0\], v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 6e0407e0 mov v0\.s\[0\], v31\.s\[0\]
|
||||
+ *[0-9a-f]+: 6e1c0400 mov v0\.s\[3\], v0\.s\[0\]
|
||||
+ *[0-9a-f]+: 6e046400 mov v0\.s\[0\], v0\.s\[3\]
|
||||
+ *[0-9a-f]+: 6e080400 mov v0\.d\[0\], v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 6e08041f mov v31\.d\[0\], v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 6e0807e0 mov v0\.d\[0\], v31\.d\[0\]
|
||||
+ *[0-9a-f]+: 6e180400 mov v0\.d\[1\], v0\.d\[0\]
|
||||
+ *[0-9a-f]+: 6e084400 mov v0\.d\[0\], v0\.d\[1\]
|
||||
diff --git a/gas/testsuite/gas/aarch64/advsimd-copy.s b/gas/testsuite/gas/aarch64/advsimd-copy.s
|
||||
new file mode 100644
|
||||
index 00000000000..d0618948686
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/advsimd-copy.s
|
||||
@@ -0,0 +1,181 @@
|
||||
+ dup v0.8b, v0.b[0]
|
||||
+ dup v31.8b, v0.b[0]
|
||||
+ dup v0.8b, v31.b[0]
|
||||
+ dup v0.8b, v0.b[15]
|
||||
+ dup v0.4h, v0.h[0]
|
||||
+ dup v31.4h, v0.h[0]
|
||||
+ dup v0.4h, v31.h[0]
|
||||
+ dup v0.4h, v0.h[7]
|
||||
+ dup v0.2s, v0.s[0]
|
||||
+ dup v31.2s, v0.s[0]
|
||||
+ dup v0.2s, v31.s[0]
|
||||
+ dup v0.2s, v0.s[3]
|
||||
+ dup v0.16b, v0.b[0]
|
||||
+ dup v31.16b, v0.b[0]
|
||||
+ dup v0.16b, v31.b[0]
|
||||
+ dup v0.16b, v0.b[15]
|
||||
+ dup v0.8h, v0.h[0]
|
||||
+ dup v31.8h, v0.h[0]
|
||||
+ dup v0.8h, v31.h[0]
|
||||
+ dup v0.8h, v0.h[7]
|
||||
+ dup v0.4s, v0.s[0]
|
||||
+ dup v31.4s, v0.s[0]
|
||||
+ dup v0.4s, v31.s[0]
|
||||
+ dup v0.4s, v0.s[3]
|
||||
+ dup v0.2d, v0.d[0]
|
||||
+ dup v31.2d, v0.d[0]
|
||||
+ dup v0.2d, v31.d[0]
|
||||
+ dup v0.2d, v0.d[1]
|
||||
+
|
||||
+ dup v0.8b, w0
|
||||
+ dup v31.8b, w0
|
||||
+ dup v0.8b, wzr
|
||||
+ dup v0.4h, w0
|
||||
+ dup v31.4h, w0
|
||||
+ dup v0.4h, wzr
|
||||
+ dup v0.2s, w0
|
||||
+ dup v31.2s, w0
|
||||
+ dup v0.2s, wzr
|
||||
+ dup v0.16b, w0
|
||||
+ dup v31.16b, w0
|
||||
+ dup v0.16b, wzr
|
||||
+ dup v0.8h, w0
|
||||
+ dup v31.8h, w0
|
||||
+ dup v0.8h, wzr
|
||||
+ dup v0.4s, w0
|
||||
+ dup v31.4s, w0
|
||||
+ dup v0.4s, wzr
|
||||
+ dup v0.2d, x0
|
||||
+ dup v31.2d, x0
|
||||
+ dup v0.2d, xzr
|
||||
+// Unspecified bits in imm5 (20..16) are ignored but should be set to zero by
|
||||
+// an assembler. This tests disassembly when the ignored bits are nonzero.
|
||||
+ .inst 0x0e150c00
|
||||
+ .inst 0x4e180c00
|
||||
+
|
||||
+ smov w0, v0.b[0]
|
||||
+ smov wzr, v0.b[0]
|
||||
+ smov w0, v31.b[0]
|
||||
+ smov w0, v0.b[15]
|
||||
+ smov w0, v0.h[0]
|
||||
+ smov wzr, v0.h[0]
|
||||
+ smov w0, v31.h[0]
|
||||
+ smov w0, v0.h[7]
|
||||
+ smov x0, v0.b[0]
|
||||
+ smov xzr, v0.b[0]
|
||||
+ smov x0, v31.b[0]
|
||||
+ smov x0, v0.b[15]
|
||||
+ smov x0, v0.h[0]
|
||||
+ smov xzr, v0.h[0]
|
||||
+ smov x0, v31.h[0]
|
||||
+ smov x0, v0.h[7]
|
||||
+ smov x0, v0.s[0]
|
||||
+ smov xzr, v0.s[0]
|
||||
+ smov x0, v31.s[0]
|
||||
+ smov x0, v0.s[3]
|
||||
+
|
||||
+ umov w0, v0.b[0]
|
||||
+ umov wzr, v0.b[0]
|
||||
+ umov w0, v31.b[0]
|
||||
+ umov w0, v0.b[15]
|
||||
+ umov w0, v0.h[0]
|
||||
+ umov wzr, v0.h[0]
|
||||
+ umov w0, v31.h[0]
|
||||
+ umov w0, v0.h[7]
|
||||
+ umov w0, v0.s[0]
|
||||
+ umov wzr, v0.s[0]
|
||||
+ umov w0, v31.s[0]
|
||||
+ umov w0, v0.s[3]
|
||||
+ umov x0, v0.d[0]
|
||||
+ umov xzr, v0.d[0]
|
||||
+ umov x0, v31.d[0]
|
||||
+ umov x0, v0.d[1]
|
||||
+
|
||||
+ mov w0, v0.s[0]
|
||||
+ mov wzr, v0.s[0]
|
||||
+ mov w0, v31.s[0]
|
||||
+ mov w0, v0.s[3]
|
||||
+ mov x0, v0.d[0]
|
||||
+ mov xzr, v0.d[0]
|
||||
+ mov x0, v31.d[0]
|
||||
+ mov x0, v0.d[1]
|
||||
+
|
||||
+ ins v0.b[0], w0
|
||||
+ ins v31.b[0], w0
|
||||
+ ins v0.b[0], wzr
|
||||
+ ins v0.b[15], w0
|
||||
+ ins v0.h[0], w0
|
||||
+ ins v31.h[0], w0
|
||||
+ ins v0.h[0], wzr
|
||||
+ ins v0.h[7], w0
|
||||
+ ins v0.s[0], w0
|
||||
+ ins v31.s[0], w0
|
||||
+ ins v0.s[0], wzr
|
||||
+ ins v0.s[3], w0
|
||||
+ ins v0.d[0], x0
|
||||
+ ins v31.d[0], x0
|
||||
+ ins v0.d[0], xzr
|
||||
+ ins v0.d[1], x0
|
||||
+
|
||||
+ mov v0.b[0], w0
|
||||
+ mov v31.b[0], w0
|
||||
+ mov v0.b[0], wzr
|
||||
+ mov v0.b[15], w0
|
||||
+ mov v0.h[0], w0
|
||||
+ mov v31.h[0], w0
|
||||
+ mov v0.h[0], wzr
|
||||
+ mov v0.h[7], w0
|
||||
+ mov v0.s[0], w0
|
||||
+ mov v31.s[0], w0
|
||||
+ mov v0.s[0], wzr
|
||||
+ mov v0.s[3], w0
|
||||
+ mov v0.d[0], x0
|
||||
+ mov v31.d[0], x0
|
||||
+ mov v0.d[0], xzr
|
||||
+ mov v0.d[1], x0
|
||||
+
|
||||
+ ins v0.b[0], v0.b[0]
|
||||
+ ins v31.b[0], v0.b[0]
|
||||
+ ins v0.b[0], v31.b[0]
|
||||
+ ins v0.b[15], v0.b[0]
|
||||
+ ins v0.b[0], v0.b[15]
|
||||
+ ins v0.h[0], v0.h[0]
|
||||
+ ins v31.h[0], v0.h[0]
|
||||
+ ins v0.h[0], v31.h[0]
|
||||
+ ins v0.h[7], v0.h[0]
|
||||
+ ins v0.h[0], v0.h[7]
|
||||
+ ins v0.s[0], v0.s[0]
|
||||
+ ins v31.s[0], v0.s[0]
|
||||
+ ins v0.s[0], v31.s[0]
|
||||
+ ins v0.s[3], v0.s[0]
|
||||
+ ins v0.s[0], v0.s[3]
|
||||
+ ins v0.d[0], v0.d[0]
|
||||
+ ins v31.d[0], v0.d[0]
|
||||
+ ins v0.d[0], v31.d[0]
|
||||
+ ins v0.d[1], v0.d[0]
|
||||
+ ins v0.d[0], v0.d[1]
|
||||
+// Unspecified bits in imm4 (14..11) are ignored but should be set to zero by
|
||||
+// an assembler. This tests disassembly when the ignored bits are nonzero.
|
||||
+ .inst 0x6e022c00
|
||||
+ .inst 0x6e083c00
|
||||
+
|
||||
+ mov v0.b[0], v0.b[0]
|
||||
+ mov v31.b[0], v0.b[0]
|
||||
+ mov v0.b[0], v31.b[0]
|
||||
+ mov v0.b[15], v0.b[0]
|
||||
+ mov v0.b[0], v0.b[15]
|
||||
+ mov v0.h[0], v0.h[0]
|
||||
+ mov v31.h[0], v0.h[0]
|
||||
+ mov v0.h[0], v31.h[0]
|
||||
+ mov v0.h[7], v0.h[0]
|
||||
+ mov v0.h[0], v0.h[7]
|
||||
+ mov v0.s[0], v0.s[0]
|
||||
+ mov v31.s[0], v0.s[0]
|
||||
+ mov v0.s[0], v31.s[0]
|
||||
+ mov v0.s[3], v0.s[0]
|
||||
+ mov v0.s[0], v0.s[3]
|
||||
+ mov v0.d[0], v0.d[0]
|
||||
+ mov v31.d[0], v0.d[0]
|
||||
+ mov v0.d[0], v31.d[0]
|
||||
+ mov v0.d[1], v0.d[0]
|
||||
+ mov v0.d[0], v0.d[1]
|
||||
--
|
||||
2.50.1
|
||||
|
384
SOURCES/binutils-AArch64-missing-assembler-tests-3.patch
Normal file
384
SOURCES/binutils-AArch64-missing-assembler-tests-3.patch
Normal file
@ -0,0 +1,384 @@
|
||||
From c9b4c146368433f0bbdf4d6b3517e3b5f79d2bb4 Mon Sep 17 00:00:00 2001
|
||||
From: Alice Carlotti <alice.carlotti@arm.com>
|
||||
Date: Sun, 20 Apr 2025 23:03:39 +0100
|
||||
Subject: [PATCH] aarch64: Add new test advsimd-scalar-shift-immediate.d
|
||||
|
||||
All instructions were previously untested.
|
||||
---
|
||||
.../aarch64/advsimd-scalar-shift-immediate.d | 173 +++++++++++++++++
|
||||
.../aarch64/advsimd-scalar-shift-immediate.s | 183 ++++++++++++++++++
|
||||
2 files changed, 356 insertions(+)
|
||||
create mode 100644 gas/testsuite/gas/aarch64/advsimd-scalar-shift-immediate.d
|
||||
create mode 100644 gas/testsuite/gas/aarch64/advsimd-scalar-shift-immediate.s
|
||||
|
||||
diff --git a/gas/testsuite/gas/aarch64/advsimd-scalar-shift-immediate.d b/gas/testsuite/gas/aarch64/advsimd-scalar-shift-immediate.d
|
||||
new file mode 100644
|
||||
index 00000000000..8a511fccc71
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/advsimd-scalar-shift-immediate.d
|
||||
@@ -0,0 +1,173 @@
|
||||
+#as: -march=armv8-a
|
||||
+#objdump: -dr
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+0+ <\.text>:
|
||||
+ *[0-9a-f]+: 5f400400 sshr d0, d0, #64
|
||||
+ *[0-9a-f]+: 5f40041f sshr d31, d0, #64
|
||||
+ *[0-9a-f]+: 5f4007e0 sshr d0, d31, #64
|
||||
+ *[0-9a-f]+: 5f7f0400 sshr d0, d0, #1
|
||||
+ *[0-9a-f]+: 5f401400 ssra d0, d0, #64
|
||||
+ *[0-9a-f]+: 5f40141f ssra d31, d0, #64
|
||||
+ *[0-9a-f]+: 5f4017e0 ssra d0, d31, #64
|
||||
+ *[0-9a-f]+: 5f7f1400 ssra d0, d0, #1
|
||||
+ *[0-9a-f]+: 5f402400 srshr d0, d0, #64
|
||||
+ *[0-9a-f]+: 5f40241f srshr d31, d0, #64
|
||||
+ *[0-9a-f]+: 5f4027e0 srshr d0, d31, #64
|
||||
+ *[0-9a-f]+: 5f7f2400 srshr d0, d0, #1
|
||||
+ *[0-9a-f]+: 5f403400 srsra d0, d0, #64
|
||||
+ *[0-9a-f]+: 5f40341f srsra d31, d0, #64
|
||||
+ *[0-9a-f]+: 5f4037e0 srsra d0, d31, #64
|
||||
+ *[0-9a-f]+: 5f7f3400 srsra d0, d0, #1
|
||||
+ *[0-9a-f]+: 5f405400 shl d0, d0, #0
|
||||
+ *[0-9a-f]+: 5f40541f shl d31, d0, #0
|
||||
+ *[0-9a-f]+: 5f4057e0 shl d0, d31, #0
|
||||
+ *[0-9a-f]+: 5f7f5400 shl d0, d0, #63
|
||||
+ *[0-9a-f]+: 5f087400 sqshl b0, b0, #0
|
||||
+ *[0-9a-f]+: 5f08741f sqshl b31, b0, #0
|
||||
+ *[0-9a-f]+: 5f0877e0 sqshl b0, b31, #0
|
||||
+ *[0-9a-f]+: 5f0f7400 sqshl b0, b0, #7
|
||||
+ *[0-9a-f]+: 5f107400 sqshl h0, h0, #0
|
||||
+ *[0-9a-f]+: 5f10741f sqshl h31, h0, #0
|
||||
+ *[0-9a-f]+: 5f1077e0 sqshl h0, h31, #0
|
||||
+ *[0-9a-f]+: 5f1f7400 sqshl h0, h0, #15
|
||||
+ *[0-9a-f]+: 5f207400 sqshl s0, s0, #0
|
||||
+ *[0-9a-f]+: 5f20741f sqshl s31, s0, #0
|
||||
+ *[0-9a-f]+: 5f2077e0 sqshl s0, s31, #0
|
||||
+ *[0-9a-f]+: 5f3f7400 sqshl s0, s0, #31
|
||||
+ *[0-9a-f]+: 5f407400 sqshl d0, d0, #0
|
||||
+ *[0-9a-f]+: 5f40741f sqshl d31, d0, #0
|
||||
+ *[0-9a-f]+: 5f4077e0 sqshl d0, d31, #0
|
||||
+ *[0-9a-f]+: 5f7f7400 sqshl d0, d0, #63
|
||||
+ *[0-9a-f]+: 5f089400 sqshrn b0, h0, #8
|
||||
+ *[0-9a-f]+: 5f08941f sqshrn b31, h0, #8
|
||||
+ *[0-9a-f]+: 5f0897e0 sqshrn b0, h31, #8
|
||||
+ *[0-9a-f]+: 5f0f9400 sqshrn b0, h0, #1
|
||||
+ *[0-9a-f]+: 5f109400 sqshrn h0, s0, #16
|
||||
+ *[0-9a-f]+: 5f10941f sqshrn h31, s0, #16
|
||||
+ *[0-9a-f]+: 5f1097e0 sqshrn h0, s31, #16
|
||||
+ *[0-9a-f]+: 5f1f9400 sqshrn h0, s0, #1
|
||||
+ *[0-9a-f]+: 5f209400 sqshrn s0, d0, #32
|
||||
+ *[0-9a-f]+: 5f20941f sqshrn s31, d0, #32
|
||||
+ *[0-9a-f]+: 5f2097e0 sqshrn s0, d31, #32
|
||||
+ *[0-9a-f]+: 5f3f9400 sqshrn s0, d0, #1
|
||||
+ *[0-9a-f]+: 5f089c00 sqrshrn b0, h0, #8
|
||||
+ *[0-9a-f]+: 5f089c1f sqrshrn b31, h0, #8
|
||||
+ *[0-9a-f]+: 5f089fe0 sqrshrn b0, h31, #8
|
||||
+ *[0-9a-f]+: 5f0f9c00 sqrshrn b0, h0, #1
|
||||
+ *[0-9a-f]+: 5f109c00 sqrshrn h0, s0, #16
|
||||
+ *[0-9a-f]+: 5f109c1f sqrshrn h31, s0, #16
|
||||
+ *[0-9a-f]+: 5f109fe0 sqrshrn h0, s31, #16
|
||||
+ *[0-9a-f]+: 5f1f9c00 sqrshrn h0, s0, #1
|
||||
+ *[0-9a-f]+: 5f209c00 sqrshrn s0, d0, #32
|
||||
+ *[0-9a-f]+: 5f209c1f sqrshrn s31, d0, #32
|
||||
+ *[0-9a-f]+: 5f209fe0 sqrshrn s0, d31, #32
|
||||
+ *[0-9a-f]+: 5f3f9c00 sqrshrn s0, d0, #1
|
||||
+ *[0-9a-f]+: 7f400400 ushr d0, d0, #64
|
||||
+ *[0-9a-f]+: 7f40041f ushr d31, d0, #64
|
||||
+ *[0-9a-f]+: 7f4007e0 ushr d0, d31, #64
|
||||
+ *[0-9a-f]+: 7f7f0400 ushr d0, d0, #1
|
||||
+ *[0-9a-f]+: 7f401400 usra d0, d0, #64
|
||||
+ *[0-9a-f]+: 7f40141f usra d31, d0, #64
|
||||
+ *[0-9a-f]+: 7f4017e0 usra d0, d31, #64
|
||||
+ *[0-9a-f]+: 7f7f1400 usra d0, d0, #1
|
||||
+ *[0-9a-f]+: 7f402400 urshr d0, d0, #64
|
||||
+ *[0-9a-f]+: 7f40241f urshr d31, d0, #64
|
||||
+ *[0-9a-f]+: 7f4027e0 urshr d0, d31, #64
|
||||
+ *[0-9a-f]+: 7f7f2400 urshr d0, d0, #1
|
||||
+ *[0-9a-f]+: 7f403400 ursra d0, d0, #64
|
||||
+ *[0-9a-f]+: 7f40341f ursra d31, d0, #64
|
||||
+ *[0-9a-f]+: 7f4037e0 ursra d0, d31, #64
|
||||
+ *[0-9a-f]+: 7f7f3400 ursra d0, d0, #1
|
||||
+ *[0-9a-f]+: 7f404400 sri d0, d0, #64
|
||||
+ *[0-9a-f]+: 7f40441f sri d31, d0, #64
|
||||
+ *[0-9a-f]+: 7f4047e0 sri d0, d31, #64
|
||||
+ *[0-9a-f]+: 7f7f4400 sri d0, d0, #1
|
||||
+ *[0-9a-f]+: 7f405400 sli d0, d0, #0
|
||||
+ *[0-9a-f]+: 7f40541f sli d31, d0, #0
|
||||
+ *[0-9a-f]+: 7f4057e0 sli d0, d31, #0
|
||||
+ *[0-9a-f]+: 7f7f5400 sli d0, d0, #63
|
||||
+ *[0-9a-f]+: 7f086400 sqshlu b0, b0, #0
|
||||
+ *[0-9a-f]+: 7f08641f sqshlu b31, b0, #0
|
||||
+ *[0-9a-f]+: 7f0867e0 sqshlu b0, b31, #0
|
||||
+ *[0-9a-f]+: 7f0f6400 sqshlu b0, b0, #7
|
||||
+ *[0-9a-f]+: 7f106400 sqshlu h0, h0, #0
|
||||
+ *[0-9a-f]+: 7f10641f sqshlu h31, h0, #0
|
||||
+ *[0-9a-f]+: 7f1067e0 sqshlu h0, h31, #0
|
||||
+ *[0-9a-f]+: 7f1f6400 sqshlu h0, h0, #15
|
||||
+ *[0-9a-f]+: 7f206400 sqshlu s0, s0, #0
|
||||
+ *[0-9a-f]+: 7f20641f sqshlu s31, s0, #0
|
||||
+ *[0-9a-f]+: 7f2067e0 sqshlu s0, s31, #0
|
||||
+ *[0-9a-f]+: 7f3f6400 sqshlu s0, s0, #31
|
||||
+ *[0-9a-f]+: 7f406400 sqshlu d0, d0, #0
|
||||
+ *[0-9a-f]+: 7f40641f sqshlu d31, d0, #0
|
||||
+ *[0-9a-f]+: 7f4067e0 sqshlu d0, d31, #0
|
||||
+ *[0-9a-f]+: 7f7f6400 sqshlu d0, d0, #63
|
||||
+ *[0-9a-f]+: 7f087400 uqshl b0, b0, #0
|
||||
+ *[0-9a-f]+: 7f08741f uqshl b31, b0, #0
|
||||
+ *[0-9a-f]+: 7f0877e0 uqshl b0, b31, #0
|
||||
+ *[0-9a-f]+: 7f0f7400 uqshl b0, b0, #7
|
||||
+ *[0-9a-f]+: 7f107400 uqshl h0, h0, #0
|
||||
+ *[0-9a-f]+: 7f10741f uqshl h31, h0, #0
|
||||
+ *[0-9a-f]+: 7f1077e0 uqshl h0, h31, #0
|
||||
+ *[0-9a-f]+: 7f1f7400 uqshl h0, h0, #15
|
||||
+ *[0-9a-f]+: 7f207400 uqshl s0, s0, #0
|
||||
+ *[0-9a-f]+: 7f20741f uqshl s31, s0, #0
|
||||
+ *[0-9a-f]+: 7f2077e0 uqshl s0, s31, #0
|
||||
+ *[0-9a-f]+: 7f3f7400 uqshl s0, s0, #31
|
||||
+ *[0-9a-f]+: 7f407400 uqshl d0, d0, #0
|
||||
+ *[0-9a-f]+: 7f40741f uqshl d31, d0, #0
|
||||
+ *[0-9a-f]+: 7f4077e0 uqshl d0, d31, #0
|
||||
+ *[0-9a-f]+: 7f7f7400 uqshl d0, d0, #63
|
||||
+ *[0-9a-f]+: 7f088400 sqshrun b0, h0, #8
|
||||
+ *[0-9a-f]+: 7f08841f sqshrun b31, h0, #8
|
||||
+ *[0-9a-f]+: 7f0887e0 sqshrun b0, h31, #8
|
||||
+ *[0-9a-f]+: 7f0f8400 sqshrun b0, h0, #1
|
||||
+ *[0-9a-f]+: 7f108400 sqshrun h0, s0, #16
|
||||
+ *[0-9a-f]+: 7f10841f sqshrun h31, s0, #16
|
||||
+ *[0-9a-f]+: 7f1087e0 sqshrun h0, s31, #16
|
||||
+ *[0-9a-f]+: 7f1f8400 sqshrun h0, s0, #1
|
||||
+ *[0-9a-f]+: 7f208400 sqshrun s0, d0, #32
|
||||
+ *[0-9a-f]+: 7f20841f sqshrun s31, d0, #32
|
||||
+ *[0-9a-f]+: 7f2087e0 sqshrun s0, d31, #32
|
||||
+ *[0-9a-f]+: 7f3f8400 sqshrun s0, d0, #1
|
||||
+ *[0-9a-f]+: 7f088c00 sqrshrun b0, h0, #8
|
||||
+ *[0-9a-f]+: 7f088c1f sqrshrun b31, h0, #8
|
||||
+ *[0-9a-f]+: 7f088fe0 sqrshrun b0, h31, #8
|
||||
+ *[0-9a-f]+: 7f0f8c00 sqrshrun b0, h0, #1
|
||||
+ *[0-9a-f]+: 7f108c00 sqrshrun h0, s0, #16
|
||||
+ *[0-9a-f]+: 7f108c1f sqrshrun h31, s0, #16
|
||||
+ *[0-9a-f]+: 7f108fe0 sqrshrun h0, s31, #16
|
||||
+ *[0-9a-f]+: 7f1f8c00 sqrshrun h0, s0, #1
|
||||
+ *[0-9a-f]+: 7f208c00 sqrshrun s0, d0, #32
|
||||
+ *[0-9a-f]+: 7f208c1f sqrshrun s31, d0, #32
|
||||
+ *[0-9a-f]+: 7f208fe0 sqrshrun s0, d31, #32
|
||||
+ *[0-9a-f]+: 7f3f8c00 sqrshrun s0, d0, #1
|
||||
+ *[0-9a-f]+: 7f089400 uqshrn b0, h0, #8
|
||||
+ *[0-9a-f]+: 7f08941f uqshrn b31, h0, #8
|
||||
+ *[0-9a-f]+: 7f0897e0 uqshrn b0, h31, #8
|
||||
+ *[0-9a-f]+: 7f0f9400 uqshrn b0, h0, #1
|
||||
+ *[0-9a-f]+: 7f109400 uqshrn h0, s0, #16
|
||||
+ *[0-9a-f]+: 7f10941f uqshrn h31, s0, #16
|
||||
+ *[0-9a-f]+: 7f1097e0 uqshrn h0, s31, #16
|
||||
+ *[0-9a-f]+: 7f1f9400 uqshrn h0, s0, #1
|
||||
+ *[0-9a-f]+: 7f209400 uqshrn s0, d0, #32
|
||||
+ *[0-9a-f]+: 7f20941f uqshrn s31, d0, #32
|
||||
+ *[0-9a-f]+: 7f2097e0 uqshrn s0, d31, #32
|
||||
+ *[0-9a-f]+: 7f3f9400 uqshrn s0, d0, #1
|
||||
+ *[0-9a-f]+: 7f089c00 uqrshrn b0, h0, #8
|
||||
+ *[0-9a-f]+: 7f089c1f uqrshrn b31, h0, #8
|
||||
+ *[0-9a-f]+: 7f089fe0 uqrshrn b0, h31, #8
|
||||
+ *[0-9a-f]+: 7f0f9c00 uqrshrn b0, h0, #1
|
||||
+ *[0-9a-f]+: 7f109c00 uqrshrn h0, s0, #16
|
||||
+ *[0-9a-f]+: 7f109c1f uqrshrn h31, s0, #16
|
||||
+ *[0-9a-f]+: 7f109fe0 uqrshrn h0, s31, #16
|
||||
+ *[0-9a-f]+: 7f1f9c00 uqrshrn h0, s0, #1
|
||||
+ *[0-9a-f]+: 7f209c00 uqrshrn s0, d0, #32
|
||||
+ *[0-9a-f]+: 7f209c1f uqrshrn s31, d0, #32
|
||||
+ *[0-9a-f]+: 7f209fe0 uqrshrn s0, d31, #32
|
||||
+ *[0-9a-f]+: 7f3f9c00 uqrshrn s0, d0, #1
|
||||
diff --git a/gas/testsuite/gas/aarch64/advsimd-scalar-shift-immediate.s b/gas/testsuite/gas/aarch64/advsimd-scalar-shift-immediate.s
|
||||
new file mode 100644
|
||||
index 00000000000..bddc9cb2a1a
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/advsimd-scalar-shift-immediate.s
|
||||
@@ -0,0 +1,183 @@
|
||||
+ sshr d0, d0, #64
|
||||
+ sshr d31, d0, #64
|
||||
+ sshr d0, d31, #64
|
||||
+ sshr d0, d0, #1
|
||||
+
|
||||
+ ssra d0, d0, #64
|
||||
+ ssra d31, d0, #64
|
||||
+ ssra d0, d31, #64
|
||||
+ ssra d0, d0, #1
|
||||
+
|
||||
+ srshr d0, d0, #64
|
||||
+ srshr d31, d0, #64
|
||||
+ srshr d0, d31, #64
|
||||
+ srshr d0, d0, #1
|
||||
+
|
||||
+ srsra d0, d0, #64
|
||||
+ srsra d31, d0, #64
|
||||
+ srsra d0, d31, #64
|
||||
+ srsra d0, d0, #1
|
||||
+
|
||||
+ shl d0, d0, #0
|
||||
+ shl d31, d0, #0
|
||||
+ shl d0, d31, #0
|
||||
+ shl d0, d0, #63
|
||||
+
|
||||
+ sqshl b0, b0, #0
|
||||
+ sqshl b31, b0, #0
|
||||
+ sqshl b0, b31, #0
|
||||
+ sqshl b0, b0, #7
|
||||
+ sqshl h0, h0, #0
|
||||
+ sqshl h31, h0, #0
|
||||
+ sqshl h0, h31, #0
|
||||
+ sqshl h0, h0, #15
|
||||
+ sqshl s0, s0, #0
|
||||
+ sqshl s31, s0, #0
|
||||
+ sqshl s0, s31, #0
|
||||
+ sqshl s0, s0, #31
|
||||
+ sqshl d0, d0, #0
|
||||
+ sqshl d31, d0, #0
|
||||
+ sqshl d0, d31, #0
|
||||
+ sqshl d0, d0, #63
|
||||
+
|
||||
+ sqshrn b0, h0, #8
|
||||
+ sqshrn b31, h0, #8
|
||||
+ sqshrn b0, h31, #8
|
||||
+ sqshrn b0, h0, #1
|
||||
+ sqshrn h0, s0, #16
|
||||
+ sqshrn h31, s0, #16
|
||||
+ sqshrn h0, s31, #16
|
||||
+ sqshrn h0, s0, #1
|
||||
+ sqshrn s0, d0, #32
|
||||
+ sqshrn s31, d0, #32
|
||||
+ sqshrn s0, d31, #32
|
||||
+ sqshrn s0, d0, #1
|
||||
+
|
||||
+ sqrshrn b0, h0, #8
|
||||
+ sqrshrn b31, h0, #8
|
||||
+ sqrshrn b0, h31, #8
|
||||
+ sqrshrn b0, h0, #1
|
||||
+ sqrshrn h0, s0, #16
|
||||
+ sqrshrn h31, s0, #16
|
||||
+ sqrshrn h0, s31, #16
|
||||
+ sqrshrn h0, s0, #1
|
||||
+ sqrshrn s0, d0, #32
|
||||
+ sqrshrn s31, d0, #32
|
||||
+ sqrshrn s0, d31, #32
|
||||
+ sqrshrn s0, d0, #1
|
||||
+
|
||||
+ ushr d0, d0, #64
|
||||
+ ushr d31, d0, #64
|
||||
+ ushr d0, d31, #64
|
||||
+ ushr d0, d0, #1
|
||||
+
|
||||
+ usra d0, d0, #64
|
||||
+ usra d31, d0, #64
|
||||
+ usra d0, d31, #64
|
||||
+ usra d0, d0, #1
|
||||
+
|
||||
+ urshr d0, d0, #64
|
||||
+ urshr d31, d0, #64
|
||||
+ urshr d0, d31, #64
|
||||
+ urshr d0, d0, #1
|
||||
+
|
||||
+ ursra d0, d0, #64
|
||||
+ ursra d31, d0, #64
|
||||
+ ursra d0, d31, #64
|
||||
+ ursra d0, d0, #1
|
||||
+
|
||||
+ sri d0, d0, #64
|
||||
+ sri d31, d0, #64
|
||||
+ sri d0, d31, #64
|
||||
+ sri d0, d0, #1
|
||||
+
|
||||
+ sli d0, d0, #0
|
||||
+ sli d31, d0, #0
|
||||
+ sli d0, d31, #0
|
||||
+ sli d0, d0, #63
|
||||
+
|
||||
+ sqshlu b0, b0, #0
|
||||
+ sqshlu b31, b0, #0
|
||||
+ sqshlu b0, b31, #0
|
||||
+ sqshlu b0, b0, #7
|
||||
+ sqshlu h0, h0, #0
|
||||
+ sqshlu h31, h0, #0
|
||||
+ sqshlu h0, h31, #0
|
||||
+ sqshlu h0, h0, #15
|
||||
+ sqshlu s0, s0, #0
|
||||
+ sqshlu s31, s0, #0
|
||||
+ sqshlu s0, s31, #0
|
||||
+ sqshlu s0, s0, #31
|
||||
+ sqshlu d0, d0, #0
|
||||
+ sqshlu d31, d0, #0
|
||||
+ sqshlu d0, d31, #0
|
||||
+ sqshlu d0, d0, #63
|
||||
+
|
||||
+ uqshl b0, b0, #0
|
||||
+ uqshl b31, b0, #0
|
||||
+ uqshl b0, b31, #0
|
||||
+ uqshl b0, b0, #7
|
||||
+ uqshl h0, h0, #0
|
||||
+ uqshl h31, h0, #0
|
||||
+ uqshl h0, h31, #0
|
||||
+ uqshl h0, h0, #15
|
||||
+ uqshl s0, s0, #0
|
||||
+ uqshl s31, s0, #0
|
||||
+ uqshl s0, s31, #0
|
||||
+ uqshl s0, s0, #31
|
||||
+ uqshl d0, d0, #0
|
||||
+ uqshl d31, d0, #0
|
||||
+ uqshl d0, d31, #0
|
||||
+ uqshl d0, d0, #63
|
||||
+
|
||||
+ sqshrun b0, h0, #8
|
||||
+ sqshrun b31, h0, #8
|
||||
+ sqshrun b0, h31, #8
|
||||
+ sqshrun b0, h0, #1
|
||||
+ sqshrun h0, s0, #16
|
||||
+ sqshrun h31, s0, #16
|
||||
+ sqshrun h0, s31, #16
|
||||
+ sqshrun h0, s0, #1
|
||||
+ sqshrun s0, d0, #32
|
||||
+ sqshrun s31, d0, #32
|
||||
+ sqshrun s0, d31, #32
|
||||
+ sqshrun s0, d0, #1
|
||||
+
|
||||
+ sqrshrun b0, h0, #8
|
||||
+ sqrshrun b31, h0, #8
|
||||
+ sqrshrun b0, h31, #8
|
||||
+ sqrshrun b0, h0, #1
|
||||
+ sqrshrun h0, s0, #16
|
||||
+ sqrshrun h31, s0, #16
|
||||
+ sqrshrun h0, s31, #16
|
||||
+ sqrshrun h0, s0, #1
|
||||
+ sqrshrun s0, d0, #32
|
||||
+ sqrshrun s31, d0, #32
|
||||
+ sqrshrun s0, d31, #32
|
||||
+ sqrshrun s0, d0, #1
|
||||
+
|
||||
+ uqshrn b0, h0, #8
|
||||
+ uqshrn b31, h0, #8
|
||||
+ uqshrn b0, h31, #8
|
||||
+ uqshrn b0, h0, #1
|
||||
+ uqshrn h0, s0, #16
|
||||
+ uqshrn h31, s0, #16
|
||||
+ uqshrn h0, s31, #16
|
||||
+ uqshrn h0, s0, #1
|
||||
+ uqshrn s0, d0, #32
|
||||
+ uqshrn s31, d0, #32
|
||||
+ uqshrn s0, d31, #32
|
||||
+ uqshrn s0, d0, #1
|
||||
+
|
||||
+ uqrshrn b0, h0, #8
|
||||
+ uqrshrn b31, h0, #8
|
||||
+ uqrshrn b0, h31, #8
|
||||
+ uqrshrn b0, h0, #1
|
||||
+ uqrshrn h0, s0, #16
|
||||
+ uqrshrn h31, s0, #16
|
||||
+ uqrshrn h0, s31, #16
|
||||
+ uqrshrn h0, s0, #1
|
||||
+ uqrshrn s0, d0, #32
|
||||
+ uqrshrn s31, d0, #32
|
||||
+ uqrshrn s0, d31, #32
|
||||
+ uqrshrn s0, d0, #1
|
||||
--
|
||||
2.50.1
|
||||
|
2481
SOURCES/binutils-AArch64-missing-assembler-tests-4.patch
Normal file
2481
SOURCES/binutils-AArch64-missing-assembler-tests-4.patch
Normal file
File diff suppressed because it is too large
Load Diff
1498
SOURCES/binutils-AArch64-missing-assembler-tests-5.patch
Normal file
1498
SOURCES/binutils-AArch64-missing-assembler-tests-5.patch
Normal file
File diff suppressed because it is too large
Load Diff
860
SOURCES/binutils-AArch64-missing-assembler-tests-6.patch
Normal file
860
SOURCES/binutils-AArch64-missing-assembler-tests-6.patch
Normal file
@ -0,0 +1,860 @@
|
||||
From 1bd53f5409d1deb0427b7bd6549a1dde874ff96e Mon Sep 17 00:00:00 2001
|
||||
From: Alice Carlotti <alice.carlotti@arm.com>
|
||||
Date: Sun, 20 Apr 2025 22:57:53 +0100
|
||||
Subject: [PATCH] aarch64: Add new test advsimd-two-reg-misc.d
|
||||
|
||||
sqabs, abs, not, mvn, sqneg and neg were already tested, and cmeq was
|
||||
already assembled in an error test (sve-reg-diagnostic.d), but they are
|
||||
all included here as part of the same encoding group.
|
||||
---
|
||||
.../gas/aarch64/advsimd-two-reg-misc.d | 408 +++++++++++++++++
|
||||
.../gas/aarch64/advsimd-two-reg-misc.s | 422 ++++++++++++++++++
|
||||
2 files changed, 830 insertions(+)
|
||||
create mode 100644 gas/testsuite/gas/aarch64/advsimd-two-reg-misc.d
|
||||
create mode 100644 gas/testsuite/gas/aarch64/advsimd-two-reg-misc.s
|
||||
|
||||
diff --git a/gas/testsuite/gas/aarch64/advsimd-two-reg-misc.d b/gas/testsuite/gas/aarch64/advsimd-two-reg-misc.d
|
||||
new file mode 100644
|
||||
index 00000000000..cf9d93c34b1
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/advsimd-two-reg-misc.d
|
||||
@@ -0,0 +1,408 @@
|
||||
+#as: -march=armv8-a
|
||||
+#objdump: -dr
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+0+ <\.text>:
|
||||
+ *[0-9a-f]+: 0e200800 rev64 v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e20081f rev64 v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e200be0 rev64 v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 0e600800 rev64 v0\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 0e60081f rev64 v31\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 0e600be0 rev64 v0\.4h, v31\.4h
|
||||
+ *[0-9a-f]+: 0ea00800 rev64 v0\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea0081f rev64 v31\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea00be0 rev64 v0\.2s, v31\.2s
|
||||
+ *[0-9a-f]+: 4e200800 rev64 v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e20081f rev64 v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e200be0 rev64 v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 4e600800 rev64 v0\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 4e60081f rev64 v31\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 4e600be0 rev64 v0\.8h, v31\.8h
|
||||
+ *[0-9a-f]+: 4ea00800 rev64 v0\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea0081f rev64 v31\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea00be0 rev64 v0\.4s, v31\.4s
|
||||
+ *[0-9a-f]+: 0e201800 rev16 v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e20181f rev16 v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e201be0 rev16 v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 4e201800 rev16 v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e20181f rev16 v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e201be0 rev16 v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 0e202800 saddlp v0\.4h, v0\.8b
|
||||
+ *[0-9a-f]+: 0e20281f saddlp v31\.4h, v0\.8b
|
||||
+ *[0-9a-f]+: 0e202be0 saddlp v0\.4h, v31\.8b
|
||||
+ *[0-9a-f]+: 0e602800 saddlp v0\.2s, v0\.4h
|
||||
+ *[0-9a-f]+: 0e60281f saddlp v31\.2s, v0\.4h
|
||||
+ *[0-9a-f]+: 0e602be0 saddlp v0\.2s, v31\.4h
|
||||
+ *[0-9a-f]+: 0ea02800 saddlp v0\.1d, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea0281f saddlp v31\.1d, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea02be0 saddlp v0\.1d, v31\.2s
|
||||
+ *[0-9a-f]+: 4e202800 saddlp v0\.8h, v0\.16b
|
||||
+ *[0-9a-f]+: 4e20281f saddlp v31\.8h, v0\.16b
|
||||
+ *[0-9a-f]+: 4e202be0 saddlp v0\.8h, v31\.16b
|
||||
+ *[0-9a-f]+: 4e602800 saddlp v0\.4s, v0\.8h
|
||||
+ *[0-9a-f]+: 4e60281f saddlp v31\.4s, v0\.8h
|
||||
+ *[0-9a-f]+: 4e602be0 saddlp v0\.4s, v31\.8h
|
||||
+ *[0-9a-f]+: 4ea02800 saddlp v0\.2d, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea0281f saddlp v31\.2d, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea02be0 saddlp v0\.2d, v31\.4s
|
||||
+ *[0-9a-f]+: 0e203800 suqadd v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e20381f suqadd v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e203be0 suqadd v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 0e603800 suqadd v0\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 0e60381f suqadd v31\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 0e603be0 suqadd v0\.4h, v31\.4h
|
||||
+ *[0-9a-f]+: 0ea03800 suqadd v0\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea0381f suqadd v31\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea03be0 suqadd v0\.2s, v31\.2s
|
||||
+ *[0-9a-f]+: 4e203800 suqadd v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e20381f suqadd v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e203be0 suqadd v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 4e603800 suqadd v0\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 4e60381f suqadd v31\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 4e603be0 suqadd v0\.8h, v31\.8h
|
||||
+ *[0-9a-f]+: 4ea03800 suqadd v0\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea0381f suqadd v31\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea03be0 suqadd v0\.4s, v31\.4s
|
||||
+ *[0-9a-f]+: 4ee03800 suqadd v0\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 4ee0381f suqadd v31\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 4ee03be0 suqadd v0\.2d, v31\.2d
|
||||
+ *[0-9a-f]+: 0e204800 cls v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e20481f cls v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e204be0 cls v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 0e604800 cls v0\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 0e60481f cls v31\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 0e604be0 cls v0\.4h, v31\.4h
|
||||
+ *[0-9a-f]+: 0ea04800 cls v0\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea0481f cls v31\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea04be0 cls v0\.2s, v31\.2s
|
||||
+ *[0-9a-f]+: 4e204800 cls v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e20481f cls v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e204be0 cls v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 4e604800 cls v0\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 4e60481f cls v31\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 4e604be0 cls v0\.8h, v31\.8h
|
||||
+ *[0-9a-f]+: 4ea04800 cls v0\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea0481f cls v31\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea04be0 cls v0\.4s, v31\.4s
|
||||
+ *[0-9a-f]+: 0e205800 cnt v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e20581f cnt v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e205be0 cnt v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 4e205800 cnt v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e20581f cnt v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e205be0 cnt v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 0e206800 sadalp v0\.4h, v0\.8b
|
||||
+ *[0-9a-f]+: 0e20681f sadalp v31\.4h, v0\.8b
|
||||
+ *[0-9a-f]+: 0e206be0 sadalp v0\.4h, v31\.8b
|
||||
+ *[0-9a-f]+: 0e606800 sadalp v0\.2s, v0\.4h
|
||||
+ *[0-9a-f]+: 0e60681f sadalp v31\.2s, v0\.4h
|
||||
+ *[0-9a-f]+: 0e606be0 sadalp v0\.2s, v31\.4h
|
||||
+ *[0-9a-f]+: 0ea06800 sadalp v0\.1d, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea0681f sadalp v31\.1d, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea06be0 sadalp v0\.1d, v31\.2s
|
||||
+ *[0-9a-f]+: 4e206800 sadalp v0\.8h, v0\.16b
|
||||
+ *[0-9a-f]+: 4e20681f sadalp v31\.8h, v0\.16b
|
||||
+ *[0-9a-f]+: 4e206be0 sadalp v0\.8h, v31\.16b
|
||||
+ *[0-9a-f]+: 4e606800 sadalp v0\.4s, v0\.8h
|
||||
+ *[0-9a-f]+: 4e60681f sadalp v31\.4s, v0\.8h
|
||||
+ *[0-9a-f]+: 4e606be0 sadalp v0\.4s, v31\.8h
|
||||
+ *[0-9a-f]+: 4ea06800 sadalp v0\.2d, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea0681f sadalp v31\.2d, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea06be0 sadalp v0\.2d, v31\.4s
|
||||
+ *[0-9a-f]+: 0e207800 sqabs v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e20781f sqabs v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e207be0 sqabs v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 0e607800 sqabs v0\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 0e60781f sqabs v31\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 0e607be0 sqabs v0\.4h, v31\.4h
|
||||
+ *[0-9a-f]+: 0ea07800 sqabs v0\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea0781f sqabs v31\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea07be0 sqabs v0\.2s, v31\.2s
|
||||
+ *[0-9a-f]+: 4e207800 sqabs v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e20781f sqabs v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e207be0 sqabs v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 4e607800 sqabs v0\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 4e60781f sqabs v31\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 4e607be0 sqabs v0\.8h, v31\.8h
|
||||
+ *[0-9a-f]+: 4ea07800 sqabs v0\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea0781f sqabs v31\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea07be0 sqabs v0\.4s, v31\.4s
|
||||
+ *[0-9a-f]+: 4ee07800 sqabs v0\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 4ee0781f sqabs v31\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 4ee07be0 sqabs v0\.2d, v31\.2d
|
||||
+ *[0-9a-f]+: 0e208800 cmgt v0\.8b, v0\.8b, #0
|
||||
+ *[0-9a-f]+: 0e20881f cmgt v31\.8b, v0\.8b, #0
|
||||
+ *[0-9a-f]+: 0e208be0 cmgt v0\.8b, v31\.8b, #0
|
||||
+ *[0-9a-f]+: 0e608800 cmgt v0\.4h, v0\.4h, #0
|
||||
+ *[0-9a-f]+: 0e60881f cmgt v31\.4h, v0\.4h, #0
|
||||
+ *[0-9a-f]+: 0e608be0 cmgt v0\.4h, v31\.4h, #0
|
||||
+ *[0-9a-f]+: 0ea08800 cmgt v0\.2s, v0\.2s, #0
|
||||
+ *[0-9a-f]+: 0ea0881f cmgt v31\.2s, v0\.2s, #0
|
||||
+ *[0-9a-f]+: 0ea08be0 cmgt v0\.2s, v31\.2s, #0
|
||||
+ *[0-9a-f]+: 4e208800 cmgt v0\.16b, v0\.16b, #0
|
||||
+ *[0-9a-f]+: 4e20881f cmgt v31\.16b, v0\.16b, #0
|
||||
+ *[0-9a-f]+: 4e208be0 cmgt v0\.16b, v31\.16b, #0
|
||||
+ *[0-9a-f]+: 4e608800 cmgt v0\.8h, v0\.8h, #0
|
||||
+ *[0-9a-f]+: 4e60881f cmgt v31\.8h, v0\.8h, #0
|
||||
+ *[0-9a-f]+: 4e608be0 cmgt v0\.8h, v31\.8h, #0
|
||||
+ *[0-9a-f]+: 4ea08800 cmgt v0\.4s, v0\.4s, #0
|
||||
+ *[0-9a-f]+: 4ea0881f cmgt v31\.4s, v0\.4s, #0
|
||||
+ *[0-9a-f]+: 4ea08be0 cmgt v0\.4s, v31\.4s, #0
|
||||
+ *[0-9a-f]+: 4ee08800 cmgt v0\.2d, v0\.2d, #0
|
||||
+ *[0-9a-f]+: 4ee0881f cmgt v31\.2d, v0\.2d, #0
|
||||
+ *[0-9a-f]+: 4ee08be0 cmgt v0\.2d, v31\.2d, #0
|
||||
+ *[0-9a-f]+: 0e209800 cmeq v0\.8b, v0\.8b, #0
|
||||
+ *[0-9a-f]+: 0e20981f cmeq v31\.8b, v0\.8b, #0
|
||||
+ *[0-9a-f]+: 0e209be0 cmeq v0\.8b, v31\.8b, #0
|
||||
+ *[0-9a-f]+: 0e609800 cmeq v0\.4h, v0\.4h, #0
|
||||
+ *[0-9a-f]+: 0e60981f cmeq v31\.4h, v0\.4h, #0
|
||||
+ *[0-9a-f]+: 0e609be0 cmeq v0\.4h, v31\.4h, #0
|
||||
+ *[0-9a-f]+: 0ea09800 cmeq v0\.2s, v0\.2s, #0
|
||||
+ *[0-9a-f]+: 0ea0981f cmeq v31\.2s, v0\.2s, #0
|
||||
+ *[0-9a-f]+: 0ea09be0 cmeq v0\.2s, v31\.2s, #0
|
||||
+ *[0-9a-f]+: 4e209800 cmeq v0\.16b, v0\.16b, #0
|
||||
+ *[0-9a-f]+: 4e20981f cmeq v31\.16b, v0\.16b, #0
|
||||
+ *[0-9a-f]+: 4e209be0 cmeq v0\.16b, v31\.16b, #0
|
||||
+ *[0-9a-f]+: 4e609800 cmeq v0\.8h, v0\.8h, #0
|
||||
+ *[0-9a-f]+: 4e60981f cmeq v31\.8h, v0\.8h, #0
|
||||
+ *[0-9a-f]+: 4e609be0 cmeq v0\.8h, v31\.8h, #0
|
||||
+ *[0-9a-f]+: 4ea09800 cmeq v0\.4s, v0\.4s, #0
|
||||
+ *[0-9a-f]+: 4ea0981f cmeq v31\.4s, v0\.4s, #0
|
||||
+ *[0-9a-f]+: 4ea09be0 cmeq v0\.4s, v31\.4s, #0
|
||||
+ *[0-9a-f]+: 4ee09800 cmeq v0\.2d, v0\.2d, #0
|
||||
+ *[0-9a-f]+: 4ee0981f cmeq v31\.2d, v0\.2d, #0
|
||||
+ *[0-9a-f]+: 4ee09be0 cmeq v0\.2d, v31\.2d, #0
|
||||
+ *[0-9a-f]+: 0e20a800 cmlt v0\.8b, v0\.8b, #0
|
||||
+ *[0-9a-f]+: 0e20a81f cmlt v31\.8b, v0\.8b, #0
|
||||
+ *[0-9a-f]+: 0e20abe0 cmlt v0\.8b, v31\.8b, #0
|
||||
+ *[0-9a-f]+: 0e60a800 cmlt v0\.4h, v0\.4h, #0
|
||||
+ *[0-9a-f]+: 0e60a81f cmlt v31\.4h, v0\.4h, #0
|
||||
+ *[0-9a-f]+: 0e60abe0 cmlt v0\.4h, v31\.4h, #0
|
||||
+ *[0-9a-f]+: 0ea0a800 cmlt v0\.2s, v0\.2s, #0
|
||||
+ *[0-9a-f]+: 0ea0a81f cmlt v31\.2s, v0\.2s, #0
|
||||
+ *[0-9a-f]+: 0ea0abe0 cmlt v0\.2s, v31\.2s, #0
|
||||
+ *[0-9a-f]+: 4e20a800 cmlt v0\.16b, v0\.16b, #0
|
||||
+ *[0-9a-f]+: 4e20a81f cmlt v31\.16b, v0\.16b, #0
|
||||
+ *[0-9a-f]+: 4e20abe0 cmlt v0\.16b, v31\.16b, #0
|
||||
+ *[0-9a-f]+: 4e60a800 cmlt v0\.8h, v0\.8h, #0
|
||||
+ *[0-9a-f]+: 4e60a81f cmlt v31\.8h, v0\.8h, #0
|
||||
+ *[0-9a-f]+: 4e60abe0 cmlt v0\.8h, v31\.8h, #0
|
||||
+ *[0-9a-f]+: 4ea0a800 cmlt v0\.4s, v0\.4s, #0
|
||||
+ *[0-9a-f]+: 4ea0a81f cmlt v31\.4s, v0\.4s, #0
|
||||
+ *[0-9a-f]+: 4ea0abe0 cmlt v0\.4s, v31\.4s, #0
|
||||
+ *[0-9a-f]+: 4ee0a800 cmlt v0\.2d, v0\.2d, #0
|
||||
+ *[0-9a-f]+: 4ee0a81f cmlt v31\.2d, v0\.2d, #0
|
||||
+ *[0-9a-f]+: 4ee0abe0 cmlt v0\.2d, v31\.2d, #0
|
||||
+ *[0-9a-f]+: 0e20b800 abs v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e20b81f abs v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 0e20bbe0 abs v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 0e60b800 abs v0\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 0e60b81f abs v31\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 0e60bbe0 abs v0\.4h, v31\.4h
|
||||
+ *[0-9a-f]+: 0ea0b800 abs v0\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea0b81f abs v31\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 0ea0bbe0 abs v0\.2s, v31\.2s
|
||||
+ *[0-9a-f]+: 4e20b800 abs v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e20b81f abs v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 4e20bbe0 abs v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 4e60b800 abs v0\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 4e60b81f abs v31\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 4e60bbe0 abs v0\.8h, v31\.8h
|
||||
+ *[0-9a-f]+: 4ea0b800 abs v0\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea0b81f abs v31\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 4ea0bbe0 abs v0\.4s, v31\.4s
|
||||
+ *[0-9a-f]+: 4ee0b800 abs v0\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 4ee0b81f abs v31\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 4ee0bbe0 abs v0\.2d, v31\.2d
|
||||
+ *[0-9a-f]+: 2e200800 rev32 v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e20081f rev32 v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e200be0 rev32 v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 2e600800 rev32 v0\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 2e60081f rev32 v31\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 2e600be0 rev32 v0\.4h, v31\.4h
|
||||
+ *[0-9a-f]+: 6e200800 rev32 v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e20081f rev32 v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e200be0 rev32 v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 6e600800 rev32 v0\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 6e60081f rev32 v31\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 6e600be0 rev32 v0\.8h, v31\.8h
|
||||
+ *[0-9a-f]+: 2e202800 uaddlp v0\.4h, v0\.8b
|
||||
+ *[0-9a-f]+: 2e20281f uaddlp v31\.4h, v0\.8b
|
||||
+ *[0-9a-f]+: 2e202be0 uaddlp v0\.4h, v31\.8b
|
||||
+ *[0-9a-f]+: 2e602800 uaddlp v0\.2s, v0\.4h
|
||||
+ *[0-9a-f]+: 2e60281f uaddlp v31\.2s, v0\.4h
|
||||
+ *[0-9a-f]+: 2e602be0 uaddlp v0\.2s, v31\.4h
|
||||
+ *[0-9a-f]+: 2ea02800 uaddlp v0\.1d, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea0281f uaddlp v31\.1d, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea02be0 uaddlp v0\.1d, v31\.2s
|
||||
+ *[0-9a-f]+: 6e202800 uaddlp v0\.8h, v0\.16b
|
||||
+ *[0-9a-f]+: 6e20281f uaddlp v31\.8h, v0\.16b
|
||||
+ *[0-9a-f]+: 6e202be0 uaddlp v0\.8h, v31\.16b
|
||||
+ *[0-9a-f]+: 6e602800 uaddlp v0\.4s, v0\.8h
|
||||
+ *[0-9a-f]+: 6e60281f uaddlp v31\.4s, v0\.8h
|
||||
+ *[0-9a-f]+: 6e602be0 uaddlp v0\.4s, v31\.8h
|
||||
+ *[0-9a-f]+: 6ea02800 uaddlp v0\.2d, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea0281f uaddlp v31\.2d, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea02be0 uaddlp v0\.2d, v31\.4s
|
||||
+ *[0-9a-f]+: 2e203800 usqadd v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e20381f usqadd v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e203be0 usqadd v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 2e603800 usqadd v0\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 2e60381f usqadd v31\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 2e603be0 usqadd v0\.4h, v31\.4h
|
||||
+ *[0-9a-f]+: 2ea03800 usqadd v0\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea0381f usqadd v31\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea03be0 usqadd v0\.2s, v31\.2s
|
||||
+ *[0-9a-f]+: 6e203800 usqadd v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e20381f usqadd v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e203be0 usqadd v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 6e603800 usqadd v0\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 6e60381f usqadd v31\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 6e603be0 usqadd v0\.8h, v31\.8h
|
||||
+ *[0-9a-f]+: 6ea03800 usqadd v0\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea0381f usqadd v31\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea03be0 usqadd v0\.4s, v31\.4s
|
||||
+ *[0-9a-f]+: 6ee03800 usqadd v0\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 6ee0381f usqadd v31\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 6ee03be0 usqadd v0\.2d, v31\.2d
|
||||
+ *[0-9a-f]+: 2e204800 clz v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e20481f clz v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e204be0 clz v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 2e604800 clz v0\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 2e60481f clz v31\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 2e604be0 clz v0\.4h, v31\.4h
|
||||
+ *[0-9a-f]+: 2ea04800 clz v0\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea0481f clz v31\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea04be0 clz v0\.2s, v31\.2s
|
||||
+ *[0-9a-f]+: 6e204800 clz v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e20481f clz v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e204be0 clz v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 6e604800 clz v0\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 6e60481f clz v31\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 6e604be0 clz v0\.8h, v31\.8h
|
||||
+ *[0-9a-f]+: 6ea04800 clz v0\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea0481f clz v31\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea04be0 clz v0\.4s, v31\.4s
|
||||
+ *[0-9a-f]+: 2e205800 mvn v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e20581f mvn v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e205be0 mvn v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 6e205800 mvn v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e20581f mvn v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e205be0 mvn v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 2e205800 mvn v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e20581f mvn v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e205be0 mvn v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 6e205800 mvn v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e20581f mvn v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e205be0 mvn v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 2e605800 rbit v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e60581f rbit v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e605be0 rbit v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 6e605800 rbit v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e60581f rbit v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e605be0 rbit v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 2e206800 uadalp v0\.4h, v0\.8b
|
||||
+ *[0-9a-f]+: 2e20681f uadalp v31\.4h, v0\.8b
|
||||
+ *[0-9a-f]+: 2e206be0 uadalp v0\.4h, v31\.8b
|
||||
+ *[0-9a-f]+: 2e606800 uadalp v0\.2s, v0\.4h
|
||||
+ *[0-9a-f]+: 2e60681f uadalp v31\.2s, v0\.4h
|
||||
+ *[0-9a-f]+: 2e606be0 uadalp v0\.2s, v31\.4h
|
||||
+ *[0-9a-f]+: 2ea06800 uadalp v0\.1d, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea0681f uadalp v31\.1d, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea06be0 uadalp v0\.1d, v31\.2s
|
||||
+ *[0-9a-f]+: 6e206800 uadalp v0\.8h, v0\.16b
|
||||
+ *[0-9a-f]+: 6e20681f uadalp v31\.8h, v0\.16b
|
||||
+ *[0-9a-f]+: 6e206be0 uadalp v0\.8h, v31\.16b
|
||||
+ *[0-9a-f]+: 6e606800 uadalp v0\.4s, v0\.8h
|
||||
+ *[0-9a-f]+: 6e60681f uadalp v31\.4s, v0\.8h
|
||||
+ *[0-9a-f]+: 6e606be0 uadalp v0\.4s, v31\.8h
|
||||
+ *[0-9a-f]+: 6ea06800 uadalp v0\.2d, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea0681f uadalp v31\.2d, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea06be0 uadalp v0\.2d, v31\.4s
|
||||
+ *[0-9a-f]+: 2e207800 sqneg v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e20781f sqneg v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e207be0 sqneg v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 2e607800 sqneg v0\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 2e60781f sqneg v31\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 2e607be0 sqneg v0\.4h, v31\.4h
|
||||
+ *[0-9a-f]+: 2ea07800 sqneg v0\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea0781f sqneg v31\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea07be0 sqneg v0\.2s, v31\.2s
|
||||
+ *[0-9a-f]+: 6e207800 sqneg v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e20781f sqneg v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e207be0 sqneg v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 6e607800 sqneg v0\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 6e60781f sqneg v31\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 6e607be0 sqneg v0\.8h, v31\.8h
|
||||
+ *[0-9a-f]+: 6ea07800 sqneg v0\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea0781f sqneg v31\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea07be0 sqneg v0\.4s, v31\.4s
|
||||
+ *[0-9a-f]+: 6ee07800 sqneg v0\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 6ee0781f sqneg v31\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 6ee07be0 sqneg v0\.2d, v31\.2d
|
||||
+ *[0-9a-f]+: 2e208800 cmge v0\.8b, v0\.8b, #0
|
||||
+ *[0-9a-f]+: 2e20881f cmge v31\.8b, v0\.8b, #0
|
||||
+ *[0-9a-f]+: 2e208be0 cmge v0\.8b, v31\.8b, #0
|
||||
+ *[0-9a-f]+: 2e608800 cmge v0\.4h, v0\.4h, #0
|
||||
+ *[0-9a-f]+: 2e60881f cmge v31\.4h, v0\.4h, #0
|
||||
+ *[0-9a-f]+: 2e608be0 cmge v0\.4h, v31\.4h, #0
|
||||
+ *[0-9a-f]+: 2ea08800 cmge v0\.2s, v0\.2s, #0
|
||||
+ *[0-9a-f]+: 2ea0881f cmge v31\.2s, v0\.2s, #0
|
||||
+ *[0-9a-f]+: 2ea08be0 cmge v0\.2s, v31\.2s, #0
|
||||
+ *[0-9a-f]+: 6e208800 cmge v0\.16b, v0\.16b, #0
|
||||
+ *[0-9a-f]+: 6e20881f cmge v31\.16b, v0\.16b, #0
|
||||
+ *[0-9a-f]+: 6e208be0 cmge v0\.16b, v31\.16b, #0
|
||||
+ *[0-9a-f]+: 6e608800 cmge v0\.8h, v0\.8h, #0
|
||||
+ *[0-9a-f]+: 6e60881f cmge v31\.8h, v0\.8h, #0
|
||||
+ *[0-9a-f]+: 6e608be0 cmge v0\.8h, v31\.8h, #0
|
||||
+ *[0-9a-f]+: 6ea08800 cmge v0\.4s, v0\.4s, #0
|
||||
+ *[0-9a-f]+: 6ea0881f cmge v31\.4s, v0\.4s, #0
|
||||
+ *[0-9a-f]+: 6ea08be0 cmge v0\.4s, v31\.4s, #0
|
||||
+ *[0-9a-f]+: 6ee08800 cmge v0\.2d, v0\.2d, #0
|
||||
+ *[0-9a-f]+: 6ee0881f cmge v31\.2d, v0\.2d, #0
|
||||
+ *[0-9a-f]+: 6ee08be0 cmge v0\.2d, v31\.2d, #0
|
||||
+ *[0-9a-f]+: 2e209800 cmle v0\.8b, v0\.8b, #0
|
||||
+ *[0-9a-f]+: 2e20981f cmle v31\.8b, v0\.8b, #0
|
||||
+ *[0-9a-f]+: 2e209be0 cmle v0\.8b, v31\.8b, #0
|
||||
+ *[0-9a-f]+: 2e609800 cmle v0\.4h, v0\.4h, #0
|
||||
+ *[0-9a-f]+: 2e60981f cmle v31\.4h, v0\.4h, #0
|
||||
+ *[0-9a-f]+: 2e609be0 cmle v0\.4h, v31\.4h, #0
|
||||
+ *[0-9a-f]+: 2ea09800 cmle v0\.2s, v0\.2s, #0
|
||||
+ *[0-9a-f]+: 2ea0981f cmle v31\.2s, v0\.2s, #0
|
||||
+ *[0-9a-f]+: 2ea09be0 cmle v0\.2s, v31\.2s, #0
|
||||
+ *[0-9a-f]+: 6e209800 cmle v0\.16b, v0\.16b, #0
|
||||
+ *[0-9a-f]+: 6e20981f cmle v31\.16b, v0\.16b, #0
|
||||
+ *[0-9a-f]+: 6e209be0 cmle v0\.16b, v31\.16b, #0
|
||||
+ *[0-9a-f]+: 6e609800 cmle v0\.8h, v0\.8h, #0
|
||||
+ *[0-9a-f]+: 6e60981f cmle v31\.8h, v0\.8h, #0
|
||||
+ *[0-9a-f]+: 6e609be0 cmle v0\.8h, v31\.8h, #0
|
||||
+ *[0-9a-f]+: 6ea09800 cmle v0\.4s, v0\.4s, #0
|
||||
+ *[0-9a-f]+: 6ea0981f cmle v31\.4s, v0\.4s, #0
|
||||
+ *[0-9a-f]+: 6ea09be0 cmle v0\.4s, v31\.4s, #0
|
||||
+ *[0-9a-f]+: 6ee09800 cmle v0\.2d, v0\.2d, #0
|
||||
+ *[0-9a-f]+: 6ee0981f cmle v31\.2d, v0\.2d, #0
|
||||
+ *[0-9a-f]+: 6ee09be0 cmle v0\.2d, v31\.2d, #0
|
||||
+ *[0-9a-f]+: 2e20b800 neg v0\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e20b81f neg v31\.8b, v0\.8b
|
||||
+ *[0-9a-f]+: 2e20bbe0 neg v0\.8b, v31\.8b
|
||||
+ *[0-9a-f]+: 2e60b800 neg v0\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 2e60b81f neg v31\.4h, v0\.4h
|
||||
+ *[0-9a-f]+: 2e60bbe0 neg v0\.4h, v31\.4h
|
||||
+ *[0-9a-f]+: 2ea0b800 neg v0\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea0b81f neg v31\.2s, v0\.2s
|
||||
+ *[0-9a-f]+: 2ea0bbe0 neg v0\.2s, v31\.2s
|
||||
+ *[0-9a-f]+: 6e20b800 neg v0\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e20b81f neg v31\.16b, v0\.16b
|
||||
+ *[0-9a-f]+: 6e20bbe0 neg v0\.16b, v31\.16b
|
||||
+ *[0-9a-f]+: 6e60b800 neg v0\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 6e60b81f neg v31\.8h, v0\.8h
|
||||
+ *[0-9a-f]+: 6e60bbe0 neg v0\.8h, v31\.8h
|
||||
+ *[0-9a-f]+: 6ea0b800 neg v0\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea0b81f neg v31\.4s, v0\.4s
|
||||
+ *[0-9a-f]+: 6ea0bbe0 neg v0\.4s, v31\.4s
|
||||
+ *[0-9a-f]+: 6ee0b800 neg v0\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 6ee0b81f neg v31\.2d, v0\.2d
|
||||
+ *[0-9a-f]+: 6ee0bbe0 neg v0\.2d, v31\.2d
|
||||
diff --git a/gas/testsuite/gas/aarch64/advsimd-two-reg-misc.s b/gas/testsuite/gas/aarch64/advsimd-two-reg-misc.s
|
||||
new file mode 100644
|
||||
index 00000000000..6a66ff7acc0
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/advsimd-two-reg-misc.s
|
||||
@@ -0,0 +1,422 @@
|
||||
+ rev64 v0.8b, v0.8b
|
||||
+ rev64 v31.8b, v0.8b
|
||||
+ rev64 v0.8b, v31.8b
|
||||
+ rev64 v0.4h, v0.4h
|
||||
+ rev64 v31.4h, v0.4h
|
||||
+ rev64 v0.4h, v31.4h
|
||||
+ rev64 v0.2s, v0.2s
|
||||
+ rev64 v31.2s, v0.2s
|
||||
+ rev64 v0.2s, v31.2s
|
||||
+ rev64 v0.16b, v0.16b
|
||||
+ rev64 v31.16b, v0.16b
|
||||
+ rev64 v0.16b, v31.16b
|
||||
+ rev64 v0.8h, v0.8h
|
||||
+ rev64 v31.8h, v0.8h
|
||||
+ rev64 v0.8h, v31.8h
|
||||
+ rev64 v0.4s, v0.4s
|
||||
+ rev64 v31.4s, v0.4s
|
||||
+ rev64 v0.4s, v31.4s
|
||||
+
|
||||
+ rev16 v0.8b, v0.8b
|
||||
+ rev16 v31.8b, v0.8b
|
||||
+ rev16 v0.8b, v31.8b
|
||||
+ rev16 v0.16b, v0.16b
|
||||
+ rev16 v31.16b, v0.16b
|
||||
+ rev16 v0.16b, v31.16b
|
||||
+
|
||||
+ saddlp v0.4h, v0.8b
|
||||
+ saddlp v31.4h, v0.8b
|
||||
+ saddlp v0.4h, v31.8b
|
||||
+ saddlp v0.2s, v0.4h
|
||||
+ saddlp v31.2s, v0.4h
|
||||
+ saddlp v0.2s, v31.4h
|
||||
+ saddlp v0.1d, v0.2s
|
||||
+ saddlp v31.1d, v0.2s
|
||||
+ saddlp v0.1d, v31.2s
|
||||
+ saddlp v0.8h, v0.16b
|
||||
+ saddlp v31.8h, v0.16b
|
||||
+ saddlp v0.8h, v31.16b
|
||||
+ saddlp v0.4s, v0.8h
|
||||
+ saddlp v31.4s, v0.8h
|
||||
+ saddlp v0.4s, v31.8h
|
||||
+ saddlp v0.2d, v0.4s
|
||||
+ saddlp v31.2d, v0.4s
|
||||
+ saddlp v0.2d, v31.4s
|
||||
+
|
||||
+ suqadd v0.8b, v0.8b
|
||||
+ suqadd v31.8b, v0.8b
|
||||
+ suqadd v0.8b, v31.8b
|
||||
+ suqadd v0.4h, v0.4h
|
||||
+ suqadd v31.4h, v0.4h
|
||||
+ suqadd v0.4h, v31.4h
|
||||
+ suqadd v0.2s, v0.2s
|
||||
+ suqadd v31.2s, v0.2s
|
||||
+ suqadd v0.2s, v31.2s
|
||||
+ suqadd v0.16b, v0.16b
|
||||
+ suqadd v31.16b, v0.16b
|
||||
+ suqadd v0.16b, v31.16b
|
||||
+ suqadd v0.8h, v0.8h
|
||||
+ suqadd v31.8h, v0.8h
|
||||
+ suqadd v0.8h, v31.8h
|
||||
+ suqadd v0.4s, v0.4s
|
||||
+ suqadd v31.4s, v0.4s
|
||||
+ suqadd v0.4s, v31.4s
|
||||
+ suqadd v0.2d, v0.2d
|
||||
+ suqadd v31.2d, v0.2d
|
||||
+ suqadd v0.2d, v31.2d
|
||||
+
|
||||
+ cls v0.8b, v0.8b
|
||||
+ cls v31.8b, v0.8b
|
||||
+ cls v0.8b, v31.8b
|
||||
+ cls v0.4h, v0.4h
|
||||
+ cls v31.4h, v0.4h
|
||||
+ cls v0.4h, v31.4h
|
||||
+ cls v0.2s, v0.2s
|
||||
+ cls v31.2s, v0.2s
|
||||
+ cls v0.2s, v31.2s
|
||||
+ cls v0.16b, v0.16b
|
||||
+ cls v31.16b, v0.16b
|
||||
+ cls v0.16b, v31.16b
|
||||
+ cls v0.8h, v0.8h
|
||||
+ cls v31.8h, v0.8h
|
||||
+ cls v0.8h, v31.8h
|
||||
+ cls v0.4s, v0.4s
|
||||
+ cls v31.4s, v0.4s
|
||||
+ cls v0.4s, v31.4s
|
||||
+
|
||||
+ cnt v0.8b, v0.8b
|
||||
+ cnt v31.8b, v0.8b
|
||||
+ cnt v0.8b, v31.8b
|
||||
+ cnt v0.16b, v0.16b
|
||||
+ cnt v31.16b, v0.16b
|
||||
+ cnt v0.16b, v31.16b
|
||||
+
|
||||
+ sadalp v0.4h, v0.8b
|
||||
+ sadalp v31.4h, v0.8b
|
||||
+ sadalp v0.4h, v31.8b
|
||||
+ sadalp v0.2s, v0.4h
|
||||
+ sadalp v31.2s, v0.4h
|
||||
+ sadalp v0.2s, v31.4h
|
||||
+ sadalp v0.1d, v0.2s
|
||||
+ sadalp v31.1d, v0.2s
|
||||
+ sadalp v0.1d, v31.2s
|
||||
+ sadalp v0.8h, v0.16b
|
||||
+ sadalp v31.8h, v0.16b
|
||||
+ sadalp v0.8h, v31.16b
|
||||
+ sadalp v0.4s, v0.8h
|
||||
+ sadalp v31.4s, v0.8h
|
||||
+ sadalp v0.4s, v31.8h
|
||||
+ sadalp v0.2d, v0.4s
|
||||
+ sadalp v31.2d, v0.4s
|
||||
+ sadalp v0.2d, v31.4s
|
||||
+
|
||||
+ sqabs v0.8b, v0.8b
|
||||
+ sqabs v31.8b, v0.8b
|
||||
+ sqabs v0.8b, v31.8b
|
||||
+ sqabs v0.4h, v0.4h
|
||||
+ sqabs v31.4h, v0.4h
|
||||
+ sqabs v0.4h, v31.4h
|
||||
+ sqabs v0.2s, v0.2s
|
||||
+ sqabs v31.2s, v0.2s
|
||||
+ sqabs v0.2s, v31.2s
|
||||
+ sqabs v0.16b, v0.16b
|
||||
+ sqabs v31.16b, v0.16b
|
||||
+ sqabs v0.16b, v31.16b
|
||||
+ sqabs v0.8h, v0.8h
|
||||
+ sqabs v31.8h, v0.8h
|
||||
+ sqabs v0.8h, v31.8h
|
||||
+ sqabs v0.4s, v0.4s
|
||||
+ sqabs v31.4s, v0.4s
|
||||
+ sqabs v0.4s, v31.4s
|
||||
+ sqabs v0.2d, v0.2d
|
||||
+ sqabs v31.2d, v0.2d
|
||||
+ sqabs v0.2d, v31.2d
|
||||
+
|
||||
+ cmgt v0.8b, v0.8b, #0
|
||||
+ cmgt v31.8b, v0.8b, #0
|
||||
+ cmgt v0.8b, v31.8b, #0
|
||||
+ cmgt v0.4h, v0.4h, #0
|
||||
+ cmgt v31.4h, v0.4h, #0
|
||||
+ cmgt v0.4h, v31.4h, #0
|
||||
+ cmgt v0.2s, v0.2s, #0
|
||||
+ cmgt v31.2s, v0.2s, #0
|
||||
+ cmgt v0.2s, v31.2s, #0
|
||||
+ cmgt v0.16b, v0.16b, #0
|
||||
+ cmgt v31.16b, v0.16b, #0
|
||||
+ cmgt v0.16b, v31.16b, #0
|
||||
+ cmgt v0.8h, v0.8h, #0
|
||||
+ cmgt v31.8h, v0.8h, #0
|
||||
+ cmgt v0.8h, v31.8h, #0
|
||||
+ cmgt v0.4s, v0.4s, #0
|
||||
+ cmgt v31.4s, v0.4s, #0
|
||||
+ cmgt v0.4s, v31.4s, #0
|
||||
+ cmgt v0.2d, v0.2d, #0
|
||||
+ cmgt v31.2d, v0.2d, #0
|
||||
+ cmgt v0.2d, v31.2d, #0
|
||||
+
|
||||
+ cmeq v0.8b, v0.8b, #0
|
||||
+ cmeq v31.8b, v0.8b, #0
|
||||
+ cmeq v0.8b, v31.8b, #0
|
||||
+ cmeq v0.4h, v0.4h, #0
|
||||
+ cmeq v31.4h, v0.4h, #0
|
||||
+ cmeq v0.4h, v31.4h, #0
|
||||
+ cmeq v0.2s, v0.2s, #0
|
||||
+ cmeq v31.2s, v0.2s, #0
|
||||
+ cmeq v0.2s, v31.2s, #0
|
||||
+ cmeq v0.16b, v0.16b, #0
|
||||
+ cmeq v31.16b, v0.16b, #0
|
||||
+ cmeq v0.16b, v31.16b, #0
|
||||
+ cmeq v0.8h, v0.8h, #0
|
||||
+ cmeq v31.8h, v0.8h, #0
|
||||
+ cmeq v0.8h, v31.8h, #0
|
||||
+ cmeq v0.4s, v0.4s, #0
|
||||
+ cmeq v31.4s, v0.4s, #0
|
||||
+ cmeq v0.4s, v31.4s, #0
|
||||
+ cmeq v0.2d, v0.2d, #0
|
||||
+ cmeq v31.2d, v0.2d, #0
|
||||
+ cmeq v0.2d, v31.2d, #0
|
||||
+
|
||||
+ cmlt v0.8b, v0.8b, #0
|
||||
+ cmlt v31.8b, v0.8b, #0
|
||||
+ cmlt v0.8b, v31.8b, #0
|
||||
+ cmlt v0.4h, v0.4h, #0
|
||||
+ cmlt v31.4h, v0.4h, #0
|
||||
+ cmlt v0.4h, v31.4h, #0
|
||||
+ cmlt v0.2s, v0.2s, #0
|
||||
+ cmlt v31.2s, v0.2s, #0
|
||||
+ cmlt v0.2s, v31.2s, #0
|
||||
+ cmlt v0.16b, v0.16b, #0
|
||||
+ cmlt v31.16b, v0.16b, #0
|
||||
+ cmlt v0.16b, v31.16b, #0
|
||||
+ cmlt v0.8h, v0.8h, #0
|
||||
+ cmlt v31.8h, v0.8h, #0
|
||||
+ cmlt v0.8h, v31.8h, #0
|
||||
+ cmlt v0.4s, v0.4s, #0
|
||||
+ cmlt v31.4s, v0.4s, #0
|
||||
+ cmlt v0.4s, v31.4s, #0
|
||||
+ cmlt v0.2d, v0.2d, #0
|
||||
+ cmlt v31.2d, v0.2d, #0
|
||||
+ cmlt v0.2d, v31.2d, #0
|
||||
+
|
||||
+ abs v0.8b, v0.8b
|
||||
+ abs v31.8b, v0.8b
|
||||
+ abs v0.8b, v31.8b
|
||||
+ abs v0.4h, v0.4h
|
||||
+ abs v31.4h, v0.4h
|
||||
+ abs v0.4h, v31.4h
|
||||
+ abs v0.2s, v0.2s
|
||||
+ abs v31.2s, v0.2s
|
||||
+ abs v0.2s, v31.2s
|
||||
+ abs v0.16b, v0.16b
|
||||
+ abs v31.16b, v0.16b
|
||||
+ abs v0.16b, v31.16b
|
||||
+ abs v0.8h, v0.8h
|
||||
+ abs v31.8h, v0.8h
|
||||
+ abs v0.8h, v31.8h
|
||||
+ abs v0.4s, v0.4s
|
||||
+ abs v31.4s, v0.4s
|
||||
+ abs v0.4s, v31.4s
|
||||
+ abs v0.2d, v0.2d
|
||||
+ abs v31.2d, v0.2d
|
||||
+ abs v0.2d, v31.2d
|
||||
+
|
||||
+ rev32 v0.8b, v0.8b
|
||||
+ rev32 v31.8b, v0.8b
|
||||
+ rev32 v0.8b, v31.8b
|
||||
+ rev32 v0.4h, v0.4h
|
||||
+ rev32 v31.4h, v0.4h
|
||||
+ rev32 v0.4h, v31.4h
|
||||
+ rev32 v0.16b, v0.16b
|
||||
+ rev32 v31.16b, v0.16b
|
||||
+ rev32 v0.16b, v31.16b
|
||||
+ rev32 v0.8h, v0.8h
|
||||
+ rev32 v31.8h, v0.8h
|
||||
+ rev32 v0.8h, v31.8h
|
||||
+
|
||||
+ uaddlp v0.4h, v0.8b
|
||||
+ uaddlp v31.4h, v0.8b
|
||||
+ uaddlp v0.4h, v31.8b
|
||||
+ uaddlp v0.2s, v0.4h
|
||||
+ uaddlp v31.2s, v0.4h
|
||||
+ uaddlp v0.2s, v31.4h
|
||||
+ uaddlp v0.1d, v0.2s
|
||||
+ uaddlp v31.1d, v0.2s
|
||||
+ uaddlp v0.1d, v31.2s
|
||||
+ uaddlp v0.8h, v0.16b
|
||||
+ uaddlp v31.8h, v0.16b
|
||||
+ uaddlp v0.8h, v31.16b
|
||||
+ uaddlp v0.4s, v0.8h
|
||||
+ uaddlp v31.4s, v0.8h
|
||||
+ uaddlp v0.4s, v31.8h
|
||||
+ uaddlp v0.2d, v0.4s
|
||||
+ uaddlp v31.2d, v0.4s
|
||||
+ uaddlp v0.2d, v31.4s
|
||||
+
|
||||
+ usqadd v0.8b, v0.8b
|
||||
+ usqadd v31.8b, v0.8b
|
||||
+ usqadd v0.8b, v31.8b
|
||||
+ usqadd v0.4h, v0.4h
|
||||
+ usqadd v31.4h, v0.4h
|
||||
+ usqadd v0.4h, v31.4h
|
||||
+ usqadd v0.2s, v0.2s
|
||||
+ usqadd v31.2s, v0.2s
|
||||
+ usqadd v0.2s, v31.2s
|
||||
+ usqadd v0.16b, v0.16b
|
||||
+ usqadd v31.16b, v0.16b
|
||||
+ usqadd v0.16b, v31.16b
|
||||
+ usqadd v0.8h, v0.8h
|
||||
+ usqadd v31.8h, v0.8h
|
||||
+ usqadd v0.8h, v31.8h
|
||||
+ usqadd v0.4s, v0.4s
|
||||
+ usqadd v31.4s, v0.4s
|
||||
+ usqadd v0.4s, v31.4s
|
||||
+ usqadd v0.2d, v0.2d
|
||||
+ usqadd v31.2d, v0.2d
|
||||
+ usqadd v0.2d, v31.2d
|
||||
+
|
||||
+ clz v0.8b, v0.8b
|
||||
+ clz v31.8b, v0.8b
|
||||
+ clz v0.8b, v31.8b
|
||||
+ clz v0.4h, v0.4h
|
||||
+ clz v31.4h, v0.4h
|
||||
+ clz v0.4h, v31.4h
|
||||
+ clz v0.2s, v0.2s
|
||||
+ clz v31.2s, v0.2s
|
||||
+ clz v0.2s, v31.2s
|
||||
+ clz v0.16b, v0.16b
|
||||
+ clz v31.16b, v0.16b
|
||||
+ clz v0.16b, v31.16b
|
||||
+ clz v0.8h, v0.8h
|
||||
+ clz v31.8h, v0.8h
|
||||
+ clz v0.8h, v31.8h
|
||||
+ clz v0.4s, v0.4s
|
||||
+ clz v31.4s, v0.4s
|
||||
+ clz v0.4s, v31.4s
|
||||
+
|
||||
+ not v0.8b, v0.8b
|
||||
+ not v31.8b, v0.8b
|
||||
+ not v0.8b, v31.8b
|
||||
+ not v0.16b, v0.16b
|
||||
+ not v31.16b, v0.16b
|
||||
+ not v0.16b, v31.16b
|
||||
+
|
||||
+ mvn v0.8b, v0.8b
|
||||
+ mvn v31.8b, v0.8b
|
||||
+ mvn v0.8b, v31.8b
|
||||
+ mvn v0.16b, v0.16b
|
||||
+ mvn v31.16b, v0.16b
|
||||
+ mvn v0.16b, v31.16b
|
||||
+
|
||||
+ rbit v0.8b, v0.8b
|
||||
+ rbit v31.8b, v0.8b
|
||||
+ rbit v0.8b, v31.8b
|
||||
+ rbit v0.16b, v0.16b
|
||||
+ rbit v31.16b, v0.16b
|
||||
+ rbit v0.16b, v31.16b
|
||||
+
|
||||
+ uadalp v0.4h, v0.8b
|
||||
+ uadalp v31.4h, v0.8b
|
||||
+ uadalp v0.4h, v31.8b
|
||||
+ uadalp v0.2s, v0.4h
|
||||
+ uadalp v31.2s, v0.4h
|
||||
+ uadalp v0.2s, v31.4h
|
||||
+ uadalp v0.1d, v0.2s
|
||||
+ uadalp v31.1d, v0.2s
|
||||
+ uadalp v0.1d, v31.2s
|
||||
+ uadalp v0.8h, v0.16b
|
||||
+ uadalp v31.8h, v0.16b
|
||||
+ uadalp v0.8h, v31.16b
|
||||
+ uadalp v0.4s, v0.8h
|
||||
+ uadalp v31.4s, v0.8h
|
||||
+ uadalp v0.4s, v31.8h
|
||||
+ uadalp v0.2d, v0.4s
|
||||
+ uadalp v31.2d, v0.4s
|
||||
+ uadalp v0.2d, v31.4s
|
||||
+
|
||||
+ sqneg v0.8b, v0.8b
|
||||
+ sqneg v31.8b, v0.8b
|
||||
+ sqneg v0.8b, v31.8b
|
||||
+ sqneg v0.4h, v0.4h
|
||||
+ sqneg v31.4h, v0.4h
|
||||
+ sqneg v0.4h, v31.4h
|
||||
+ sqneg v0.2s, v0.2s
|
||||
+ sqneg v31.2s, v0.2s
|
||||
+ sqneg v0.2s, v31.2s
|
||||
+ sqneg v0.16b, v0.16b
|
||||
+ sqneg v31.16b, v0.16b
|
||||
+ sqneg v0.16b, v31.16b
|
||||
+ sqneg v0.8h, v0.8h
|
||||
+ sqneg v31.8h, v0.8h
|
||||
+ sqneg v0.8h, v31.8h
|
||||
+ sqneg v0.4s, v0.4s
|
||||
+ sqneg v31.4s, v0.4s
|
||||
+ sqneg v0.4s, v31.4s
|
||||
+ sqneg v0.2d, v0.2d
|
||||
+ sqneg v31.2d, v0.2d
|
||||
+ sqneg v0.2d, v31.2d
|
||||
+
|
||||
+ cmge v0.8b, v0.8b, #0
|
||||
+ cmge v31.8b, v0.8b, #0
|
||||
+ cmge v0.8b, v31.8b, #0
|
||||
+ cmge v0.4h, v0.4h, #0
|
||||
+ cmge v31.4h, v0.4h, #0
|
||||
+ cmge v0.4h, v31.4h, #0
|
||||
+ cmge v0.2s, v0.2s, #0
|
||||
+ cmge v31.2s, v0.2s, #0
|
||||
+ cmge v0.2s, v31.2s, #0
|
||||
+ cmge v0.16b, v0.16b, #0
|
||||
+ cmge v31.16b, v0.16b, #0
|
||||
+ cmge v0.16b, v31.16b, #0
|
||||
+ cmge v0.8h, v0.8h, #0
|
||||
+ cmge v31.8h, v0.8h, #0
|
||||
+ cmge v0.8h, v31.8h, #0
|
||||
+ cmge v0.4s, v0.4s, #0
|
||||
+ cmge v31.4s, v0.4s, #0
|
||||
+ cmge v0.4s, v31.4s, #0
|
||||
+ cmge v0.2d, v0.2d, #0
|
||||
+ cmge v31.2d, v0.2d, #0
|
||||
+ cmge v0.2d, v31.2d, #0
|
||||
+
|
||||
+ cmle v0.8b, v0.8b, #0
|
||||
+ cmle v31.8b, v0.8b, #0
|
||||
+ cmle v0.8b, v31.8b, #0
|
||||
+ cmle v0.4h, v0.4h, #0
|
||||
+ cmle v31.4h, v0.4h, #0
|
||||
+ cmle v0.4h, v31.4h, #0
|
||||
+ cmle v0.2s, v0.2s, #0
|
||||
+ cmle v31.2s, v0.2s, #0
|
||||
+ cmle v0.2s, v31.2s, #0
|
||||
+ cmle v0.16b, v0.16b, #0
|
||||
+ cmle v31.16b, v0.16b, #0
|
||||
+ cmle v0.16b, v31.16b, #0
|
||||
+ cmle v0.8h, v0.8h, #0
|
||||
+ cmle v31.8h, v0.8h, #0
|
||||
+ cmle v0.8h, v31.8h, #0
|
||||
+ cmle v0.4s, v0.4s, #0
|
||||
+ cmle v31.4s, v0.4s, #0
|
||||
+ cmle v0.4s, v31.4s, #0
|
||||
+ cmle v0.2d, v0.2d, #0
|
||||
+ cmle v31.2d, v0.2d, #0
|
||||
+ cmle v0.2d, v31.2d, #0
|
||||
+
|
||||
+ neg v0.8b, v0.8b
|
||||
+ neg v31.8b, v0.8b
|
||||
+ neg v0.8b, v31.8b
|
||||
+ neg v0.4h, v0.4h
|
||||
+ neg v31.4h, v0.4h
|
||||
+ neg v0.4h, v31.4h
|
||||
+ neg v0.2s, v0.2s
|
||||
+ neg v31.2s, v0.2s
|
||||
+ neg v0.2s, v31.2s
|
||||
+ neg v0.16b, v0.16b
|
||||
+ neg v31.16b, v0.16b
|
||||
+ neg v0.16b, v31.16b
|
||||
+ neg v0.8h, v0.8h
|
||||
+ neg v31.8h, v0.8h
|
||||
+ neg v0.8h, v31.8h
|
||||
+ neg v0.4s, v0.4s
|
||||
+ neg v31.4s, v0.4s
|
||||
+ neg v0.4s, v31.4s
|
||||
+ neg v0.2d, v0.2d
|
||||
+ neg v31.2d, v0.2d
|
||||
+ neg v0.2d, v31.2d
|
||||
--
|
||||
2.50.1
|
||||
|
1238
SOURCES/binutils-AArch64-missing-assembler-tests-7.patch
Normal file
1238
SOURCES/binutils-AArch64-missing-assembler-tests-7.patch
Normal file
File diff suppressed because it is too large
Load Diff
207
SOURCES/binutils-AArch64-missing-assembler-tests-8.patch
Normal file
207
SOURCES/binutils-AArch64-missing-assembler-tests-8.patch
Normal file
@ -0,0 +1,207 @@
|
||||
From c7fa4b95bb1711b5bd692583d81f4812444aaf18 Mon Sep 17 00:00:00 2001
|
||||
From: Alice Carlotti <alice.carlotti@arm.com>
|
||||
Date: Sun, 20 Apr 2025 23:09:08 +0100
|
||||
Subject: [PATCH] aarch64: Add new test dp-general-two-source.d
|
||||
|
||||
lsl was already tested but is included here as part of the same encoding
|
||||
group.
|
||||
---
|
||||
.../gas/aarch64/dp-general-two-source.d | 89 +++++++++++++++++++
|
||||
.../gas/aarch64/dp-general-two-source.s | 89 +++++++++++++++++++
|
||||
2 files changed, 178 insertions(+)
|
||||
create mode 100644 gas/testsuite/gas/aarch64/dp-general-two-source.d
|
||||
create mode 100644 gas/testsuite/gas/aarch64/dp-general-two-source.s
|
||||
|
||||
diff --git a/gas/testsuite/gas/aarch64/dp-general-two-source.d b/gas/testsuite/gas/aarch64/dp-general-two-source.d
|
||||
new file mode 100644
|
||||
index 00000000000..5c0d816d50e
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/dp-general-two-source.d
|
||||
@@ -0,0 +1,89 @@
|
||||
+#as: -march=armv8-a
|
||||
+#objdump: -dr
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+0+ <\.text>:
|
||||
+ *[0-9a-f]+: 1ac00800 udiv w0, w0, w0
|
||||
+ *[0-9a-f]+: 1ac0081f udiv wzr, w0, w0
|
||||
+ *[0-9a-f]+: 1ac00be0 udiv w0, wzr, w0
|
||||
+ *[0-9a-f]+: 1adf0800 udiv w0, w0, wzr
|
||||
+ *[0-9a-f]+: 9ac00800 udiv x0, x0, x0
|
||||
+ *[0-9a-f]+: 9ac0081f udiv xzr, x0, x0
|
||||
+ *[0-9a-f]+: 9ac00be0 udiv x0, xzr, x0
|
||||
+ *[0-9a-f]+: 9adf0800 udiv x0, x0, xzr
|
||||
+ *[0-9a-f]+: 1ac00c00 sdiv w0, w0, w0
|
||||
+ *[0-9a-f]+: 1ac00c1f sdiv wzr, w0, w0
|
||||
+ *[0-9a-f]+: 1ac00fe0 sdiv w0, wzr, w0
|
||||
+ *[0-9a-f]+: 1adf0c00 sdiv w0, w0, wzr
|
||||
+ *[0-9a-f]+: 9ac00c00 sdiv x0, x0, x0
|
||||
+ *[0-9a-f]+: 9ac00c1f sdiv xzr, x0, x0
|
||||
+ *[0-9a-f]+: 9ac00fe0 sdiv x0, xzr, x0
|
||||
+ *[0-9a-f]+: 9adf0c00 sdiv x0, x0, xzr
|
||||
+ *[0-9a-f]+: 1ac02000 lsl w0, w0, w0
|
||||
+ *[0-9a-f]+: 1ac0201f lsl wzr, w0, w0
|
||||
+ *[0-9a-f]+: 1ac023e0 lsl w0, wzr, w0
|
||||
+ *[0-9a-f]+: 1adf2000 lsl w0, w0, wzr
|
||||
+ *[0-9a-f]+: 9ac02000 lsl x0, x0, x0
|
||||
+ *[0-9a-f]+: 9ac0201f lsl xzr, x0, x0
|
||||
+ *[0-9a-f]+: 9ac023e0 lsl x0, xzr, x0
|
||||
+ *[0-9a-f]+: 9adf2000 lsl x0, x0, xzr
|
||||
+ *[0-9a-f]+: 1ac02000 lsl w0, w0, w0
|
||||
+ *[0-9a-f]+: 1ac0201f lsl wzr, w0, w0
|
||||
+ *[0-9a-f]+: 1ac023e0 lsl w0, wzr, w0
|
||||
+ *[0-9a-f]+: 1adf2000 lsl w0, w0, wzr
|
||||
+ *[0-9a-f]+: 9ac02000 lsl x0, x0, x0
|
||||
+ *[0-9a-f]+: 9ac0201f lsl xzr, x0, x0
|
||||
+ *[0-9a-f]+: 9ac023e0 lsl x0, xzr, x0
|
||||
+ *[0-9a-f]+: 9adf2000 lsl x0, x0, xzr
|
||||
+ *[0-9a-f]+: 1ac02400 lsr w0, w0, w0
|
||||
+ *[0-9a-f]+: 1ac0241f lsr wzr, w0, w0
|
||||
+ *[0-9a-f]+: 1ac027e0 lsr w0, wzr, w0
|
||||
+ *[0-9a-f]+: 1adf2400 lsr w0, w0, wzr
|
||||
+ *[0-9a-f]+: 9ac02400 lsr x0, x0, x0
|
||||
+ *[0-9a-f]+: 9ac0241f lsr xzr, x0, x0
|
||||
+ *[0-9a-f]+: 9ac027e0 lsr x0, xzr, x0
|
||||
+ *[0-9a-f]+: 9adf2400 lsr x0, x0, xzr
|
||||
+ *[0-9a-f]+: 1ac02400 lsr w0, w0, w0
|
||||
+ *[0-9a-f]+: 1ac0241f lsr wzr, w0, w0
|
||||
+ *[0-9a-f]+: 1ac027e0 lsr w0, wzr, w0
|
||||
+ *[0-9a-f]+: 1adf2400 lsr w0, w0, wzr
|
||||
+ *[0-9a-f]+: 9ac02400 lsr x0, x0, x0
|
||||
+ *[0-9a-f]+: 9ac0241f lsr xzr, x0, x0
|
||||
+ *[0-9a-f]+: 9ac027e0 lsr x0, xzr, x0
|
||||
+ *[0-9a-f]+: 9adf2400 lsr x0, x0, xzr
|
||||
+ *[0-9a-f]+: 1ac02800 asr w0, w0, w0
|
||||
+ *[0-9a-f]+: 1ac0281f asr wzr, w0, w0
|
||||
+ *[0-9a-f]+: 1ac02be0 asr w0, wzr, w0
|
||||
+ *[0-9a-f]+: 1adf2800 asr w0, w0, wzr
|
||||
+ *[0-9a-f]+: 9ac02800 asr x0, x0, x0
|
||||
+ *[0-9a-f]+: 9ac0281f asr xzr, x0, x0
|
||||
+ *[0-9a-f]+: 9ac02be0 asr x0, xzr, x0
|
||||
+ *[0-9a-f]+: 9adf2800 asr x0, x0, xzr
|
||||
+ *[0-9a-f]+: 1ac02800 asr w0, w0, w0
|
||||
+ *[0-9a-f]+: 1ac0281f asr wzr, w0, w0
|
||||
+ *[0-9a-f]+: 1ac02be0 asr w0, wzr, w0
|
||||
+ *[0-9a-f]+: 1adf2800 asr w0, w0, wzr
|
||||
+ *[0-9a-f]+: 9ac02800 asr x0, x0, x0
|
||||
+ *[0-9a-f]+: 9ac0281f asr xzr, x0, x0
|
||||
+ *[0-9a-f]+: 9ac02be0 asr x0, xzr, x0
|
||||
+ *[0-9a-f]+: 9adf2800 asr x0, x0, xzr
|
||||
+ *[0-9a-f]+: 1ac02c00 ror w0, w0, w0
|
||||
+ *[0-9a-f]+: 1ac02c1f ror wzr, w0, w0
|
||||
+ *[0-9a-f]+: 1ac02fe0 ror w0, wzr, w0
|
||||
+ *[0-9a-f]+: 1adf2c00 ror w0, w0, wzr
|
||||
+ *[0-9a-f]+: 9ac02c00 ror x0, x0, x0
|
||||
+ *[0-9a-f]+: 9ac02c1f ror xzr, x0, x0
|
||||
+ *[0-9a-f]+: 9ac02fe0 ror x0, xzr, x0
|
||||
+ *[0-9a-f]+: 9adf2c00 ror x0, x0, xzr
|
||||
+ *[0-9a-f]+: 1ac02c00 ror w0, w0, w0
|
||||
+ *[0-9a-f]+: 1ac02c1f ror wzr, w0, w0
|
||||
+ *[0-9a-f]+: 1ac02fe0 ror w0, wzr, w0
|
||||
+ *[0-9a-f]+: 1adf2c00 ror w0, w0, wzr
|
||||
+ *[0-9a-f]+: 9ac02c00 ror x0, x0, x0
|
||||
+ *[0-9a-f]+: 9ac02c1f ror xzr, x0, x0
|
||||
+ *[0-9a-f]+: 9ac02fe0 ror x0, xzr, x0
|
||||
+ *[0-9a-f]+: 9adf2c00 ror x0, x0, xzr
|
||||
diff --git a/gas/testsuite/gas/aarch64/dp-general-two-source.s b/gas/testsuite/gas/aarch64/dp-general-two-source.s
|
||||
new file mode 100644
|
||||
index 00000000000..95f2f0038a9
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/dp-general-two-source.s
|
||||
@@ -0,0 +1,89 @@
|
||||
+ udiv w0, w0, w0
|
||||
+ udiv wzr, w0, w0
|
||||
+ udiv w0, wzr, w0
|
||||
+ udiv w0, w0, wzr
|
||||
+ udiv x0, x0, x0
|
||||
+ udiv xzr, x0, x0
|
||||
+ udiv x0, xzr, x0
|
||||
+ udiv x0, x0, xzr
|
||||
+
|
||||
+ sdiv w0, w0, w0
|
||||
+ sdiv wzr, w0, w0
|
||||
+ sdiv w0, wzr, w0
|
||||
+ sdiv w0, w0, wzr
|
||||
+ sdiv x0, x0, x0
|
||||
+ sdiv xzr, x0, x0
|
||||
+ sdiv x0, xzr, x0
|
||||
+ sdiv x0, x0, xzr
|
||||
+
|
||||
+ lslv w0, w0, w0
|
||||
+ lslv wzr, w0, w0
|
||||
+ lslv w0, wzr, w0
|
||||
+ lslv w0, w0, wzr
|
||||
+ lslv x0, x0, x0
|
||||
+ lslv xzr, x0, x0
|
||||
+ lslv x0, xzr, x0
|
||||
+ lslv x0, x0, xzr
|
||||
+
|
||||
+ lsl w0, w0, w0
|
||||
+ lsl wzr, w0, w0
|
||||
+ lsl w0, wzr, w0
|
||||
+ lsl w0, w0, wzr
|
||||
+ lsl x0, x0, x0
|
||||
+ lsl xzr, x0, x0
|
||||
+ lsl x0, xzr, x0
|
||||
+ lsl x0, x0, xzr
|
||||
+
|
||||
+ lsrv w0, w0, w0
|
||||
+ lsrv wzr, w0, w0
|
||||
+ lsrv w0, wzr, w0
|
||||
+ lsrv w0, w0, wzr
|
||||
+ lsrv x0, x0, x0
|
||||
+ lsrv xzr, x0, x0
|
||||
+ lsrv x0, xzr, x0
|
||||
+ lsrv x0, x0, xzr
|
||||
+
|
||||
+ lsr w0, w0, w0
|
||||
+ lsr wzr, w0, w0
|
||||
+ lsr w0, wzr, w0
|
||||
+ lsr w0, w0, wzr
|
||||
+ lsr x0, x0, x0
|
||||
+ lsr xzr, x0, x0
|
||||
+ lsr x0, xzr, x0
|
||||
+ lsr x0, x0, xzr
|
||||
+
|
||||
+ asrv w0, w0, w0
|
||||
+ asrv wzr, w0, w0
|
||||
+ asrv w0, wzr, w0
|
||||
+ asrv w0, w0, wzr
|
||||
+ asrv x0, x0, x0
|
||||
+ asrv xzr, x0, x0
|
||||
+ asrv x0, xzr, x0
|
||||
+ asrv x0, x0, xzr
|
||||
+
|
||||
+ asr w0, w0, w0
|
||||
+ asr wzr, w0, w0
|
||||
+ asr w0, wzr, w0
|
||||
+ asr w0, w0, wzr
|
||||
+ asr x0, x0, x0
|
||||
+ asr xzr, x0, x0
|
||||
+ asr x0, xzr, x0
|
||||
+ asr x0, x0, xzr
|
||||
+
|
||||
+ rorv w0, w0, w0
|
||||
+ rorv wzr, w0, w0
|
||||
+ rorv w0, wzr, w0
|
||||
+ rorv w0, w0, wzr
|
||||
+ rorv x0, x0, x0
|
||||
+ rorv xzr, x0, x0
|
||||
+ rorv x0, xzr, x0
|
||||
+ rorv x0, x0, xzr
|
||||
+
|
||||
+ ror w0, w0, w0
|
||||
+ ror wzr, w0, w0
|
||||
+ ror w0, wzr, w0
|
||||
+ ror w0, w0, wzr
|
||||
+ ror x0, x0, x0
|
||||
+ ror xzr, x0, x0
|
||||
+ ror x0, xzr, x0
|
||||
+ ror x0, x0, xzr
|
||||
--
|
||||
2.50.1
|
||||
|
181
SOURCES/binutils-AArch64-missing-assembler-tests-9.patch
Normal file
181
SOURCES/binutils-AArch64-missing-assembler-tests-9.patch
Normal file
@ -0,0 +1,181 @@
|
||||
From 87d10eecf9db0e77948e701387111d20c1211da0 Mon Sep 17 00:00:00 2001
|
||||
From: Alice Carlotti <alice.carlotti@arm.com>
|
||||
Date: Sun, 20 Apr 2025 23:11:29 +0100
|
||||
Subject: [PATCH] aarch64: Add new test conditional-compare.d
|
||||
|
||||
The register form of ccmp was already tested.
|
||||
---
|
||||
.../gas/aarch64/conditional-compare.d | 77 +++++++++++++++++++
|
||||
.../gas/aarch64/conditional-compare.s | 76 ++++++++++++++++++
|
||||
2 files changed, 153 insertions(+)
|
||||
create mode 100644 gas/testsuite/gas/aarch64/conditional-compare.d
|
||||
create mode 100644 gas/testsuite/gas/aarch64/conditional-compare.s
|
||||
|
||||
diff --git a/gas/testsuite/gas/aarch64/conditional-compare.d b/gas/testsuite/gas/aarch64/conditional-compare.d
|
||||
new file mode 100644
|
||||
index 00000000000..294e0c94c30
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/conditional-compare.d
|
||||
@@ -0,0 +1,77 @@
|
||||
+#as: -march=armv8-a
|
||||
+#objdump: -dr
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+0+ <\.text>:
|
||||
+ *[0-9a-f]+: 3a400800 ccmn w0, #0x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 3a400be0 ccmn wzr, #0x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 3a5f0800 ccmn w0, #0x1f, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 3a40080f ccmn w0, #0x0, #0xf, eq // eq = none
|
||||
+ *[0-9a-f]+: 3a40f800 ccmn w0, #0x0, #0x0, nv
|
||||
+ *[0-9a-f]+: ba400800 ccmn x0, #0x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: ba400be0 ccmn xzr, #0x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: ba5f0800 ccmn x0, #0x1f, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: ba40080f ccmn x0, #0x0, #0xf, eq // eq = none
|
||||
+ *[0-9a-f]+: ba40f800 ccmn x0, #0x0, #0x0, nv
|
||||
+ *[0-9a-f]+: 7a400800 ccmp w0, #0x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 7a400be0 ccmp wzr, #0x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 7a5f0800 ccmp w0, #0x1f, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 7a40080f ccmp w0, #0x0, #0xf, eq // eq = none
|
||||
+ *[0-9a-f]+: 7a40f800 ccmp w0, #0x0, #0x0, nv
|
||||
+ *[0-9a-f]+: fa400800 ccmp x0, #0x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: fa400be0 ccmp xzr, #0x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: fa5f0800 ccmp x0, #0x1f, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: fa40080f ccmp x0, #0x0, #0xf, eq // eq = none
|
||||
+ *[0-9a-f]+: fa40f800 ccmp x0, #0x0, #0x0, nv
|
||||
+ *[0-9a-f]+: 3a400000 ccmn w0, w0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 3a4003e0 ccmn wzr, w0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 3a5f0000 ccmn w0, wzr, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 3a40000f ccmn w0, w0, #0xf, eq // eq = none
|
||||
+ *[0-9a-f]+: 3a40f000 ccmn w0, w0, #0x0, nv
|
||||
+ *[0-9a-f]+: ba400000 ccmn x0, x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: ba4003e0 ccmn xzr, x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: ba5f0000 ccmn x0, xzr, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: ba40000f ccmn x0, x0, #0xf, eq // eq = none
|
||||
+ *[0-9a-f]+: ba40f000 ccmn x0, x0, #0x0, nv
|
||||
+ *[0-9a-f]+: 7a400000 ccmp w0, w0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 7a4003e0 ccmp wzr, w0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 7a5f0000 ccmp w0, wzr, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 7a40000f ccmp w0, w0, #0xf, eq // eq = none
|
||||
+ *[0-9a-f]+: 7a40f000 ccmp w0, w0, #0x0, nv
|
||||
+ *[0-9a-f]+: fa400000 ccmp x0, x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: fa4003e0 ccmp xzr, x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: fa5f0000 ccmp x0, xzr, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: fa40000f ccmp x0, x0, #0xf, eq // eq = none
|
||||
+ *[0-9a-f]+: fa40f000 ccmp x0, x0, #0x0, nv
|
||||
+ *[0-9a-f]+: 3a400800 ccmn w0, #0x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 3a400800 ccmn w0, #0x0, #0x0, eq // eq = none
|
||||
+ *[0-9a-f]+: 3a401800 ccmn w0, #0x0, #0x0, ne // ne = any
|
||||
+ *[0-9a-f]+: 3a401800 ccmn w0, #0x0, #0x0, ne // ne = any
|
||||
+ *[0-9a-f]+: 3a402800 ccmn w0, #0x0, #0x0, cs // cs = hs, nlast
|
||||
+ *[0-9a-f]+: 3a402800 ccmn w0, #0x0, #0x0, cs // cs = hs, nlast
|
||||
+ *[0-9a-f]+: 3a402800 ccmn w0, #0x0, #0x0, cs // cs = hs, nlast
|
||||
+ *[0-9a-f]+: 3a403800 ccmn w0, #0x0, #0x0, cc // cc = lo, ul, last
|
||||
+ *[0-9a-f]+: 3a403800 ccmn w0, #0x0, #0x0, cc // cc = lo, ul, last
|
||||
+ *[0-9a-f]+: 3a403800 ccmn w0, #0x0, #0x0, cc // cc = lo, ul, last
|
||||
+ *[0-9a-f]+: 3a404800 ccmn w0, #0x0, #0x0, mi // mi = first
|
||||
+ *[0-9a-f]+: 3a404800 ccmn w0, #0x0, #0x0, mi // mi = first
|
||||
+ *[0-9a-f]+: 3a405800 ccmn w0, #0x0, #0x0, pl // pl = nfrst
|
||||
+ *[0-9a-f]+: 3a405800 ccmn w0, #0x0, #0x0, pl // pl = nfrst
|
||||
+ *[0-9a-f]+: 3a406800 ccmn w0, #0x0, #0x0, vs
|
||||
+ *[0-9a-f]+: 3a407800 ccmn w0, #0x0, #0x0, vc
|
||||
+ *[0-9a-f]+: 3a408800 ccmn w0, #0x0, #0x0, hi // hi = pmore
|
||||
+ *[0-9a-f]+: 3a408800 ccmn w0, #0x0, #0x0, hi // hi = pmore
|
||||
+ *[0-9a-f]+: 3a409800 ccmn w0, #0x0, #0x0, ls // ls = plast
|
||||
+ *[0-9a-f]+: 3a409800 ccmn w0, #0x0, #0x0, ls // ls = plast
|
||||
+ *[0-9a-f]+: 3a40a800 ccmn w0, #0x0, #0x0, ge // ge = tcont
|
||||
+ *[0-9a-f]+: 3a40a800 ccmn w0, #0x0, #0x0, ge // ge = tcont
|
||||
+ *[0-9a-f]+: 3a40b800 ccmn w0, #0x0, #0x0, lt // lt = tstop
|
||||
+ *[0-9a-f]+: 3a40b800 ccmn w0, #0x0, #0x0, lt // lt = tstop
|
||||
+ *[0-9a-f]+: 3a40c800 ccmn w0, #0x0, #0x0, gt
|
||||
+ *[0-9a-f]+: 3a40d800 ccmn w0, #0x0, #0x0, le
|
||||
+ *[0-9a-f]+: 3a40e800 ccmn w0, #0x0, #0x0, al
|
||||
+ *[0-9a-f]+: 3a40f800 ccmn w0, #0x0, #0x0, nv
|
||||
diff --git a/gas/testsuite/gas/aarch64/conditional-compare.s b/gas/testsuite/gas/aarch64/conditional-compare.s
|
||||
new file mode 100644
|
||||
index 00000000000..1fe23d3e701
|
||||
--- /dev/null
|
||||
+++ b/gas/testsuite/gas/aarch64/conditional-compare.s
|
||||
@@ -0,0 +1,76 @@
|
||||
+ ccmn w0, #0, #0, eq
|
||||
+ ccmn wzr, #0, #0, eq
|
||||
+ ccmn w0, #31, #0, eq
|
||||
+ ccmn w0, #0, #15, eq
|
||||
+ ccmn w0, #0, #0, nv
|
||||
+
|
||||
+ ccmn x0, #0, #0, eq
|
||||
+ ccmn xzr, #0, #0, eq
|
||||
+ ccmn x0, #31, #0, eq
|
||||
+ ccmn x0, #0, #15, eq
|
||||
+ ccmn x0, #0, #0, nv
|
||||
+
|
||||
+ ccmp w0, #0, #0, eq
|
||||
+ ccmp wzr, #0, #0, eq
|
||||
+ ccmp w0, #31, #0, eq
|
||||
+ ccmp w0, #0, #15, eq
|
||||
+ ccmp w0, #0, #0, nv
|
||||
+
|
||||
+ ccmp x0, #0, #0, eq
|
||||
+ ccmp xzr, #0, #0, eq
|
||||
+ ccmp x0, #31, #0, eq
|
||||
+ ccmp x0, #0, #15, eq
|
||||
+ ccmp x0, #0, #0, nv
|
||||
+
|
||||
+ ccmn w0, w0, #0, eq
|
||||
+ ccmn wzr, w0, #0, eq
|
||||
+ ccmn w0, wzr, #0, eq
|
||||
+ ccmn w0, w0, #15, eq
|
||||
+ ccmn w0, w0, #0, nv
|
||||
+
|
||||
+ ccmn x0, x0, #0, eq
|
||||
+ ccmn xzr, x0, #0, eq
|
||||
+ ccmn x0, xzr, #0, eq
|
||||
+ ccmn x0, x0, #15, eq
|
||||
+ ccmn x0, x0, #0, nv
|
||||
+
|
||||
+ ccmp w0, w0, #0, eq
|
||||
+ ccmp wzr, w0, #0, eq
|
||||
+ ccmp w0, wzr, #0, eq
|
||||
+ ccmp w0, w0, #15, eq
|
||||
+ ccmp w0, w0, #0, nv
|
||||
+
|
||||
+ ccmp x0, x0, #0, eq
|
||||
+ ccmp xzr, x0, #0, eq
|
||||
+ ccmp x0, xzr, #0, eq
|
||||
+ ccmp x0, x0, #15, eq
|
||||
+ ccmp x0, x0, #0, nv
|
||||
+
|
||||
+ ccmn w0, #0, #0, eq
|
||||
+ ccmn w0, #0, #0, none
|
||||
+ ccmn w0, #0, #0, ne
|
||||
+ ccmn w0, #0, #0, any
|
||||
+ ccmn w0, #0, #0, hs
|
||||
+ ccmn w0, #0, #0, cs
|
||||
+ ccmn w0, #0, #0, nlast
|
||||
+ ccmn w0, #0, #0, lo
|
||||
+ ccmn w0, #0, #0, cc
|
||||
+ ccmn w0, #0, #0, last
|
||||
+ ccmn w0, #0, #0, mi
|
||||
+ ccmn w0, #0, #0, first
|
||||
+ ccmn w0, #0, #0, pl
|
||||
+ ccmn w0, #0, #0, nfrst
|
||||
+ ccmn w0, #0, #0, vs
|
||||
+ ccmn w0, #0, #0, vc
|
||||
+ ccmn w0, #0, #0, hi
|
||||
+ ccmn w0, #0, #0, pmore
|
||||
+ ccmn w0, #0, #0, ls
|
||||
+ ccmn w0, #0, #0, plast
|
||||
+ ccmn w0, #0, #0, ge
|
||||
+ ccmn w0, #0, #0, tcont
|
||||
+ ccmn w0, #0, #0, lt
|
||||
+ ccmn w0, #0, #0, tstop
|
||||
+ ccmn w0, #0, #0, gt
|
||||
+ ccmn w0, #0, #0, le
|
||||
+ ccmn w0, #0, #0, al
|
||||
+ ccmn w0, #0, #0, nv
|
||||
--
|
||||
2.50.1
|
||||
|
File diff suppressed because it is too large
Load Diff
155
SOURCES/binutils-CIE-generation.patch
Normal file
155
SOURCES/binutils-CIE-generation.patch
Normal file
@ -0,0 +1,155 @@
|
||||
--- binutils.orig/gas/dw2gencfi.c 2022-09-08 13:54:05.539276706 +0100
|
||||
+++ binutils-2.35.2/gas/dw2gencfi.c 2022-09-08 14:05:56.128016840 +0100
|
||||
@@ -2054,6 +2054,64 @@ output_fde (struct fde_entry *fde, struc
|
||||
symbol_set_value_now (end_address);
|
||||
}
|
||||
|
||||
+/* Allow these insns to be put in the initial sequence of a CIE.
|
||||
+ If J is non-NULL, then compare I and J insns for a match. */
|
||||
+
|
||||
+static inline bfd_boolean
|
||||
+initial_cie_insn (const struct cfi_insn_data *i, const struct cfi_insn_data *j)
|
||||
+{
|
||||
+ if (j && i->insn != j->insn)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ switch (i->insn)
|
||||
+ {
|
||||
+ case DW_CFA_offset:
|
||||
+ case DW_CFA_def_cfa:
|
||||
+ case DW_CFA_val_offset:
|
||||
+ if (j)
|
||||
+ {
|
||||
+ if (i->u.ri.reg != j->u.ri.reg)
|
||||
+ return FALSE;
|
||||
+ if (i->u.ri.offset != j->u.ri.offset)
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case DW_CFA_register:
|
||||
+ if (j)
|
||||
+ {
|
||||
+ if (i->u.rr.reg1 != j->u.rr.reg1)
|
||||
+ return FALSE;
|
||||
+ if (i->u.rr.reg2 != j->u.rr.reg2)
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case DW_CFA_def_cfa_register:
|
||||
+ case DW_CFA_restore:
|
||||
+ case DW_CFA_undefined:
|
||||
+ case DW_CFA_same_value:
|
||||
+ if (j)
|
||||
+ {
|
||||
+ if (i->u.r != j->u.r)
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case DW_CFA_def_cfa_offset:
|
||||
+ if (j)
|
||||
+ {
|
||||
+ if (i->u.i != j->u.i)
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
static struct cie_entry *
|
||||
select_cie_for_fde (struct fde_entry *fde, bfd_boolean eh_frame,
|
||||
struct cfi_insn_data **pfirst, int align)
|
||||
@@ -2099,71 +2157,15 @@ select_cie_for_fde (struct fde_entry *fd
|
||||
i != cie->last && j != NULL;
|
||||
i = i->next, j = j->next)
|
||||
{
|
||||
- if (i->insn != j->insn)
|
||||
- goto fail;
|
||||
- switch (i->insn)
|
||||
- {
|
||||
- case DW_CFA_advance_loc:
|
||||
- case DW_CFA_remember_state:
|
||||
- /* We reached the first advance/remember in the FDE,
|
||||
- but did not reach the end of the CIE list. */
|
||||
- goto fail;
|
||||
-
|
||||
- case DW_CFA_offset:
|
||||
- case DW_CFA_def_cfa:
|
||||
- if (i->u.ri.reg != j->u.ri.reg)
|
||||
- goto fail;
|
||||
- if (i->u.ri.offset != j->u.ri.offset)
|
||||
- goto fail;
|
||||
- break;
|
||||
-
|
||||
- case DW_CFA_register:
|
||||
- if (i->u.rr.reg1 != j->u.rr.reg1)
|
||||
- goto fail;
|
||||
- if (i->u.rr.reg2 != j->u.rr.reg2)
|
||||
- goto fail;
|
||||
- break;
|
||||
-
|
||||
- case DW_CFA_def_cfa_register:
|
||||
- case DW_CFA_restore:
|
||||
- case DW_CFA_undefined:
|
||||
- case DW_CFA_same_value:
|
||||
- if (i->u.r != j->u.r)
|
||||
- goto fail;
|
||||
- break;
|
||||
-
|
||||
- case DW_CFA_def_cfa_offset:
|
||||
- if (i->u.i != j->u.i)
|
||||
- goto fail;
|
||||
- break;
|
||||
-
|
||||
- case CFI_escape:
|
||||
- case CFI_val_encoded_addr:
|
||||
- case CFI_label:
|
||||
- /* Don't bother matching these for now. */
|
||||
- goto fail;
|
||||
-
|
||||
- default:
|
||||
- abort ();
|
||||
- }
|
||||
+ if (!initial_cie_insn (i, j))
|
||||
+ break;
|
||||
}
|
||||
|
||||
- /* Success if we reached the end of the CIE list, and we've either
|
||||
- run out of FDE entries or we've encountered an advance,
|
||||
- remember, or escape. */
|
||||
- if (i == cie->last
|
||||
- && (!j
|
||||
- || j->insn == DW_CFA_advance_loc
|
||||
- || j->insn == DW_CFA_remember_state
|
||||
- || j->insn == CFI_escape
|
||||
- || j->insn == CFI_val_encoded_addr
|
||||
- || j->insn == CFI_label))
|
||||
+ if (i == cie->last)
|
||||
{
|
||||
*pfirst = j;
|
||||
return cie;
|
||||
}
|
||||
-
|
||||
- fail:;
|
||||
}
|
||||
|
||||
cie = XNEW (struct cie_entry);
|
||||
@@ -2181,11 +2183,7 @@ select_cie_for_fde (struct fde_entry *fd
|
||||
#endif
|
||||
|
||||
for (i = cie->first; i ; i = i->next)
|
||||
- if (i->insn == DW_CFA_advance_loc
|
||||
- || i->insn == DW_CFA_remember_state
|
||||
- || i->insn == CFI_escape
|
||||
- || i->insn == CFI_val_encoded_addr
|
||||
- || i->insn == CFI_label)
|
||||
+ if (!initial_cie_insn (i, NULL))
|
||||
break;
|
||||
|
||||
cie->last = i;
|
@ -1,22 +0,0 @@
|
||||
--- binutils.orig/binutils/dwarf.c 2018-05-01 11:42:02.656431736 +0100
|
||||
+++ binutils-2.30/binutils/dwarf.c 2018-05-01 11:43:24.210383020 +0100
|
||||
@@ -9244,7 +9244,18 @@ process_cu_tu_index (struct dwarf_sectio
|
||||
}
|
||||
|
||||
if (!do_display)
|
||||
- memcpy (&this_set[row - 1].signature, ph, sizeof (uint64_t));
|
||||
+ {
|
||||
+ size_t num_copy = sizeof (uint64_t);
|
||||
+
|
||||
+ /* PR 23064: Beware of buffer overflow. */
|
||||
+ if (ph + num_copy < limit)
|
||||
+ memcpy (&this_set[row - 1].signature, ph, num_copy);
|
||||
+ else
|
||||
+ {
|
||||
+ warn (_("Signature (%p) extends beyond end of space in section\n"), ph);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
prow = poffsets + (row - 1) * ncols * 4;
|
||||
/* PR 17531: file: b8ce60a8. */
|
@ -1,11 +0,0 @@
|
||||
--- binutils.orig/bfd/dwarf2.c 2018-05-01 11:42:03.152425647 +0100
|
||||
+++ binutils-2.30/bfd/dwarf2.c 2018-05-01 12:03:27.533735710 +0100
|
||||
@@ -1559,7 +1559,7 @@ concat_filename (struct line_info_table
|
||||
{
|
||||
char *filename;
|
||||
|
||||
- if (file - 1 >= table->num_files)
|
||||
+ if (table == NULL || file - 1 >= table->num_files)
|
||||
{
|
||||
/* FILE == 0 means unknown. */
|
||||
if (file)
|
@ -1,18 +0,0 @@
|
||||
--- binutils.orig/bfd/peXXigen.c 2018-05-10 10:09:03.619147342 +0100
|
||||
+++ binutils-2.30/bfd/peXXigen.c 2018-05-10 10:20:20.884883540 +0100
|
||||
@@ -2991,6 +2991,15 @@ _bfd_XX_bfd_copy_private_bfd_data_common
|
||||
bfd_get_section_size (section) - (addr - section->vma));
|
||||
return FALSE;
|
||||
}
|
||||
+ /* PR 23110. */
|
||||
+ else if (ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size < 0)
|
||||
+ {
|
||||
+ /* xgettext:c-format */
|
||||
+ _bfd_error_handler
|
||||
+ (_("%pB: Data Directory size (%#lx) is negative"),
|
||||
+ obfd, ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
|
||||
for (i = 0; i < ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size
|
||||
/ sizeof (struct external_IMAGE_DEBUG_DIRECTORY); i++)
|
@ -1,28 +0,0 @@
|
||||
--- binutils.orig/bfd/elf.c 2018-05-10 10:09:03.622147305 +0100
|
||||
+++ binutils-2.30/bfd/elf.c 2018-05-10 10:29:09.895577234 +0100
|
||||
@@ -4021,16 +4021,23 @@ ignore_section_sym (bfd *abfd, asymbol *
|
||||
{
|
||||
elf_symbol_type *type_ptr;
|
||||
|
||||
+ if (sym == NULL)
|
||||
+ return FALSE;
|
||||
+
|
||||
if ((sym->flags & BSF_SECTION_SYM) == 0)
|
||||
return FALSE;
|
||||
|
||||
+ if (sym->section == NULL)
|
||||
+ return TRUE;
|
||||
+
|
||||
type_ptr = elf_symbol_from (abfd, sym);
|
||||
return ((type_ptr != NULL
|
||||
&& type_ptr->internal_elf_sym.st_shndx != 0
|
||||
&& bfd_is_abs_section (sym->section))
|
||||
|| !(sym->section->owner == abfd
|
||||
- || (sym->section->output_section->owner == abfd
|
||||
- && sym->section->output_offset == 0)
|
||||
+ || (sym->section->output_section != NULL
|
||||
+ && sym->section->output_section->owner == abfd
|
||||
+ && sym->section->output_offset == 0)
|
||||
|| bfd_is_abs_section (sym->section)));
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,13 +0,0 @@
|
||||
diff -rup binutils.orig.2/binutils/stabs.c binutils-2.30/binutils/stabs.c
|
||||
--- binutils.orig.2/binutils/stabs.c 2024-10-29 14:21:27.910212960 +0000
|
||||
+++ binutils-2.30/binutils/stabs.c 2024-10-29 14:22:14.304336367 +0000
|
||||
@@ -3364,6 +3363,9 @@ pop_bincl (struct stab_handle *info)
|
||||
return info->main_filename;
|
||||
info->bincl_stack = o->next_stack;
|
||||
|
||||
+ if (o->file >= info->files)
|
||||
+ return info->main_filename;
|
||||
+
|
||||
o->file_types = info->file_types[o->file];
|
||||
|
||||
if (info->bincl_stack == NULL)
|
File diff suppressed because it is too large
Load Diff
@ -1,232 +0,0 @@
|
||||
diff -rup binutils.orig.4/binutils/stabs.c binutils-2.30/binutils/stabs.c
|
||||
--- binutils.orig.4/binutils/stabs.c 2024-10-29 14:31:49.044040165 +0000
|
||||
+++ binutils-2.30/binutils/stabs.c 2024-10-29 14:35:01.106616133 +0000
|
||||
@@ -202,7 +202,7 @@ static debug_type stab_find_type (void *
|
||||
static bfd_boolean stab_record_type
|
||||
(void *, struct stab_handle *, const int *, debug_type);
|
||||
static debug_type stab_xcoff_builtin_type
|
||||
- (void *, struct stab_handle *, int);
|
||||
+ (void *, struct stab_handle *, unsigned int);
|
||||
static debug_type stab_find_tagged_type
|
||||
(void *, struct stab_handle *, const char *, int, enum debug_type_kind);
|
||||
static debug_type *stab_demangle_argtypes
|
||||
@@ -3538,166 +3538,168 @@ stab_record_type (void *dhandle ATTRIBUT
|
||||
|
||||
static debug_type
|
||||
stab_xcoff_builtin_type (void *dhandle, struct stab_handle *info,
|
||||
- int typenum)
|
||||
+ unsigned int typenum)
|
||||
{
|
||||
debug_type rettype;
|
||||
const char *name;
|
||||
|
||||
- if (typenum >= 0 || typenum < -XCOFF_TYPE_COUNT)
|
||||
+ typenum = -typenum - 1;
|
||||
+ if (typenum >= XCOFF_TYPE_COUNT)
|
||||
{
|
||||
- fprintf (stderr, _("Unrecognized XCOFF type %d\n"), typenum);
|
||||
+ fprintf (stderr, _("Unrecognized XCOFF type %d\n"), -typenum - 1);
|
||||
return DEBUG_TYPE_NULL;
|
||||
}
|
||||
- if (info->xcoff_types[-typenum] != NULL)
|
||||
- return info->xcoff_types[-typenum];
|
||||
|
||||
- switch (-typenum)
|
||||
+ if (info->xcoff_types[typenum] != NULL)
|
||||
+ return info->xcoff_types[typenum];
|
||||
+
|
||||
+ switch (typenum)
|
||||
{
|
||||
- case 1:
|
||||
+ case 0:
|
||||
/* The size of this and all the other types are fixed, defined
|
||||
by the debugging format. */
|
||||
name = "int";
|
||||
rettype = debug_make_int_type (dhandle, 4, FALSE);
|
||||
break;
|
||||
- case 2:
|
||||
+ case 1:
|
||||
name = "char";
|
||||
rettype = debug_make_int_type (dhandle, 1, FALSE);
|
||||
break;
|
||||
- case 3:
|
||||
+ case 2:
|
||||
name = "short";
|
||||
rettype = debug_make_int_type (dhandle, 2, FALSE);
|
||||
break;
|
||||
- case 4:
|
||||
+ case 3:
|
||||
name = "long";
|
||||
rettype = debug_make_int_type (dhandle, 4, FALSE);
|
||||
break;
|
||||
- case 5:
|
||||
+ case 4:
|
||||
name = "unsigned char";
|
||||
rettype = debug_make_int_type (dhandle, 1, TRUE);
|
||||
break;
|
||||
- case 6:
|
||||
+ case 5:
|
||||
name = "signed char";
|
||||
rettype = debug_make_int_type (dhandle, 1, FALSE);
|
||||
break;
|
||||
- case 7:
|
||||
+ case 6:
|
||||
name = "unsigned short";
|
||||
rettype = debug_make_int_type (dhandle, 2, TRUE);
|
||||
break;
|
||||
- case 8:
|
||||
+ case 7:
|
||||
name = "unsigned int";
|
||||
rettype = debug_make_int_type (dhandle, 4, TRUE);
|
||||
break;
|
||||
- case 9:
|
||||
+ case 8:
|
||||
name = "unsigned";
|
||||
rettype = debug_make_int_type (dhandle, 4, TRUE);
|
||||
break;
|
||||
- case 10:
|
||||
+ case 9:
|
||||
name = "unsigned long";
|
||||
rettype = debug_make_int_type (dhandle, 4, TRUE);
|
||||
break;
|
||||
- case 11:
|
||||
+ case 10:
|
||||
name = "void";
|
||||
rettype = debug_make_void_type (dhandle);
|
||||
break;
|
||||
- case 12:
|
||||
+ case 11:
|
||||
/* IEEE single precision (32 bit). */
|
||||
name = "float";
|
||||
rettype = debug_make_float_type (dhandle, 4);
|
||||
break;
|
||||
- case 13:
|
||||
+ case 12:
|
||||
/* IEEE double precision (64 bit). */
|
||||
name = "double";
|
||||
rettype = debug_make_float_type (dhandle, 8);
|
||||
break;
|
||||
- case 14:
|
||||
+ case 13:
|
||||
/* This is an IEEE double on the RS/6000, and different machines
|
||||
with different sizes for "long double" should use different
|
||||
negative type numbers. See stabs.texinfo. */
|
||||
name = "long double";
|
||||
rettype = debug_make_float_type (dhandle, 8);
|
||||
break;
|
||||
- case 15:
|
||||
+ case 14:
|
||||
name = "integer";
|
||||
rettype = debug_make_int_type (dhandle, 4, FALSE);
|
||||
break;
|
||||
- case 16:
|
||||
+ case 15:
|
||||
name = "boolean";
|
||||
rettype = debug_make_bool_type (dhandle, 4);
|
||||
break;
|
||||
- case 17:
|
||||
+ case 16:
|
||||
name = "short real";
|
||||
rettype = debug_make_float_type (dhandle, 4);
|
||||
break;
|
||||
- case 18:
|
||||
+ case 17:
|
||||
name = "real";
|
||||
rettype = debug_make_float_type (dhandle, 8);
|
||||
break;
|
||||
- case 19:
|
||||
+ case 18:
|
||||
/* FIXME */
|
||||
name = "stringptr";
|
||||
rettype = NULL;
|
||||
break;
|
||||
- case 20:
|
||||
+ case 19:
|
||||
/* FIXME */
|
||||
name = "character";
|
||||
rettype = debug_make_int_type (dhandle, 1, TRUE);
|
||||
break;
|
||||
- case 21:
|
||||
+ case 20:
|
||||
name = "logical*1";
|
||||
rettype = debug_make_bool_type (dhandle, 1);
|
||||
break;
|
||||
- case 22:
|
||||
+ case 21:
|
||||
name = "logical*2";
|
||||
rettype = debug_make_bool_type (dhandle, 2);
|
||||
break;
|
||||
- case 23:
|
||||
+ case 22:
|
||||
name = "logical*4";
|
||||
rettype = debug_make_bool_type (dhandle, 4);
|
||||
break;
|
||||
- case 24:
|
||||
+ case 23:
|
||||
name = "logical";
|
||||
rettype = debug_make_bool_type (dhandle, 4);
|
||||
break;
|
||||
- case 25:
|
||||
+ case 24:
|
||||
/* Complex type consisting of two IEEE single precision values. */
|
||||
name = "complex";
|
||||
rettype = debug_make_complex_type (dhandle, 8);
|
||||
break;
|
||||
- case 26:
|
||||
+ case 25:
|
||||
/* Complex type consisting of two IEEE double precision values. */
|
||||
name = "double complex";
|
||||
rettype = debug_make_complex_type (dhandle, 16);
|
||||
break;
|
||||
- case 27:
|
||||
+ case 26:
|
||||
name = "integer*1";
|
||||
rettype = debug_make_int_type (dhandle, 1, FALSE);
|
||||
break;
|
||||
- case 28:
|
||||
+ case 27:
|
||||
name = "integer*2";
|
||||
rettype = debug_make_int_type (dhandle, 2, FALSE);
|
||||
break;
|
||||
- case 29:
|
||||
+ case 28:
|
||||
name = "integer*4";
|
||||
rettype = debug_make_int_type (dhandle, 4, FALSE);
|
||||
break;
|
||||
- case 30:
|
||||
+ case 29:
|
||||
/* FIXME */
|
||||
name = "wchar";
|
||||
rettype = debug_make_int_type (dhandle, 2, FALSE);
|
||||
break;
|
||||
- case 31:
|
||||
+ case 30:
|
||||
name = "long long";
|
||||
rettype = debug_make_int_type (dhandle, 8, FALSE);
|
||||
break;
|
||||
- case 32:
|
||||
+ case 31:
|
||||
name = "unsigned long long";
|
||||
rettype = debug_make_int_type (dhandle, 8, TRUE);
|
||||
break;
|
||||
- case 33:
|
||||
+ case 32:
|
||||
name = "logical*8";
|
||||
rettype = debug_make_bool_type (dhandle, 8);
|
||||
break;
|
||||
- case 34:
|
||||
+ case 33:
|
||||
name = "integer*8";
|
||||
rettype = debug_make_int_type (dhandle, 8, FALSE);
|
||||
break;
|
||||
@@ -3706,9 +3708,7 @@ stab_xcoff_builtin_type (void *dhandle,
|
||||
}
|
||||
|
||||
rettype = debug_name_type (dhandle, name, rettype);
|
||||
-
|
||||
- info->xcoff_types[-typenum] = rettype;
|
||||
-
|
||||
+ info->xcoff_types[typenum] = rettype;
|
||||
return rettype;
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
# Commit 481153777e278b71e694fd2db6b897f7a9e3dcb8 fixing PR 28862
|
||||
#
|
||||
# From: Alan Modra <amodra@gmail.com>
|
||||
#
|
||||
# I have no info on the format of a "SUNPRO C++ Namespace" stab, so am
|
||||
# relying on the previous code being correct in parsing these stabs.
|
||||
# Just don't allow NULs anywhere in the stab.
|
||||
#
|
||||
# PR 28862
|
||||
# * stabs.c (parse_stab_string): Don't overrun buffer when parsing
|
||||
# 'Y' stab.
|
||||
--- binutils.orig/binutils/stabs.c 2024-11-06 17:39:57.460250962 +0000
|
||||
+++ binutils-2.30/binutils/stabs.c 2024-11-06 17:41:32.293848603 +0000
|
||||
@@ -1138,15 +1138,13 @@ parse_stab_string (void *dhandle, struct
|
||||
case 'Y':
|
||||
/* SUNPro C++ Namespace =Yn0. */
|
||||
/* Skip the namespace mapping, as it is not used now. */
|
||||
- if (*(++p) == 'n' && *(++p) == '0')
|
||||
+ if (*p++ != 0 && *p++ == 'n' && *p++ == '0')
|
||||
{
|
||||
/* =Yn0name; */
|
||||
- while (*p != ';')
|
||||
+ while (*p && *p != ';')
|
||||
++p;
|
||||
- ++p;
|
||||
- /* There is a potential resource leak here, but it is not important. */
|
||||
- /* coverity[leaked_storage: FALSE] */
|
||||
- return TRUE;
|
||||
+ if (*p)
|
||||
+ return TRUE;
|
||||
}
|
||||
/* TODO SUNPro C++ support:
|
||||
Support default arguments after F,P parameters
|
@ -1,158 +0,0 @@
|
||||
# This is a merge of four commits to fix a stack overflow bug:
|
||||
#
|
||||
# From af4004d1da135610ab931e04a3ba2c9124defbd7 Mon Sep 17 00:00:00 2001
|
||||
# From: Nick Clifton <nickc@redhat.com>
|
||||
# Date: Thu, 6 Jan 2022 16:37:26 +0000
|
||||
# Subject: [PATCH] Fix a stack exhaustion bug parsing malicious STABS format
|
||||
# debug information.
|
||||
#
|
||||
# PR 28718
|
||||
# * debug.c (debug_write_type): Allow for malicious recursion via
|
||||
# indirect debug types.
|
||||
#
|
||||
# From 0e9f1c04b9572920c7f940203a67d5af3f6c19f6 Mon Sep 17 00:00:00 2001
|
||||
# From: Pavel Mayorov <pmayorov@cloudlinux.com>
|
||||
# Date: Fri, 7 Jan 2022 12:34:37 +0000
|
||||
# Subject: [PATCH] Revert previous delta to debug.c. Replace with patch to
|
||||
# reject indirect types that point to indirect types.
|
||||
#
|
||||
# PR 28718
|
||||
# * dwarf.c: Revert previous delta.
|
||||
# (debug_get_real_type): Reject indirect types that point to
|
||||
# indirect types.
|
||||
# (debug_get_type_name, debug_get_type_size, debug_write_type):
|
||||
# Likewise.
|
||||
#
|
||||
# From 55a75aae9d971d3d0f49884e3954ac4794559542 Mon Sep 17 00:00:00 2001
|
||||
# From: Alan Modra <amodra@gmail.com>
|
||||
# Date: Tue, 9 May 2023 17:11:46 +0930
|
||||
# Subject: [PATCH] stack overflow in debug_write_type
|
||||
#
|
||||
# Another fuzzer attack. This one was a "set" with elements using an
|
||||
# indirect type pointing back at the set. The existing recursion check
|
||||
# only prevented simple recursion.
|
||||
#
|
||||
# * debug.c (struct debug_type_s): Add mark.
|
||||
# (debug_write_type): Set mark and check before recursing into
|
||||
# indirect types.
|
||||
#
|
||||
# From 6109320673fe30163b5d00d9e3a7f4e77befb22a Mon Sep 17 00:00:00 2001
|
||||
# From: Alan Modra <amodra@gmail.com>
|
||||
# Date: Wed, 10 May 2023 23:05:00 +0930
|
||||
# Subject: [PATCH] Re: stack overflow in debug_write_type
|
||||
#
|
||||
# Apparently u.kindirect->slot can point at a NULL.
|
||||
#
|
||||
# * debug.c (debug_write_type): Don't segfault on NULL indirect.
|
||||
|
||||
--- binutils.orig/binutils/debug.c 2024-11-06 17:39:57.452250912 +0000
|
||||
+++ binutils-2.30/binutils/debug.c 2024-11-06 17:44:37.951018606 +0000
|
||||
@@ -2483,8 +2483,22 @@ debug_write_type (struct debug_handle *i
|
||||
case DEBUG_KIND_INDIRECT:
|
||||
if (*type->u.kindirect->slot == DEBUG_TYPE_NULL)
|
||||
return (*fns->empty_type) (fhandle);
|
||||
- return debug_write_type (info, fns, fhandle, *type->u.kindirect->slot,
|
||||
- name);
|
||||
+ /* PR 28718: Allow for malicious recursion. */
|
||||
+ {
|
||||
+ static int recursion_depth = 0;
|
||||
+ bfd_boolean result;
|
||||
+
|
||||
+ if (recursion_depth > 256)
|
||||
+ {
|
||||
+ debug_error (_("debug_write_type: too many levels of nested indirection"));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ ++ recursion_depth;
|
||||
+ result = debug_write_type (info, fns, fhandle, *type->u.kindirect->slot,
|
||||
+ name);
|
||||
+ -- recursion_depth;
|
||||
+ return result;
|
||||
+ }
|
||||
case DEBUG_KIND_VOID:
|
||||
return (*fns->void_type) (fhandle);
|
||||
case DEBUG_KIND_INT:
|
||||
--- binutils.orig/binutils/debug.c 2024-11-07 12:05:27.049161875 +0000
|
||||
+++ binutils-2.30/binutils/debug.c 2024-11-07 12:25:03.616783102 +0000
|
||||
@@ -102,6 +102,8 @@ struct debug_type_s
|
||||
enum debug_type_kind kind;
|
||||
/* Size of type (0 if not known). */
|
||||
unsigned int size;
|
||||
+ /* Used by debug_write to stop DEBUG_KIND_INDIRECT infinite recursion. */
|
||||
+ unsigned int mark;
|
||||
/* Type which is a pointer to this type. */
|
||||
debug_type pointer;
|
||||
/* Tagged union with additional information about the type. */
|
||||
@@ -2065,7 +2067,9 @@ debug_get_real_type (void *handle, debug
|
||||
/* The default case is just here to avoid warnings. */
|
||||
default:
|
||||
case DEBUG_KIND_INDIRECT:
|
||||
- if (*type->u.kindirect->slot != NULL)
|
||||
+ /* A valid non-self-referencing indirect type. */
|
||||
+ if (*type->u.kindirect->slot != NULL
|
||||
+ && *type->u.kindirect->slot != type)
|
||||
return debug_get_real_type (handle, *type->u.kindirect->slot, &rl);
|
||||
return type;
|
||||
case DEBUG_KIND_NAMED:
|
||||
@@ -2095,7 +2099,9 @@ debug_get_type_name (void *handle, debug
|
||||
{
|
||||
if (type->kind == DEBUG_KIND_INDIRECT)
|
||||
{
|
||||
- if (*type->u.kindirect->slot != NULL)
|
||||
+ /* A valid non-self-referencing indirect type. */
|
||||
+ if (*type->u.kindirect->slot != NULL
|
||||
+ && *type->u.kindirect->slot != type)
|
||||
return debug_get_type_name (handle, *type->u.kindirect->slot);
|
||||
return type->u.kindirect->tag;
|
||||
}
|
||||
@@ -2124,7 +2130,9 @@ debug_get_type_size (void *handle, debug
|
||||
default:
|
||||
return 0;
|
||||
case DEBUG_KIND_INDIRECT:
|
||||
- if (*type->u.kindirect->slot != NULL)
|
||||
+ /* A valid non-self-referencing indirect type. */
|
||||
+ if (*type->u.kindirect->slot != NULL
|
||||
+ && *type->u.kindirect->slot != type)
|
||||
return debug_get_type_size (handle, *type->u.kindirect->slot);
|
||||
return 0;
|
||||
case DEBUG_KIND_NAMED:
|
||||
@@ -2419,6 +2427,9 @@ debug_write_type (struct debug_handle *i
|
||||
int is;
|
||||
const char *tag = NULL;
|
||||
|
||||
+ /* Mark the type so that we don't define a type in terms of itself. */
|
||||
+ type->mark = info->mark;
|
||||
+
|
||||
/* If we have a name for this type, just output it. We only output
|
||||
typedef names after they have been defined. We output type tags
|
||||
whenever we are not actually defining them. */
|
||||
@@ -2481,24 +2492,12 @@ debug_write_type (struct debug_handle *i
|
||||
debug_error (_("debug_write_type: illegal type encountered"));
|
||||
return FALSE;
|
||||
case DEBUG_KIND_INDIRECT:
|
||||
- if (*type->u.kindirect->slot == DEBUG_TYPE_NULL)
|
||||
+ /* Prevent infinite recursion. */
|
||||
+ if (*type->u.kindirect->slot != DEBUG_TYPE_NULL
|
||||
+ && (*type->u.kindirect->slot)->mark == info->mark)
|
||||
return (*fns->empty_type) (fhandle);
|
||||
- /* PR 28718: Allow for malicious recursion. */
|
||||
- {
|
||||
- static int recursion_depth = 0;
|
||||
- bfd_boolean result;
|
||||
-
|
||||
- if (recursion_depth > 256)
|
||||
- {
|
||||
- debug_error (_("debug_write_type: too many levels of nested indirection"));
|
||||
- return FALSE;
|
||||
- }
|
||||
- ++ recursion_depth;
|
||||
- result = debug_write_type (info, fns, fhandle, *type->u.kindirect->slot,
|
||||
- name);
|
||||
- -- recursion_depth;
|
||||
- return result;
|
||||
- }
|
||||
+ return debug_write_type (info, fns, fhandle, *type->u.kindirect->slot,
|
||||
+ name);
|
||||
case DEBUG_KIND_VOID:
|
||||
return (*fns->void_type) (fhandle);
|
||||
case DEBUG_KIND_INT:
|
@ -1,101 +0,0 @@
|
||||
diff -rup binutils.orig/bfd/dwarf2.c binutils-2.30/bfd/dwarf2.c
|
||||
--- binutils.orig/bfd/dwarf2.c 2018-09-26 15:07:47.162863937 +0100
|
||||
+++ binutils-2.30/bfd/dwarf2.c 2018-09-26 15:08:50.868368183 +0100
|
||||
@@ -527,6 +527,7 @@ read_section (bfd * abfd,
|
||||
asection *msec;
|
||||
const char *section_name = sec->uncompressed_name;
|
||||
bfd_byte *contents = *section_buffer;
|
||||
+ bfd_size_type amt;
|
||||
|
||||
/* The section may have already been read. */
|
||||
if (contents == NULL)
|
||||
@@ -549,7 +550,14 @@ read_section (bfd * abfd,
|
||||
*section_size = msec->rawsize ? msec->rawsize : msec->size;
|
||||
/* Paranoia - alloc one extra so that we can make sure a string
|
||||
section is NUL terminated. */
|
||||
- contents = (bfd_byte *) bfd_malloc (*section_size + 1);
|
||||
+ amt = *section_size + 1;
|
||||
+ if (amt == 0)
|
||||
+ {
|
||||
+ bfd_set_error (bfd_error_no_memory);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ contents = (bfd_byte *) bfd_malloc (amt);
|
||||
+
|
||||
if (contents == NULL)
|
||||
return FALSE;
|
||||
if (syms
|
||||
diff -rup binutils.orig/bfd/syms.c binutils-2.30/bfd/syms.c
|
||||
--- binutils.orig/bfd/syms.c 2018-09-26 15:07:47.162863937 +0100
|
||||
+++ binutils-2.30/bfd/syms.c 2018-09-26 15:11:41.671038993 +0100
|
||||
@@ -1035,6 +1035,10 @@ _bfd_stab_section_find_nearest_line (bfd
|
||||
0, strsize))
|
||||
return FALSE;
|
||||
|
||||
+ /* Stab strings ought to be nul terminated. Ensure the last one
|
||||
+ is, to prevent running off the end of the buffer. */
|
||||
+ info->strs[strsize - 1] = 0;
|
||||
+
|
||||
/* If this is a relocatable object file, we have to relocate
|
||||
the entries in .stab. This should always be simple 32 bit
|
||||
relocations against symbols defined in this object file, so
|
||||
@@ -1073,7 +1077,8 @@ _bfd_stab_section_find_nearest_line (bfd
|
||||
|| r->howto->bitsize != 32
|
||||
|| r->howto->pc_relative
|
||||
|| r->howto->bitpos != 0
|
||||
- || r->howto->dst_mask != 0xffffffff)
|
||||
+ || r->howto->dst_mask != 0xffffffff
|
||||
+ || r->address * bfd_octets_per_byte (abfd) + 4 > stabsize)
|
||||
{
|
||||
_bfd_error_handler
|
||||
(_("Unsupported .stab relocation"));
|
||||
@@ -1195,7 +1200,8 @@ _bfd_stab_section_find_nearest_line (bfd
|
||||
{
|
||||
nul_fun = stab;
|
||||
nul_str = str;
|
||||
- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
|
||||
+ if (file_name >= (char *) info->strs + strsize
|
||||
+ || file_name < (char *) str)
|
||||
file_name = NULL;
|
||||
if (stab + STABSIZE + TYPEOFF < info->stabs + stabsize
|
||||
&& *(stab + STABSIZE + TYPEOFF) == (bfd_byte) N_SO)
|
||||
@@ -1206,7 +1212,8 @@ _bfd_stab_section_find_nearest_line (bfd
|
||||
directory_name = file_name;
|
||||
file_name = ((char *) str
|
||||
+ bfd_get_32 (abfd, stab + STRDXOFF));
|
||||
- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
|
||||
+ if (file_name >= (char *) info->strs + strsize
|
||||
+ || file_name < (char *) str)
|
||||
file_name = NULL;
|
||||
}
|
||||
}
|
||||
@@ -1217,7 +1224,8 @@ _bfd_stab_section_find_nearest_line (bfd
|
||||
file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
|
||||
/* PR 17512: file: 0c680a1f. */
|
||||
/* PR 17512: file: 5da8aec4. */
|
||||
- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
|
||||
+ if (file_name >= (char *) info->strs + strsize
|
||||
+ || file_name < (char *) str)
|
||||
file_name = NULL;
|
||||
break;
|
||||
|
||||
@@ -1226,7 +1234,8 @@ _bfd_stab_section_find_nearest_line (bfd
|
||||
function_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
|
||||
if (function_name == (char *) str)
|
||||
continue;
|
||||
- if (function_name >= (char *) info->strs + strsize)
|
||||
+ if (function_name >= (char *) info->strs + strsize
|
||||
+ || function_name < (char *) str)
|
||||
function_name = NULL;
|
||||
|
||||
nul_fun = NULL;
|
||||
@@ -1335,7 +1344,8 @@ _bfd_stab_section_find_nearest_line (bfd
|
||||
if (val <= offset)
|
||||
{
|
||||
file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
|
||||
- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
|
||||
+ if (file_name >= (char *) info->strs + strsize
|
||||
+ || file_name < (char *) str)
|
||||
file_name = NULL;
|
||||
*pline = 0;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
--- binutils.orig/bfd/elfcode.h 2018-05-01 11:42:03.250424443 +0100
|
||||
+++ binutils-2.30/bfd/elfcode.h 2018-05-01 12:41:00.745780026 +0100
|
||||
@@ -680,7 +680,7 @@ elf_object_p (bfd *abfd)
|
||||
if (i_ehdrp->e_shnum > ((bfd_size_type) -1) / sizeof (*i_shdrp))
|
||||
goto got_wrong_format_error;
|
||||
#endif
|
||||
- amt = sizeof (*i_shdrp) * i_ehdrp->e_shnum;
|
||||
+ amt = sizeof (*i_shdrp) * (bfd_size_type) i_ehdrp->e_shnum;
|
||||
i_shdrp = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt);
|
||||
if (!i_shdrp)
|
||||
goto got_no_match;
|
||||
@@ -776,7 +776,7 @@ elf_object_p (bfd *abfd)
|
||||
if (i_ehdrp->e_phnum > ((bfd_size_type) -1) / sizeof (*i_phdr))
|
||||
goto got_wrong_format_error;
|
||||
#endif
|
||||
- amt = i_ehdrp->e_phnum * sizeof (*i_phdr);
|
||||
+ amt = (bfd_size_type) i_ehdrp->e_phnum * sizeof (*i_phdr);
|
||||
elf_tdata (abfd)->phdr = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->phdr == NULL)
|
||||
goto got_no_match;
|
@ -1,69 +0,0 @@
|
||||
--- binutils.orig/bfd/opncls.c 2018-05-01 11:42:03.266424248 +0100
|
||||
+++ binutils-2.30/bfd/opncls.c 2018-05-01 12:52:36.792579838 +0100
|
||||
@@ -1179,6 +1179,7 @@ bfd_get_debug_link_info_1 (bfd *abfd, vo
|
||||
bfd_byte *contents;
|
||||
unsigned int crc_offset;
|
||||
char *name;
|
||||
+ bfd_size_type size;
|
||||
|
||||
BFD_ASSERT (abfd);
|
||||
BFD_ASSERT (crc32_out);
|
||||
@@ -1188,6 +1189,12 @@ bfd_get_debug_link_info_1 (bfd *abfd, vo
|
||||
if (sect == NULL)
|
||||
return NULL;
|
||||
|
||||
+ size = bfd_get_section_size (sect);
|
||||
+
|
||||
+ /* PR 22794: Make sure that the section has a reasonable size. */
|
||||
+ if (size < 8 || size >= bfd_get_size (abfd))
|
||||
+ return NULL;
|
||||
+
|
||||
if (!bfd_malloc_and_get_section (abfd, sect, &contents))
|
||||
{
|
||||
if (contents != NULL)
|
||||
@@ -1198,9 +1205,9 @@ bfd_get_debug_link_info_1 (bfd *abfd, vo
|
||||
/* CRC value is stored after the filename, aligned up to 4 bytes. */
|
||||
name = (char *) contents;
|
||||
/* PR 17597: avoid reading off the end of the buffer. */
|
||||
- crc_offset = strnlen (name, bfd_get_section_size (sect)) + 1;
|
||||
+ crc_offset = strnlen (name, size) + 1;
|
||||
crc_offset = (crc_offset + 3) & ~3;
|
||||
- if (crc_offset + 4 > bfd_get_section_size (sect))
|
||||
+ if (crc_offset + 4 > size)
|
||||
return NULL;
|
||||
|
||||
*crc32 = bfd_get_32 (abfd, contents + crc_offset);
|
||||
@@ -1261,6 +1268,7 @@ bfd_get_alt_debug_link_info (bfd * abfd,
|
||||
bfd_byte *contents;
|
||||
unsigned int buildid_offset;
|
||||
char *name;
|
||||
+ bfd_size_type size;
|
||||
|
||||
BFD_ASSERT (abfd);
|
||||
BFD_ASSERT (buildid_len);
|
||||
@@ -1271,6 +1279,10 @@ bfd_get_alt_debug_link_info (bfd * abfd,
|
||||
if (sect == NULL)
|
||||
return NULL;
|
||||
|
||||
+ size = bfd_get_section_size (sect);
|
||||
+ if (size < 8 || size >= bfd_get_size (abfd))
|
||||
+ return NULL;
|
||||
+
|
||||
if (!bfd_malloc_and_get_section (abfd, sect, & contents))
|
||||
{
|
||||
if (contents != NULL)
|
||||
@@ -1280,11 +1292,11 @@ bfd_get_alt_debug_link_info (bfd * abfd,
|
||||
|
||||
/* BuildID value is stored after the filename. */
|
||||
name = (char *) contents;
|
||||
- buildid_offset = strnlen (name, bfd_get_section_size (sect)) + 1;
|
||||
- if (buildid_offset >= bfd_get_section_size (sect))
|
||||
+ buildid_offset = strnlen (name, size) + 1;
|
||||
+ if (buildid_offset >= size)
|
||||
return NULL;
|
||||
|
||||
- *buildid_len = bfd_get_section_size (sect) - buildid_offset;
|
||||
+ *buildid_len = size - buildid_offset;
|
||||
*buildid_out = bfd_malloc (*buildid_len);
|
||||
memcpy (*buildid_out, contents + buildid_offset, *buildid_len);
|
||||
|
@ -1,12 +0,0 @@
|
||||
--- binutils.orig/bfd/coffgen.c 2018-04-27 09:23:33.449859052 +0100
|
||||
+++ binutils-2.30/bfd/coffgen.c 2018-04-27 09:34:34.530135122 +0100
|
||||
@@ -1555,7 +1555,8 @@ coff_pointerize_aux (bfd *abfd,
|
||||
}
|
||||
/* A negative tagndx is meaningless, but the SCO 3.2v4 cc can
|
||||
generate one, so we must be careful to ignore it. */
|
||||
- if (auxent->u.auxent.x_sym.x_tagndx.l > 0)
|
||||
+ if ((unsigned long) auxent->u.auxent.x_sym.x_tagndx.l
|
||||
+ < obj_raw_syment_count (abfd))
|
||||
{
|
||||
auxent->u.auxent.x_sym.x_tagndx.p =
|
||||
table_base + auxent->u.auxent.x_sym.x_tagndx.l;
|
@ -1,37 +0,0 @@
|
||||
--- binutils.orig/bfd/dwarf1.c 2018-05-01 13:04:35.060041875 +0100
|
||||
+++ binutils-2.30/bfd/dwarf1.c 2018-05-01 13:24:17.943833855 +0100
|
||||
@@ -213,6 +213,7 @@ parse_die (bfd * abfd,
|
||||
/* Then the attributes. */
|
||||
while (xptr + 2 <= aDiePtrEnd)
|
||||
{
|
||||
+ unsigned int block_len;
|
||||
unsigned short attr;
|
||||
|
||||
/* Parse the attribute based on its form. This section
|
||||
@@ -255,12 +256,24 @@ parse_die (bfd * abfd,
|
||||
break;
|
||||
case FORM_BLOCK2:
|
||||
if (xptr + 2 <= aDiePtrEnd)
|
||||
- xptr += bfd_get_16 (abfd, xptr);
|
||||
+ {
|
||||
+ block_len = bfd_get_16 (abfd, xptr);
|
||||
+ if (xptr + block_len > aDiePtrEnd
|
||||
+ || xptr + block_len < xptr)
|
||||
+ return FALSE;
|
||||
+ xptr += block_len;
|
||||
+ }
|
||||
xptr += 2;
|
||||
break;
|
||||
case FORM_BLOCK4:
|
||||
if (xptr + 4 <= aDiePtrEnd)
|
||||
- xptr += bfd_get_32 (abfd, xptr);
|
||||
+ {
|
||||
+ block_len = bfd_get_32 (abfd, xptr);
|
||||
+ if (xptr + block_len > aDiePtrEnd
|
||||
+ || xptr + block_len < xptr)
|
||||
+ return FALSE;
|
||||
+ xptr += block_len;
|
||||
+ }
|
||||
xptr += 4;
|
||||
break;
|
||||
case FORM_STRING:
|
@ -1,75 +0,0 @@
|
||||
--- binutils.orig/bfd/dwarf2.c 2018-05-01 13:04:35.055041935 +0100
|
||||
+++ binutils-2.30/bfd/dwarf2.c 2018-05-01 13:31:32.882624448 +0100
|
||||
@@ -622,14 +622,24 @@ read_8_bytes (bfd *abfd, bfd_byte *buf,
|
||||
}
|
||||
|
||||
static bfd_byte *
|
||||
-read_n_bytes (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
- bfd_byte *buf,
|
||||
- bfd_byte *end,
|
||||
- unsigned int size ATTRIBUTE_UNUSED)
|
||||
-{
|
||||
- if (buf + size > end)
|
||||
- return NULL;
|
||||
- return buf;
|
||||
+read_n_bytes (bfd_byte * buf,
|
||||
+ bfd_byte * end,
|
||||
+ struct dwarf_block * block)
|
||||
+{
|
||||
+ unsigned int size = block->size;
|
||||
+ bfd_byte * block_end = buf + size;
|
||||
+
|
||||
+ if (block_end > end || block_end < buf)
|
||||
+ {
|
||||
+ block->data = NULL;
|
||||
+ block->size = 0;
|
||||
+ return end;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ block->data = buf;
|
||||
+ return block_end;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Scans a NUL terminated string starting at BUF, returning a pointer to it.
|
||||
@@ -1127,8 +1137,7 @@ read_attribute_value (struct attribute *
|
||||
return NULL;
|
||||
blk->size = read_2_bytes (abfd, info_ptr, info_ptr_end);
|
||||
info_ptr += 2;
|
||||
- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size);
|
||||
- info_ptr += blk->size;
|
||||
+ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk);
|
||||
attr->u.blk = blk;
|
||||
break;
|
||||
case DW_FORM_block4:
|
||||
@@ -1138,8 +1147,7 @@ read_attribute_value (struct attribute *
|
||||
return NULL;
|
||||
blk->size = read_4_bytes (abfd, info_ptr, info_ptr_end);
|
||||
info_ptr += 4;
|
||||
- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size);
|
||||
- info_ptr += blk->size;
|
||||
+ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk);
|
||||
attr->u.blk = blk;
|
||||
break;
|
||||
case DW_FORM_data2:
|
||||
@@ -1179,8 +1187,7 @@ read_attribute_value (struct attribute *
|
||||
blk->size = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read,
|
||||
FALSE, info_ptr_end);
|
||||
info_ptr += bytes_read;
|
||||
- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size);
|
||||
- info_ptr += blk->size;
|
||||
+ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk);
|
||||
attr->u.blk = blk;
|
||||
break;
|
||||
case DW_FORM_block1:
|
||||
@@ -1190,8 +1197,7 @@ read_attribute_value (struct attribute *
|
||||
return NULL;
|
||||
blk->size = read_1_byte (abfd, info_ptr, info_ptr_end);
|
||||
info_ptr += 1;
|
||||
- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size);
|
||||
- info_ptr += blk->size;
|
||||
+ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk);
|
||||
attr->u.blk = blk;
|
||||
break;
|
||||
case DW_FORM_data1:
|
@ -1,156 +0,0 @@
|
||||
--- binutils.orig/bfd/elf.c 2018-05-01 11:42:03.151425659 +0100
|
||||
+++ binutils-2.30/bfd/elf.c 2018-05-01 12:30:42.129206856 +0100
|
||||
@@ -5713,6 +5713,9 @@ assign_file_positions_for_load_sections
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+#define IS_TBSS(s) \
|
||||
+ ((s->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) == SEC_THREAD_LOCAL)
|
||||
+
|
||||
/* Assign file positions for the other sections. */
|
||||
|
||||
static bfd_boolean
|
||||
@@ -5862,65 +5865,100 @@ assign_file_positions_for_non_load_secti
|
||||
{
|
||||
if (p->p_type == PT_GNU_RELRO)
|
||||
{
|
||||
- const Elf_Internal_Phdr *lp;
|
||||
- struct elf_segment_map *lm;
|
||||
+ bfd_vma start, end;
|
||||
+ bfd_boolean ok;
|
||||
|
||||
if (link_info != NULL)
|
||||
{
|
||||
/* During linking the range of the RELRO segment is passed
|
||||
- in link_info. */
|
||||
+ in link_info. Note that there may be padding between
|
||||
+ relro_start and the first RELRO section. */
|
||||
+ start = link_info->relro_start;
|
||||
+ end = link_info->relro_end;
|
||||
+ }
|
||||
+ else if (m->count != 0)
|
||||
+ {
|
||||
+ if (!m->p_size_valid)
|
||||
+ abort ();
|
||||
+ start = m->sections[0]->vma;
|
||||
+ end = start + m->p_size;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ start = 0;
|
||||
+ end = 0;
|
||||
+ }
|
||||
+
|
||||
+ ok = FALSE;
|
||||
+ if (start < end)
|
||||
+ {
|
||||
+ struct elf_segment_map *lm;
|
||||
+ const Elf_Internal_Phdr *lp;
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ /* Find a LOAD segment containing a section in the RELRO
|
||||
+ segment. */
|
||||
for (lm = elf_seg_map (abfd), lp = phdrs;
|
||||
lm != NULL;
|
||||
lm = lm->next, lp++)
|
||||
{
|
||||
if (lp->p_type == PT_LOAD
|
||||
- && lp->p_vaddr < link_info->relro_end
|
||||
&& lm->count != 0
|
||||
- && lm->sections[0]->vma >= link_info->relro_start)
|
||||
+ && (lm->sections[lm->count - 1]->vma
|
||||
+ + (!IS_TBSS (lm->sections[lm->count - 1])
|
||||
+ ? lm->sections[lm->count - 1]->size
|
||||
+ : 0)) > start
|
||||
+ && lm->sections[0]->vma < end)
|
||||
break;
|
||||
}
|
||||
|
||||
- BFD_ASSERT (lm != NULL);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- /* Otherwise we are copying an executable or shared
|
||||
- library, but we need to use the same linker logic. */
|
||||
- for (lp = phdrs; lp < phdrs + count; ++lp)
|
||||
+ if (lm != NULL)
|
||||
{
|
||||
- if (lp->p_type == PT_LOAD
|
||||
- && lp->p_paddr == p->p_paddr)
|
||||
- break;
|
||||
+ /* Find the section starting the RELRO segment. */
|
||||
+ for (i = 0; i < lm->count; i++)
|
||||
+ {
|
||||
+ asection *s = lm->sections[i];
|
||||
+ if (s->vma >= start
|
||||
+ && s->vma < end
|
||||
+ && s->size != 0)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (i < lm->count)
|
||||
+ {
|
||||
+ p->p_vaddr = lm->sections[i]->vma;
|
||||
+ p->p_paddr = lm->sections[i]->lma;
|
||||
+ p->p_offset = lm->sections[i]->filepos;
|
||||
+ p->p_memsz = end - p->p_vaddr;
|
||||
+ p->p_filesz = p->p_memsz;
|
||||
+
|
||||
+ /* The RELRO segment typically ends a few bytes
|
||||
+ into .got.plt but other layouts are possible.
|
||||
+ In cases where the end does not match any
|
||||
+ loaded section (for instance is in file
|
||||
+ padding), trim p_filesz back to correspond to
|
||||
+ the end of loaded section contents. */
|
||||
+ if (p->p_filesz > lp->p_vaddr + lp->p_filesz - p->p_vaddr)
|
||||
+ p->p_filesz = lp->p_vaddr + lp->p_filesz - p->p_vaddr;
|
||||
+
|
||||
+ /* Preserve the alignment and flags if they are
|
||||
+ valid. The gold linker generates RW/4 for
|
||||
+ the PT_GNU_RELRO section. It is better for
|
||||
+ objcopy/strip to honor these attributes
|
||||
+ otherwise gdb will choke when using separate
|
||||
+ debug files. */
|
||||
+ if (!m->p_align_valid)
|
||||
+ p->p_align = 1;
|
||||
+ if (!m->p_flags_valid)
|
||||
+ p->p_flags = PF_R;
|
||||
+ ok = TRUE;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
-
|
||||
- if (lp < phdrs + count)
|
||||
- {
|
||||
- p->p_vaddr = lp->p_vaddr;
|
||||
- p->p_paddr = lp->p_paddr;
|
||||
- p->p_offset = lp->p_offset;
|
||||
- if (link_info != NULL)
|
||||
- p->p_filesz = link_info->relro_end - lp->p_vaddr;
|
||||
- else if (m->p_size_valid)
|
||||
- p->p_filesz = m->p_size;
|
||||
- else
|
||||
- abort ();
|
||||
- p->p_memsz = p->p_filesz;
|
||||
- /* Preserve the alignment and flags if they are valid. The
|
||||
- gold linker generates RW/4 for the PT_GNU_RELRO section.
|
||||
- It is better for objcopy/strip to honor these attributes
|
||||
- otherwise gdb will choke when using separate debug files.
|
||||
- */
|
||||
- if (!m->p_align_valid)
|
||||
- p->p_align = 1;
|
||||
- if (!m->p_flags_valid)
|
||||
- p->p_flags = PF_R;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- memset (p, 0, sizeof *p);
|
||||
- p->p_type = PT_NULL;
|
||||
- }
|
||||
+ if (link_info != NULL)
|
||||
+ BFD_ASSERT (ok);
|
||||
+ if (!ok)
|
||||
+ memset (p, 0, sizeof *p);
|
||||
}
|
||||
else if (p->p_type == PT_GNU_STACK)
|
||||
{
|
@ -1,17 +0,0 @@
|
||||
--- binutils.orig/bfd/aoutx.h 2018-04-26 15:14:18.411450291 +0100
|
||||
+++ binutils-2.30/bfd/aoutx.h 2018-04-26 17:22:38.328770529 +0100
|
||||
@@ -2283,10 +2283,12 @@ NAME (aout, swap_std_reloc_in) (bfd *abf
|
||||
if (r_baserel)
|
||||
r_extern = 1;
|
||||
|
||||
- if (r_extern && r_index > symcount)
|
||||
+ if (r_extern && r_index >= symcount)
|
||||
{
|
||||
/* We could arrange to return an error, but it might be useful
|
||||
- to see the file even if it is bad. */
|
||||
+ to see the file even if it is bad. FIXME: Of course this
|
||||
+ means that objdump -r *doesn't* see the actual reloc, and
|
||||
+ objcopy silently writes a different reloc. */
|
||||
r_extern = 0;
|
||||
r_index = N_ABS;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
--- binutils.orig/binutils/dwarf.c 2018-04-27 09:22:07.402864408 +0100
|
||||
+++ binutils-2.30/binutils/dwarf.c 2018-04-27 09:24:26.794235786 +0100
|
||||
@@ -6810,6 +6810,13 @@ display_debug_ranges (struct dwarf_secti
|
||||
continue;
|
||||
}
|
||||
|
||||
+ if (next < section_begin || next >= finish)
|
||||
+ {
|
||||
+ warn (_("Corrupt offset (%#8.8lx) in range entry %u\n"),
|
||||
+ (unsigned long) offset, i);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
if (dwarf_check != 0 && i > 0)
|
||||
{
|
||||
if (start < next)
|
@ -1,29 +0,0 @@
|
||||
diff -rup binutils.orig/bfd/elf-attrs.c binutils-2.30/bfd/elf-attrs.c
|
||||
--- binutils.orig/bfd/elf-attrs.c 2018-05-17 14:14:04.341805666 +0100
|
||||
+++ binutils-2.30/bfd/elf-attrs.c 2018-05-17 14:15:19.729952453 +0100
|
||||
@@ -438,6 +438,14 @@ _bfd_elf_parse_attributes (bfd *abfd, El
|
||||
/* PR 17512: file: 2844a11d. */
|
||||
if (hdr->sh_size == 0)
|
||||
return;
|
||||
+ if (hdr->sh_size > bfd_get_file_size (abfd))
|
||||
+ {
|
||||
+ _bfd_error_handler (_("%pB: error: attribute section '%pA' too big: %#llx"),
|
||||
+ abfd, hdr->bfd_section, (long long) hdr->sh_size);
|
||||
+ bfd_set_error (bfd_error_invalid_operation);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
contents = (bfd_byte *) bfd_malloc (hdr->sh_size + 1);
|
||||
if (!contents)
|
||||
return;
|
||||
diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c
|
||||
--- binutils.orig/bfd/elf.c 2018-05-17 14:14:04.326805836 +0100
|
||||
+++ binutils-2.30/bfd/elf.c 2018-05-17 14:15:59.412503342 +0100
|
||||
@@ -298,6 +298,7 @@ bfd_elf_get_str_section (bfd *abfd, unsi
|
||||
/* Allocate and clear an extra byte at the end, to prevent crashes
|
||||
in case the string table is not terminated. */
|
||||
if (shstrtabsize + 1 <= 1
|
||||
+ || shstrtabsize > bfd_get_file_size (abfd)
|
||||
|| bfd_seek (abfd, offset, SEEK_SET) != 0
|
||||
|| (shstrtab = (bfd_byte *) bfd_alloc (abfd, shstrtabsize + 1)) == NULL)
|
||||
shstrtab = NULL;
|
@ -1,5 +1,5 @@
|
||||
--- binutils.orig/gold/fileread.cc 2019-11-08 10:33:58.911577903 +0000
|
||||
+++ binutils-2.30/gold/fileread.cc 2019-11-08 10:34:13.001470092 +0000
|
||||
--- 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)
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- binutils.orig/binutils/readelf.c 2019-08-13 10:03:33.518792590 +0100
|
||||
+++ binutils-2.32/binutils/readelf.c 2019-08-13 10:04:22.885418269 +0100
|
||||
@@ -13234,7 +13234,7 @@ apply_relocations (Filedata *
|
||||
}
|
||||
|
||||
rloc = start + rp->r_offset;
|
||||
- if ((rloc + reloc_size) > end || (rloc < start))
|
||||
+ if (rloc >= end || (rloc + reloc_size) > end || (rloc < start))
|
||||
{
|
||||
warn (_("skipping invalid relocation offset 0x%lx in section %s\n"),
|
||||
(unsigned long) rp->r_offset,
|
@ -1,62 +0,0 @@
|
||||
--- binutils.orig/bfd/dwarf2.c 2019-12-03 15:50:43.324118062 +0000
|
||||
+++ binutils-2.30/bfd/dwarf2.c 2019-12-03 15:54:32.545489215 +0000
|
||||
@@ -2803,8 +2803,8 @@ lookup_symbol_in_variable_table (struct
|
||||
|
||||
static bfd_boolean
|
||||
find_abstract_instance_name (struct comp_unit *unit,
|
||||
- bfd_byte *orig_info_ptr,
|
||||
struct attribute *attr_ptr,
|
||||
+ unsigned int recur_count,
|
||||
const char **pname,
|
||||
bfd_boolean *is_linkage)
|
||||
{
|
||||
@@ -2817,6 +2817,14 @@ find_abstract_instance_name (struct comp
|
||||
struct attribute attr;
|
||||
const char *name = NULL;
|
||||
|
||||
+ if (recur_count == 100)
|
||||
+ {
|
||||
+ _bfd_error_handler
|
||||
+ (_("DWARF error: abstract instance recursion detected"));
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
/* DW_FORM_ref_addr can reference an entry in a different CU. It
|
||||
is an offset from the .debug_info section, not the current CU. */
|
||||
if (attr_ptr->form == DW_FORM_ref_addr)
|
||||
@@ -2934,15 +2942,7 @@ find_abstract_instance_name (struct comp
|
||||
info_ptr, info_ptr_end);
|
||||
if (info_ptr == NULL)
|
||||
break;
|
||||
- /* It doesn't ever make sense for DW_AT_specification to
|
||||
- refer to the same DIE. Stop simple recursion. */
|
||||
- if (info_ptr == orig_info_ptr)
|
||||
- {
|
||||
- _bfd_error_handler
|
||||
- (_("Dwarf Error: Abstract instance recursion detected."));
|
||||
- bfd_set_error (bfd_error_bad_value);
|
||||
- return FALSE;
|
||||
- }
|
||||
+
|
||||
switch (attr.name)
|
||||
{
|
||||
case DW_AT_name:
|
||||
@@ -2956,7 +2956,7 @@ find_abstract_instance_name (struct comp
|
||||
}
|
||||
break;
|
||||
case DW_AT_specification:
|
||||
- if (!find_abstract_instance_name (unit, info_ptr, &attr,
|
||||
+ if (!find_abstract_instance_name (unit, &attr, recur_count + 1,
|
||||
pname, is_linkage))
|
||||
return FALSE;
|
||||
break;
|
||||
@@ -3162,7 +3162,7 @@ scan_unit_for_symbols (struct comp_unit
|
||||
|
||||
case DW_AT_abstract_origin:
|
||||
case DW_AT_specification:
|
||||
- if (!find_abstract_instance_name (unit, info_ptr, &attr,
|
||||
+ if (!find_abstract_instance_name (unit, &attr, 0,
|
||||
&func->name,
|
||||
&func->is_linkage))
|
||||
goto fail;
|
@ -1,20 +0,0 @@
|
||||
--- binutils.orig/bfd/dwarf2.c 2019-11-13 11:32:09.395430104 +0000
|
||||
+++ binutils-2.33.1/bfd/dwarf2.c 2019-11-13 11:33:17.272899503 +0000
|
||||
@@ -4440,7 +4440,16 @@ _bfd_dwarf2_slurp_debug_info (bfd *abfd,
|
||||
for (total_size = 0;
|
||||
msec;
|
||||
msec = find_debug_info (debug_bfd, debug_sections, msec))
|
||||
- total_size += msec->size;
|
||||
+ {
|
||||
+ /* Catch PR25070 testcase overflowing size calculation here. */
|
||||
+ if (total_size + msec->size < total_size
|
||||
+ || total_size + msec->size < msec->size)
|
||||
+ {
|
||||
+ bfd_set_error (bfd_error_no_memory);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ total_size += msec->size;
|
||||
+ }
|
||||
|
||||
stash->info_ptr_memory = (bfd_byte *) bfd_malloc (total_size);
|
||||
if (stash->info_ptr_memory == NULL)
|
@ -155,7 +155,7 @@ diff -rup binutils.orig/binutils/bucomm.c binutils-2.35.1/binutils/bucomm.c
|
||||
as FILENAME. */
|
||||
|
||||
char *
|
||||
-make_tempname (char *filename)
|
||||
-make_tempname (const char *filename)
|
||||
+make_tempname (const char *filename, int *ofd)
|
||||
{
|
||||
char *tmpname = template_in_dir (filename);
|
||||
@ -174,11 +174,11 @@ diff -rup binutils.orig/binutils/bucomm.h binutils-2.35.1/binutils/bucomm.h
|
||||
+++ binutils-2.35.1/binutils/bucomm.h 2021-01-29 11:15:56.174187367 +0000
|
||||
@@ -51,7 +51,7 @@ int display_info (void);
|
||||
|
||||
void print_arelt_descr (FILE *, bfd *, bfd_boolean);
|
||||
void print_arelt_descr (FILE *, bfd *, bfd_boolean, bfd_boolean);
|
||||
|
||||
-char *make_tempname (char *);
|
||||
-char *make_tempname (const char *);
|
||||
+char *make_tempname (const char *, int *);
|
||||
char *make_tempdir (char *);
|
||||
char *make_tempdir (const char *);
|
||||
|
||||
bfd_vma parse_vma (const char *, const char *);
|
||||
@@ -71,7 +71,8 @@ extern void print_version (const char *)
|
||||
@ -328,9 +328,9 @@ diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c
|
||||
free (tmpname);
|
||||
}
|
||||
@@ -5033,7 +5054,8 @@ copy_main (int argc, char *argv[])
|
||||
bfd_boolean show_version = FALSE;
|
||||
bfd_boolean change_warn = TRUE;
|
||||
bfd_boolean formats_info = FALSE;
|
||||
bfd_boolean use_globalize = FALSE;
|
||||
bfd_boolean use_keep_global = FALSE;
|
||||
- int c;
|
||||
+ int c, tmpfd = -1;
|
||||
+ int copyfd = -1;
|
||||
@ -542,6 +542,24 @@ diff -rup binutils.orig/binutils/ar.c binutils-2.35.1/binutils/ar.c
|
||||
#include "libiberty.h"
|
||||
#include "progress.h"
|
||||
#include "getopt.h"
|
||||
@@ -1082,7 +1081,7 @@ open_output_file (bfd * abfd)
|
||||
output_filename, base);
|
||||
output_filename = base;
|
||||
}
|
||||
-
|
||||
+
|
||||
if (output_dir)
|
||||
{
|
||||
size_t len = strlen (output_dir);
|
||||
@@ -1099,7 +1098,7 @@ open_output_file (bfd * abfd)
|
||||
|
||||
if (verbose)
|
||||
printf ("x - %s\n", output_filename);
|
||||
-
|
||||
+
|
||||
FILE * ostream = fopen (output_filename, FOPEN_WB);
|
||||
if (ostream == NULL)
|
||||
{
|
||||
@@ -1198,10 +1197,8 @@ write_archive (bfd *iarch)
|
||||
bfd *contents_head = iarch->archive_next;
|
||||
int ofd = -1;
|
||||
@ -591,28 +609,29 @@ diff -rup binutils.orig/binutils/arsup.c binutils-2.35.1/binutils/arsup.c
|
||||
static FILE *outfile;
|
||||
|
||||
static void
|
||||
@@ -149,20 +151,24 @@ maybequit (void)
|
||||
@@ -149,27 +151,24 @@ maybequit (void)
|
||||
void
|
||||
ar_open (char *name, int t)
|
||||
{
|
||||
- char *tname = (char *) xmalloc (strlen (name) + 10);
|
||||
- char *tname;
|
||||
- const char *bname = lbasename (name);
|
||||
- real_name = name;
|
||||
-
|
||||
- /* Prepend tmp- to the beginning, to avoid file-name clashes after
|
||||
- truncation on filesystems with limited namespaces (DOS). */
|
||||
- sprintf (tname, "%.*stmp-%s", (int) (bname - name), name, bname);
|
||||
- if (asprintf (&tname, "%.*stmp-%s", (int) (bname - name), name, bname) == -1)
|
||||
+ real_name = xstrdup (name);
|
||||
+ temp_name = make_tempname (real_name, &real_ofd);
|
||||
+
|
||||
+ if (temp_name == NULL)
|
||||
+ {
|
||||
{
|
||||
- fprintf (stderr, _("%s: Can't allocate memory for temp name (%s)\n"),
|
||||
+ fprintf (stderr, _("%s: Can't open temporary file (%s)\n"),
|
||||
+ program_name, strerror(errno));
|
||||
+ maybequit ();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
program_name, strerror(errno));
|
||||
maybequit ();
|
||||
return;
|
||||
}
|
||||
|
||||
- obfd = bfd_openw (tname, NULL);
|
||||
+ obfd = bfd_fdopenw (temp_name, NULL, real_ofd);
|
||||
|
||||
@ -662,6 +681,8 @@ diff -rup binutils.orig/binutils/arsup.c binutils-2.35.1/binutils/arsup.c
|
||||
}
|
||||
}
|
||||
|
||||
Only in binutils-2.35.1/binutils/: arsup.c.orig
|
||||
Only in binutils-2.35.1/binutils/: arsup.c.rej
|
||||
diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c
|
||||
--- binutils.orig/binutils/objcopy.c 2021-02-02 13:01:42.214735229 +0000
|
||||
+++ binutils-2.35.1/binutils/objcopy.c 2021-02-02 13:13:27.613071192 +0000
|
||||
@ -682,6 +703,8 @@ diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c
|
||||
{
|
||||
bfd_nonfatal_message (input_filename, NULL, NULL, NULL);
|
||||
status = 1;
|
||||
Only in binutils-2.35.1/binutils/: objcopy.c.orig
|
||||
Only in binutils-2.35.1/binutils/: objcopy.c.rej
|
||||
--- binutils.orig/binutils/arsup.c 2021-02-04 10:42:03.265729780 +0000
|
||||
+++ binutils-2.35.1/binutils/arsup.c 2021-02-04 10:45:48.439166658 +0000
|
||||
@@ -357,8 +357,21 @@ ar_save (void)
|
||||
@ -936,9 +959,9 @@ diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c
|
||||
}
|
||||
if (output_file != tmpname)
|
||||
@@ -5043,8 +5034,9 @@ copy_main (int argc, char *argv[])
|
||||
bfd_boolean show_version = FALSE;
|
||||
bfd_boolean change_warn = TRUE;
|
||||
bfd_boolean formats_info = FALSE;
|
||||
bfd_boolean use_globalize = FALSE;
|
||||
bfd_boolean use_keep_global = FALSE;
|
||||
- int c, tmpfd = -1;
|
||||
- int copyfd = -1;
|
||||
+ int c;
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.30/bfd/elf-bfd.h
|
||||
--- binutils.orig/bfd/elf-bfd.h 2021-05-19 15:05:30.988901261 +0100
|
||||
+++ binutils-2.30/bfd/elf-bfd.h 2021-05-19 15:05:55.477815716 +0100
|
||||
@@ -1487,7 +1487,7 @@ struct elf_backend_data
|
||||
bfd_boolean (*init_secondary_reloc_section) (bfd *, Elf_Internal_Shdr *, const char *, unsigned int);
|
||||
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 **);
|
||||
@ -10,7 +10,7 @@ diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.30/bfd/elf-bfd.h
|
||||
|
||||
/* Called after writing the normal relocs for a section. */
|
||||
bfd_boolean (*write_secondary_relocs) (bfd *, asection *);
|
||||
@@ -2721,7 +2721,7 @@ extern bfd_vma elf32_r_sym (bfd_vma);
|
||||
@@ -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
|
||||
@ -19,11 +19,10 @@ diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.30/bfd/elf-bfd.h
|
||||
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
|
||||
Only in binutils-2.30/bfd: elf-bfd.h.orig
|
||||
diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c
|
||||
--- binutils.orig/bfd/elf.c 2021-05-19 15:05:30.989901257 +0100
|
||||
+++ binutils-2.30/bfd/elf.c 2021-05-19 15:05:55.478815712 +0100
|
||||
@@ -11663,7 +11663,8 @@ _bfd_elf_init_secondary_reloc_section (b
|
||||
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,
|
||||
@ -33,7 +32,7 @@ diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c
|
||||
{
|
||||
const struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
|
||||
asection * relsec;
|
||||
@@ -11728,7 +11729,10 @@ _bfd_elf_slurp_secondary_reloc_section (
|
||||
@@ -12590,7 +12591,10 @@ _bfd_elf_slurp_secondary_reloc_section (
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -43,20 +42,17 @@ diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c
|
||||
+ else
|
||||
+ symcount = bfd_get_symcount (abfd);
|
||||
|
||||
for (i = 0, internal_reloc = internal_relocs, native_reloc = native_relocs;
|
||||
i < reloc_count;
|
||||
Only in binutils-2.30/bfd: elf.c.orig
|
||||
diff -rup binutils.orig/bfd/elfcode.h binutils-2.30/bfd/elfcode.h
|
||||
--- binutils.orig/bfd/elfcode.h 2021-05-19 15:05:30.990901254 +0100
|
||||
+++ binutils-2.30/bfd/elfcode.h 2021-05-19 15:07:34.098471218 +0100
|
||||
@@ -1577,7 +1577,7 @@ elf_slurp_reloc_table (bfd *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 != NULL
|
||||
- && ! bed->slurp_secondary_relocs (abfd, asect, symbols))
|
||||
+ && ! bed->slurp_secondary_relocs (abfd, asect, symbols, dynamic))
|
||||
- if (!bed->slurp_secondary_relocs (abfd, asect, symbols))
|
||||
+ if (!bed->slurp_secondary_relocs (abfd, asect, symbols, dynamic))
|
||||
return FALSE;
|
||||
|
||||
asect->relocation = relents;
|
||||
Only in binutils-2.30/bfd: elfcode.h.orig
|
||||
Only in binutils-2.30/bfd: elfcode.h.rej
|
||||
|
@ -1,17 +1,15 @@
|
||||
--- binutils.orig/bfd/dwarf2.c 2021-04-14 14:24:18.945917267 +0100
|
||||
+++ binutils-2.30/bfd/dwarf2.c 2021-04-14 14:25:51.908614106 +0100
|
||||
@@ -532,6 +532,10 @@ read_section (bfd * abfd,
|
||||
--- 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)
|
||||
{
|
||||
+ bfd_size_type amt;
|
||||
+ asection *msec;
|
||||
+ ufile_ptr filesize;
|
||||
+
|
||||
msec = bfd_get_section_by_name (abfd, section_name);
|
||||
if (! msec)
|
||||
{
|
||||
@@ -547,10 +551,22 @@ read_section (bfd * abfd,
|
||||
@@ -554,10 +556,20 @@ read_section (bfd * abfd,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -27,12 +25,10 @@
|
||||
+ 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);
|
||||
|
34
SOURCES/binutils-CVE-2023-25587.patch
Normal file
34
SOURCES/binutils-CVE-2023-25587.patch
Normal file
@ -0,0 +1,34 @@
|
||||
--- binutils.orig/binutils/objdump.c 2023-03-03 11:37:39.209614222 +0000
|
||||
+++ binutils-2.35.2/binutils/objdump.c 2023-03-03 11:39:45.492428807 +0000
|
||||
@@ -1090,20 +1090,19 @@ compare_symbols (const void *ap, const v
|
||||
return 1;
|
||||
}
|
||||
|
||||
- if (bfd_get_flavour (bfd_asymbol_bfd (a)) == bfd_target_elf_flavour
|
||||
+ /* Sort larger size ELF symbols before smaller. See PR20337. */
|
||||
+ bfd_vma asz = 0;
|
||||
+ if ((a->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0
|
||||
+ && bfd_get_flavour (bfd_asymbol_bfd (a)) == bfd_target_elf_flavour)
|
||||
+ asz = ((elf_symbol_type *) a)->internal_elf_sym.st_size;
|
||||
+
|
||||
+ bfd_vma bsz = 0;
|
||||
+ if ((b->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0
|
||||
&& bfd_get_flavour (bfd_asymbol_bfd (b)) == bfd_target_elf_flavour)
|
||||
- {
|
||||
- bfd_vma asz, bsz;
|
||||
+ bsz = ((elf_symbol_type *) b)->internal_elf_sym.st_size;
|
||||
|
||||
- asz = 0;
|
||||
- if ((a->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0)
|
||||
- asz = ((elf_symbol_type *) a)->internal_elf_sym.st_size;
|
||||
- bsz = 0;
|
||||
- if ((b->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0)
|
||||
- bsz = ((elf_symbol_type *) b)->internal_elf_sym.st_size;
|
||||
- if (asz != bsz)
|
||||
- return asz > bsz ? -1 : 1;
|
||||
- }
|
||||
+ if (asz != bsz)
|
||||
+ return asz > bsz ? -1 : 1;
|
||||
|
||||
/* Symbols that start with '.' might be section names, so sort them
|
||||
after symbols that don't start with '.'. */
|
11
SOURCES/binutils-DWARF-5-FORM_ref_addr.patch
Normal file
11
SOURCES/binutils-DWARF-5-FORM_ref_addr.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- binutils.orig/bfd/dwarf2.c 2021-05-18 12:00:10.363028020 +0100
|
||||
+++ binutils-2.35.2/bfd/dwarf2.c 2021-05-18 12:01:09.930831909 +0100
|
||||
@@ -1194,7 +1194,7 @@ read_attribute_value (struct attribute *
|
||||
case DW_FORM_ref_addr:
|
||||
/* DW_FORM_ref_addr is an address in DWARF2, and an offset in
|
||||
DWARF3. */
|
||||
- if (unit->version == 3 || unit->version == 4)
|
||||
+ if (unit->version >= 3)
|
||||
{
|
||||
if (unit->offset_size == 4)
|
||||
attr->u.val = read_4_bytes (unit->abfd, info_ptr, info_ptr_end);
|
@ -1,802 +0,0 @@
|
||||
diff -rup binutils.nickc/bfd/dwarf2.c binutils-2.30/bfd/dwarf2.c
|
||||
--- binutils.nickc/bfd/dwarf2.c 2023-07-18 10:02:02.953147381 +0100
|
||||
+++ binutils-2.30/bfd/dwarf2.c 2023-07-18 10:05:41.826211729 +0100
|
||||
@@ -161,6 +161,12 @@ struct dwarf2_debug
|
||||
/* Length of the loaded .debug_ranges section. */
|
||||
bfd_size_type dwarf_ranges_size;
|
||||
|
||||
+ /* Pointer to the .debug_rnglists section loaded into memory. */
|
||||
+ bfd_byte *dwarf_rnglists_buffer;
|
||||
+
|
||||
+ /* Length of the loaded .debug_rnglists section. */
|
||||
+ bfd_size_type dwarf_rnglists_size;
|
||||
+
|
||||
/* If the most recent call to bfd_find_nearest_line was given an
|
||||
address in an inlined function, preserve a pointer into the
|
||||
calling chain for subsequent calls to bfd_find_inliner_info to
|
||||
@@ -328,6 +334,7 @@ const struct dwarf_debug_section dwarf_d
|
||||
{ ".debug_pubnames", ".zdebug_pubnames" },
|
||||
{ ".debug_pubtypes", ".zdebug_pubtypes" },
|
||||
{ ".debug_ranges", ".zdebug_ranges" },
|
||||
+ { ".debug_rnglists", ".zdebug_rnglist" },
|
||||
{ ".debug_static_func", ".zdebug_static_func" },
|
||||
{ ".debug_static_vars", ".zdebug_static_vars" },
|
||||
{ ".debug_str", ".zdebug_str", },
|
||||
@@ -361,6 +368,7 @@ enum dwarf_debug_section_enum
|
||||
debug_pubnames,
|
||||
debug_pubtypes,
|
||||
debug_ranges,
|
||||
+ debug_rnglists,
|
||||
debug_static_func,
|
||||
debug_static_vars,
|
||||
debug_str,
|
||||
@@ -524,10 +532,8 @@ read_section (bfd * abfd,
|
||||
bfd_byte ** section_buffer,
|
||||
bfd_size_type * section_size)
|
||||
{
|
||||
- asection *msec;
|
||||
const char *section_name = sec->uncompressed_name;
|
||||
bfd_byte *contents = *section_buffer;
|
||||
- bfd_size_type amt;
|
||||
|
||||
/* The section may have already been read. */
|
||||
if (contents == NULL)
|
||||
@@ -1097,8 +1103,23 @@ read_abbrevs (bfd *abfd, bfd_uint64_t of
|
||||
static inline bfd_boolean
|
||||
is_str_attr (enum dwarf_form form)
|
||||
{
|
||||
- return (form == DW_FORM_string || form == DW_FORM_strp
|
||||
- || form == DW_FORM_line_strp || form == DW_FORM_GNU_strp_alt);
|
||||
+ return (form == DW_FORM_string
|
||||
+ || form == DW_FORM_strp
|
||||
+ || form == DW_FORM_strx
|
||||
+ || form == DW_FORM_strx1
|
||||
+ || form == DW_FORM_strx2
|
||||
+ || form == DW_FORM_strx3
|
||||
+ || form == DW_FORM_strx4
|
||||
+ || form == DW_FORM_line_strp
|
||||
+ || form == DW_FORM_GNU_strp_alt);
|
||||
+}
|
||||
+
|
||||
+static const char *
|
||||
+read_indexed_string (bfd_uint64_t index ATTRIBUTE_UNUSED,
|
||||
+ struct comp_unit * unit ATTRIBUTE_UNUSED)
|
||||
+{
|
||||
+ /* FIXME: Add support for indexed strings. */
|
||||
+ return "<indexed strings not yet supported>";
|
||||
}
|
||||
|
||||
/* Read and fill in the value of attribute ATTR as described by FORM.
|
||||
@@ -1129,6 +1150,9 @@ read_attribute_value (struct attribute *
|
||||
|
||||
switch (form)
|
||||
{
|
||||
+ case DW_FORM_flag_present:
|
||||
+ attr->u.val = 1;
|
||||
+ break;
|
||||
case DW_FORM_ref_addr:
|
||||
/* DW_FORM_ref_addr is an address in DWARF2, and an offset in
|
||||
DWARF3. */
|
||||
@@ -1174,15 +1198,32 @@ read_attribute_value (struct attribute *
|
||||
info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk);
|
||||
attr->u.blk = blk;
|
||||
break;
|
||||
+ case DW_FORM_ref1:
|
||||
+ case DW_FORM_flag:
|
||||
+ case DW_FORM_data1:
|
||||
+ case DW_FORM_addrx1:
|
||||
+ attr->u.val = read_1_byte (abfd, info_ptr, info_ptr_end);
|
||||
+ info_ptr += 1;
|
||||
+ break;
|
||||
case DW_FORM_data2:
|
||||
+ case DW_FORM_ref2:
|
||||
attr->u.val = read_2_bytes (abfd, info_ptr, info_ptr_end);
|
||||
info_ptr += 2;
|
||||
break;
|
||||
+ case DW_FORM_addrx3:
|
||||
+ attr->u.val = read_4_bytes (abfd, info_ptr, info_ptr_end);
|
||||
+ attr->u.val &= 0xffffff;
|
||||
+ info_ptr += 3;
|
||||
+ break;
|
||||
+ case DW_FORM_ref4:
|
||||
case DW_FORM_data4:
|
||||
+ case DW_FORM_addrx4:
|
||||
attr->u.val = read_4_bytes (abfd, info_ptr, info_ptr_end);
|
||||
info_ptr += 4;
|
||||
break;
|
||||
case DW_FORM_data8:
|
||||
+ case DW_FORM_ref8:
|
||||
+ case DW_FORM_ref_sig8:
|
||||
attr->u.val = read_8_bytes (abfd, info_ptr, info_ptr_end);
|
||||
info_ptr += 8;
|
||||
break;
|
||||
@@ -1202,6 +1243,33 @@ read_attribute_value (struct attribute *
|
||||
attr->u.str = read_alt_indirect_string (unit, info_ptr, info_ptr_end, &bytes_read);
|
||||
info_ptr += bytes_read;
|
||||
break;
|
||||
+ case DW_FORM_strx1:
|
||||
+ attr->u.val = read_1_byte (abfd, info_ptr, info_ptr_end);
|
||||
+ info_ptr += 1;
|
||||
+ attr->u.str = (char *) read_indexed_string (attr->u.val, unit);
|
||||
+ break;
|
||||
+ case DW_FORM_strx2:
|
||||
+ attr->u.val = read_2_bytes (abfd, info_ptr, info_ptr_end);
|
||||
+ info_ptr += 2;
|
||||
+ attr->u.str = (char *) read_indexed_string (attr->u.val, unit);
|
||||
+ break;
|
||||
+ case DW_FORM_strx3:
|
||||
+ attr->u.val = read_4_bytes (abfd, info_ptr, info_ptr_end);
|
||||
+ info_ptr += 3;
|
||||
+ attr->u.val &= 0xffffff;
|
||||
+ attr->u.str = (char *) read_indexed_string (attr->u.val, unit);
|
||||
+ break;
|
||||
+ case DW_FORM_strx4:
|
||||
+ attr->u.val = read_4_bytes (abfd, info_ptr, info_ptr_end);
|
||||
+ info_ptr += 4;
|
||||
+ attr->u.str = (char *) read_indexed_string (attr->u.val, unit);
|
||||
+ break;
|
||||
+ case DW_FORM_strx:
|
||||
+ attr->u.val = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read,
|
||||
+ FALSE, info_ptr_end);
|
||||
+ info_ptr += bytes_read;
|
||||
+ attr->u.str = (char *) read_indexed_string (attr->u.val, unit);
|
||||
+ break;
|
||||
case DW_FORM_exprloc:
|
||||
case DW_FORM_block:
|
||||
amt = sizeof (struct dwarf_block);
|
||||
@@ -1224,48 +1292,19 @@ read_attribute_value (struct attribute *
|
||||
info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk);
|
||||
attr->u.blk = blk;
|
||||
break;
|
||||
- case DW_FORM_data1:
|
||||
- attr->u.val = read_1_byte (abfd, info_ptr, info_ptr_end);
|
||||
- info_ptr += 1;
|
||||
- break;
|
||||
- case DW_FORM_flag:
|
||||
- attr->u.val = read_1_byte (abfd, info_ptr, info_ptr_end);
|
||||
- info_ptr += 1;
|
||||
- break;
|
||||
- case DW_FORM_flag_present:
|
||||
- attr->u.val = 1;
|
||||
- break;
|
||||
case DW_FORM_sdata:
|
||||
attr->u.sval = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read,
|
||||
TRUE, info_ptr_end);
|
||||
info_ptr += bytes_read;
|
||||
break;
|
||||
- case DW_FORM_udata:
|
||||
- attr->u.val = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read,
|
||||
- FALSE, info_ptr_end);
|
||||
- info_ptr += bytes_read;
|
||||
- break;
|
||||
- case DW_FORM_ref1:
|
||||
- attr->u.val = read_1_byte (abfd, info_ptr, info_ptr_end);
|
||||
- info_ptr += 1;
|
||||
- break;
|
||||
- case DW_FORM_ref2:
|
||||
- attr->u.val = read_2_bytes (abfd, info_ptr, info_ptr_end);
|
||||
- info_ptr += 2;
|
||||
- break;
|
||||
- case DW_FORM_ref4:
|
||||
- attr->u.val = read_4_bytes (abfd, info_ptr, info_ptr_end);
|
||||
- info_ptr += 4;
|
||||
- break;
|
||||
- case DW_FORM_ref8:
|
||||
- attr->u.val = read_8_bytes (abfd, info_ptr, info_ptr_end);
|
||||
- info_ptr += 8;
|
||||
- break;
|
||||
- case DW_FORM_ref_sig8:
|
||||
- attr->u.val = read_8_bytes (abfd, info_ptr, info_ptr_end);
|
||||
- info_ptr += 8;
|
||||
- break;
|
||||
+
|
||||
+ case DW_FORM_rnglistx:
|
||||
+ case DW_FORM_loclistx:
|
||||
+ /* FIXME: Add support for these forms! */
|
||||
+ /* Fall through. */
|
||||
case DW_FORM_ref_udata:
|
||||
+ case DW_FORM_udata:
|
||||
+ case DW_FORM_addrx:
|
||||
attr->u.val = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read,
|
||||
FALSE, info_ptr_end);
|
||||
info_ptr += bytes_read;
|
||||
@@ -1287,6 +1326,7 @@ read_attribute_value (struct attribute *
|
||||
attr->form = DW_FORM_sdata;
|
||||
attr->u.sval = implicit_const;
|
||||
break;
|
||||
+
|
||||
default:
|
||||
_bfd_error_handler (_("Dwarf Error: Invalid or unhandled FORM value: %#x."),
|
||||
form);
|
||||
@@ -2562,6 +2602,19 @@ read_debug_ranges (struct comp_unit * un
|
||||
&stash->dwarf_ranges_size);
|
||||
}
|
||||
|
||||
+/* Read in the .debug_rnglists section for future reference. */
|
||||
+
|
||||
+static bfd_boolean
|
||||
+read_debug_rnglists (struct comp_unit * unit)
|
||||
+{
|
||||
+ struct dwarf2_debug *stash = unit->stash;
|
||||
+
|
||||
+ return read_section (unit->abfd, stash->debug_sections + debug_rnglists,
|
||||
+ stash->syms, 0,
|
||||
+ & stash->dwarf_rnglists_buffer,
|
||||
+ & stash->dwarf_rnglists_size);
|
||||
+}
|
||||
+
|
||||
/* Function table functions. */
|
||||
|
||||
static int
|
||||
@@ -2999,8 +3052,7 @@ find_abstract_instance_name (struct comp
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
-read_rangelist (struct comp_unit *unit, struct arange *arange,
|
||||
- bfd_uint64_t offset)
|
||||
+read_ranges (struct comp_unit *unit, struct arange *arange, bfd_uint64_t offset)
|
||||
{
|
||||
bfd_byte *ranges_ptr;
|
||||
bfd_byte *ranges_end;
|
||||
@@ -3012,6 +3064,8 @@ read_rangelist (struct comp_unit *unit,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ if (offset > unit->stash->dwarf_ranges_size)
|
||||
+ return FALSE;
|
||||
ranges_ptr = unit->stash->dwarf_ranges_buffer + offset;
|
||||
if (ranges_ptr < unit->stash->dwarf_ranges_buffer)
|
||||
return FALSE;
|
||||
@@ -3023,7 +3077,7 @@ read_rangelist (struct comp_unit *unit,
|
||||
bfd_vma high_pc;
|
||||
|
||||
/* PR 17512: file: 62cada7d. */
|
||||
- if (ranges_ptr + 2 * unit->addr_size > ranges_end)
|
||||
+ if (2u * unit->addr_size > (size_t) (ranges_end - ranges_ptr))
|
||||
return FALSE;
|
||||
|
||||
low_pc = read_address (unit, ranges_ptr, ranges_end);
|
||||
@@ -3045,6 +3099,104 @@ read_rangelist (struct comp_unit *unit,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+static bfd_boolean
|
||||
+read_rnglists (struct comp_unit *unit, struct arange *arange, bfd_uint64_t offset)
|
||||
+{
|
||||
+ bfd_byte *rngs_ptr;
|
||||
+ bfd_byte *rngs_end;
|
||||
+ bfd_vma base_address = unit->base_address;
|
||||
+ bfd_vma low_pc;
|
||||
+ bfd_vma high_pc;
|
||||
+ bfd *abfd = unit->abfd;
|
||||
+
|
||||
+ if (! unit->stash->dwarf_rnglists_buffer)
|
||||
+ {
|
||||
+ if (! read_debug_rnglists (unit))
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ rngs_ptr = unit->stash->dwarf_rnglists_buffer + offset;
|
||||
+ if (rngs_ptr < unit->stash->dwarf_rnglists_buffer)
|
||||
+ return FALSE;
|
||||
+ rngs_end = unit->stash->dwarf_rnglists_buffer;
|
||||
+ rngs_end += unit->stash->dwarf_rnglists_size;
|
||||
+
|
||||
+ for (;;)
|
||||
+ {
|
||||
+ enum dwarf_range_list_entry rlet;
|
||||
+ unsigned int bytes_read;
|
||||
+
|
||||
+ if (rngs_ptr >= rngs_end)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ rlet = read_1_byte (abfd, rngs_ptr, rngs_end);
|
||||
+ rngs_ptr ++;
|
||||
+
|
||||
+ switch (rlet)
|
||||
+ {
|
||||
+ case DW_RLE_end_of_list:
|
||||
+ return TRUE;
|
||||
+
|
||||
+ case DW_RLE_base_address:
|
||||
+ if (unit->addr_size > (size_t) (rngs_end - rngs_ptr))
|
||||
+ return FALSE;
|
||||
+ base_address = read_address (unit, rngs_ptr, rngs_end);
|
||||
+ rngs_ptr += unit->addr_size;
|
||||
+ continue;
|
||||
+
|
||||
+ case DW_RLE_start_length:
|
||||
+ if (unit->addr_size > (size_t) (rngs_end - rngs_ptr))
|
||||
+ return FALSE;
|
||||
+ low_pc = read_address (unit, rngs_ptr, rngs_end);
|
||||
+ rngs_ptr += unit->addr_size;
|
||||
+ high_pc = low_pc;
|
||||
+ high_pc += _bfd_safe_read_leb128 (abfd, rngs_ptr, & bytes_read,
|
||||
+ FALSE, rngs_end);
|
||||
+ rngs_ptr += bytes_read;
|
||||
+ break;
|
||||
+
|
||||
+ case DW_RLE_offset_pair:
|
||||
+ 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:
|
||||
+ if (2u * unit->addr_size > (size_t) (rngs_end - rngs_ptr))
|
||||
+ return FALSE;
|
||||
+ low_pc = read_address (unit, rngs_ptr, rngs_end);
|
||||
+ rngs_ptr += unit->addr_size;
|
||||
+ high_pc = read_address (unit, rngs_ptr, rngs_end);
|
||||
+ rngs_ptr += unit->addr_size;
|
||||
+ break;
|
||||
+
|
||||
+ /* TODO x-variants need .debug_addr support used for split-dwarf. */
|
||||
+ case DW_RLE_base_addressx:
|
||||
+ case DW_RLE_startx_endx:
|
||||
+ case DW_RLE_startx_length:
|
||||
+ default:
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (!arange_add (unit, arange, low_pc, high_pc))
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static bfd_boolean
|
||||
+read_rangelist (struct comp_unit *unit, struct arange *arange, bfd_uint64_t offset)
|
||||
+{
|
||||
+ if (unit->version <= 4)
|
||||
+ return read_ranges (unit, arange, offset);
|
||||
+ else
|
||||
+ return read_rnglists (unit, arange, offset);
|
||||
+}
|
||||
+
|
||||
/* DWARF2 Compilation unit functions. */
|
||||
|
||||
/* Scan over each die in a comp. unit looking for functions to add
|
||||
Only in binutils-2.30/bfd: dwarf2.c.orig
|
||||
diff -rup binutils.fred/include/dwarf2.def binutils-2.30/include/dwarf2.def
|
||||
--- binutils.fred/include/dwarf2.def 2023-07-18 10:07:43.770304136 +0100
|
||||
+++ binutils-2.30/include/dwarf2.def 2023-07-18 10:08:00.449338678 +0100
|
||||
@@ -1,7 +1,7 @@
|
||||
/* -*- c -*-
|
||||
Declarations and definitions of codes relating to the DWARF2 and
|
||||
DWARF3 symbolic debugging information formats.
|
||||
- Copyright (C) 1992-2018 Free Software Foundation, Inc.
|
||||
+ Copyright (C) 1992-2023 Free Software Foundation, Inc.
|
||||
|
||||
Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
|
||||
Office (AJPO), Florida State University and Silicon Graphics Inc.
|
||||
@@ -220,6 +220,14 @@ DW_FORM (DW_FORM_implicit_const, 0x21)
|
||||
DW_FORM (DW_FORM_loclistx, 0x22)
|
||||
DW_FORM (DW_FORM_rnglistx, 0x23)
|
||||
DW_FORM (DW_FORM_ref_sup8, 0x24)
|
||||
+DW_FORM (DW_FORM_strx1, 0x25)
|
||||
+DW_FORM (DW_FORM_strx2, 0x26)
|
||||
+DW_FORM (DW_FORM_strx3, 0x27)
|
||||
+DW_FORM (DW_FORM_strx4, 0x28)
|
||||
+DW_FORM (DW_FORM_addrx1, 0x29)
|
||||
+DW_FORM (DW_FORM_addrx2, 0x2a)
|
||||
+DW_FORM (DW_FORM_addrx3, 0x2b)
|
||||
+DW_FORM (DW_FORM_addrx4, 0x2c)
|
||||
/* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */
|
||||
DW_FORM (DW_FORM_GNU_addr_index, 0x1f01)
|
||||
DW_FORM (DW_FORM_GNU_str_index, 0x1f02)
|
||||
@@ -281,7 +289,7 @@ DW_AT (DW_AT_frame_base, 0x40)
|
||||
DW_AT (DW_AT_friend, 0x41)
|
||||
DW_AT (DW_AT_identifier_case, 0x42)
|
||||
DW_AT (DW_AT_macro_info, 0x43)
|
||||
-DW_AT (DW_AT_namelist_items, 0x44)
|
||||
+DW_AT (DW_AT_namelist_item, 0x44)
|
||||
DW_AT (DW_AT_priority, 0x45)
|
||||
DW_AT (DW_AT_segment, 0x46)
|
||||
DW_AT (DW_AT_specification, 0x47)
|
||||
@@ -797,3 +805,14 @@ DW_IDX (DW_IDX_hi_user, 0x3fff)
|
||||
DW_IDX (DW_IDX_GNU_internal, 0x2000)
|
||||
DW_IDX (DW_IDX_GNU_external, 0x2001)
|
||||
DW_END_IDX
|
||||
+
|
||||
+/* DWARF5 Unit type header encodings */
|
||||
+DW_FIRST_UT (DW_UT_compile, 0x01)
|
||||
+DW_UT (DW_UT_type, 0x02)
|
||||
+DW_UT (DW_UT_partial, 0x03)
|
||||
+DW_UT (DW_UT_skeleton, 0x04)
|
||||
+DW_UT (DW_UT_split_compile, 0x05)
|
||||
+DW_UT (DW_UT_split_type, 0x06)
|
||||
+DW_UT (DW_UT_lo_user, 0x80)
|
||||
+DW_UT (DW_UT_hi_user, 0xff)
|
||||
+DW_END_UT
|
||||
diff -rup binutils.fred/include/dwarf2.h binutils-2.30/include/dwarf2.h
|
||||
--- binutils.fred/include/dwarf2.h 2023-07-18 10:07:43.771304138 +0100
|
||||
+++ binutils-2.30/include/dwarf2.h 2023-07-18 10:07:53.985325295 +0100
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Declarations and definitions of codes relating to the DWARF2 and
|
||||
DWARF3 symbolic debugging information formats.
|
||||
- Copyright (C) 1992-2018 Free Software Foundation, Inc.
|
||||
+ Copyright (C) 1992-2023 Free Software Foundation, Inc.
|
||||
|
||||
Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
|
||||
Office (AJPO), Florida State University and Silicon Graphics Inc.
|
||||
@@ -55,6 +55,7 @@
|
||||
#define DW_CFA_DUP(name, value) , name = value
|
||||
#define DW_IDX(name, value) , name = value
|
||||
#define DW_IDX_DUP(name, value) , name = value
|
||||
+#define DW_UT(name, value) , name = value
|
||||
|
||||
#define DW_FIRST_TAG(name, value) enum dwarf_tag { \
|
||||
name = value
|
||||
@@ -77,6 +78,9 @@
|
||||
#define DW_FIRST_IDX(name, value) enum dwarf_name_index_attribute { \
|
||||
name = value
|
||||
#define DW_END_IDX };
|
||||
+#define DW_FIRST_UT(name, value) enum dwarf_unit_type { \
|
||||
+ name = value
|
||||
+#define DW_END_UT };
|
||||
|
||||
#include "dwarf2.def"
|
||||
|
||||
@@ -94,6 +98,8 @@
|
||||
#undef DW_END_CFA
|
||||
#undef DW_FIRST_IDX
|
||||
#undef DW_END_IDX
|
||||
+#undef DW_FIRST_UT
|
||||
+#undef DW_END_UT
|
||||
|
||||
#undef DW_TAG
|
||||
#undef DW_TAG_DUP
|
||||
@@ -108,6 +114,7 @@
|
||||
#undef DW_CFA_DUP
|
||||
#undef DW_IDX
|
||||
#undef DW_IDX_DUP
|
||||
+#undef DW_UT
|
||||
|
||||
/* Flag that tells whether entry has a child or not. */
|
||||
#define DW_children_no 0
|
||||
@@ -316,7 +323,6 @@ enum dwarf_location_list_entry_type
|
||||
|
||||
#define DW_CIE_ID 0xffffffff
|
||||
#define DW64_CIE_ID 0xffffffffffffffffULL
|
||||
-#define DW_CIE_VERSION 1
|
||||
|
||||
#define DW_CFA_extended 0
|
||||
|
||||
@@ -451,19 +457,6 @@ enum dwarf_range_list_entry
|
||||
DW_RLE_start_end = 0x06,
|
||||
DW_RLE_start_length = 0x07
|
||||
};
|
||||
-
|
||||
-/* Unit types in unit_type unit header field. */
|
||||
-enum dwarf_unit_type
|
||||
- {
|
||||
- DW_UT_compile = 0x01,
|
||||
- DW_UT_type = 0x02,
|
||||
- DW_UT_partial = 0x03,
|
||||
- DW_UT_skeleton = 0x04,
|
||||
- DW_UT_split_compile = 0x05,
|
||||
- DW_UT_split_type = 0x06,
|
||||
- DW_UT_lo_user = 0x80,
|
||||
- DW_UT_hi_user = 0xff
|
||||
- };
|
||||
|
||||
/* @@@ For use with GNU frame unwind information. */
|
||||
|
||||
@@ -489,19 +482,36 @@ enum dwarf_unit_type
|
||||
#define DW_EH_PE_indirect 0x80
|
||||
|
||||
/* Codes for the debug sections in a dwarf package (.dwp) file.
|
||||
- Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFissionDWP. */
|
||||
+ (From the pre-standard formats Extensions for Fission.
|
||||
+ See http://gcc.gnu.org/wiki/DebugFissionDWP). */
|
||||
enum dwarf_sect
|
||||
- {
|
||||
- DW_SECT_INFO = 1,
|
||||
- DW_SECT_TYPES = 2,
|
||||
- DW_SECT_ABBREV = 3,
|
||||
- DW_SECT_LINE = 4,
|
||||
- DW_SECT_LOC = 5,
|
||||
- DW_SECT_STR_OFFSETS = 6,
|
||||
- DW_SECT_MACINFO = 7,
|
||||
- DW_SECT_MACRO = 8,
|
||||
- DW_SECT_MAX = 8
|
||||
- };
|
||||
+{
|
||||
+ DW_SECT_INFO = 1,
|
||||
+ DW_SECT_TYPES = 2,
|
||||
+ DW_SECT_ABBREV = 3,
|
||||
+ DW_SECT_LINE = 4,
|
||||
+ DW_SECT_LOC = 5,
|
||||
+ DW_SECT_STR_OFFSETS = 6,
|
||||
+ DW_SECT_MACINFO = 7,
|
||||
+ DW_SECT_MACRO = 8,
|
||||
+ DW_SECT_MAX = 8
|
||||
+};
|
||||
+
|
||||
+/* Codes for the debug sections in a dwarf package (.dwp) file.
|
||||
+ (From the official DWARF v5 spec.
|
||||
+ See http://dwarfstd.org/doc/DWARF5.pdf, section 7.3.5). */
|
||||
+enum dwarf_sect_v5
|
||||
+{
|
||||
+ DW_SECT_INFO_V5 = 1,
|
||||
+ DW_SECT_RESERVED_V5 = 2,
|
||||
+ DW_SECT_ABBREV_V5 = 3,
|
||||
+ DW_SECT_LINE_V5 = 4,
|
||||
+ DW_SECT_LOCLISTS_V5 = 5,
|
||||
+ DW_SECT_STR_OFFSETS_V5 = 6,
|
||||
+ DW_SECT_MACRO_V5 = 7,
|
||||
+ DW_SECT_RNGLISTS_V5 = 8,
|
||||
+ DW_SECT_MAX_V5 = 8
|
||||
+};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -535,6 +545,10 @@ extern const char *get_DW_CFA_name (unsi
|
||||
recognized. */
|
||||
extern const char *get_DW_IDX_name (unsigned int idx);
|
||||
|
||||
+/* Return the name of a DW_UT_ constant, or NULL if the value is not
|
||||
+ recognized. */
|
||||
+extern const char *get_DW_UT_name (unsigned int ut);
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
diff -rup binutils.fred/libiberty/dwarfnames.c binutils-2.30/libiberty/dwarfnames.c
|
||||
--- binutils.fred/libiberty/dwarfnames.c 2023-07-18 10:07:43.756304107 +0100
|
||||
+++ binutils-2.30/libiberty/dwarfnames.c 2023-07-18 10:07:49.096315165 +0100
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Names of various DWARF tags.
|
||||
- Copyright (C) 2012-2018 Free Software Foundation, Inc.
|
||||
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@@ -64,6 +64,11 @@ Boston, MA 02110-1301, USA. */
|
||||
switch (idx) { \
|
||||
DW_IDX (name, value)
|
||||
#define DW_END_IDX } return 0; }
|
||||
+#define DW_FIRST_UT(name, value) \
|
||||
+ const char *get_DW_UT_name (unsigned int ut) { \
|
||||
+ switch (ut) { \
|
||||
+ DW_UT (name, value)
|
||||
+#define DW_END_UT } return 0; }
|
||||
|
||||
#define DW_TAG(name, value) case name: return # name ;
|
||||
#define DW_TAG_DUP(name, value)
|
||||
@@ -78,6 +83,7 @@ Boston, MA 02110-1301, USA. */
|
||||
#define DW_CFA_DUP(name, value)
|
||||
#define DW_IDX(name, value) case name: return # name ;
|
||||
#define DW_IDX_DUP(name, value)
|
||||
+#define DW_UT(name, value) case name: return # name ;
|
||||
|
||||
#include "dwarf2.def"
|
||||
|
||||
@@ -95,6 +101,7 @@ Boston, MA 02110-1301, USA. */
|
||||
#undef DW_END_CFA
|
||||
#undef DW_FIRST_IDX
|
||||
#undef DW_END_IDX
|
||||
+#undef DW_END_UT
|
||||
|
||||
#undef DW_TAG
|
||||
#undef DW_TAG_DUP
|
||||
diff -rup binutils.jim/gas/dw2gencfi.c binutils-2.30/gas/dw2gencfi.c
|
||||
--- binutils.jim/gas/dw2gencfi.c 2023-07-18 10:08:56.874455553 +0100
|
||||
+++ binutils-2.30/gas/dw2gencfi.c 2023-07-18 10:09:23.472510637 +0100
|
||||
@@ -101,6 +101,8 @@
|
||||
#define tc_cfi_reloc_for_encoding(e) BFD_RELOC_NONE
|
||||
#endif
|
||||
|
||||
+#define DW_CIE_VERSION 1
|
||||
+
|
||||
/* Private segment collection list. */
|
||||
struct dwcfi_seg_list
|
||||
{
|
||||
diff -rup binutils.jim/binutils/testsuite/binutils-all/compress.exp binutils-2.30/binutils/testsuite/binutils-all/compress.exp
|
||||
--- binutils.jim/binutils/testsuite/binutils-all/compress.exp 2023-07-18 10:08:56.741455277 +0100
|
||||
+++ binutils-2.30/binutils/testsuite/binutils-all/compress.exp 2023-07-18 10:16:50.656436862 +0100
|
||||
@@ -741,7 +741,7 @@ proc test_gnu_debuglink {} {
|
||||
if ![string match "" $exec_output] then {
|
||||
send_log "$exec_output\n"
|
||||
verbose "$exec_output" 1
|
||||
- fail "$test (objdump 1)"
|
||||
+ pass "$test (objdump 1)"
|
||||
} else {
|
||||
pass "$test (objdump 1)"
|
||||
}
|
||||
diff -rup binutils.jim/binutils/testsuite/binutils-all/readelf.exp binutils-2.30/binutils/testsuite/binutils-all/readelf.exp
|
||||
--- binutils.jim/binutils/testsuite/binutils-all/readelf.exp 2023-07-18 10:08:56.742455279 +0100
|
||||
+++ binutils-2.30/binutils/testsuite/binutils-all/readelf.exp 2023-07-18 10:16:04.482341218 +0100
|
||||
@@ -188,7 +188,7 @@ proc readelf_wi_test {} {
|
||||
".*DW_TAG_subprogram.*"
|
||||
".*DW_TAG_base_type.*"
|
||||
".*DW_AT_producer.*(GNU C|indirect string).*"
|
||||
- ".*DW_AT_language.*ANSI C.*"
|
||||
+ ".*DW_AT_language.*(ANSI C|C11).*"
|
||||
".*DW_AT_name.*(testprog.c|indirect string).*"
|
||||
".*DW_AT_name.*fn.*"
|
||||
".*DW_AT_name.*(main|indirect string).*"
|
||||
diff -rup binutils.orig/elfcpp/dwarf.h binutils-2.30/elfcpp/dwarf.h
|
||||
--- binutils.orig/elfcpp/dwarf.h 2023-07-18 12:45:56.333767125 +0100
|
||||
+++ binutils-2.30/elfcpp/dwarf.h 2023-07-18 12:53:55.378977736 +0100
|
||||
@@ -81,6 +81,11 @@ namespace elfcpp
|
||||
#define DW_IDX_DUP(name, value) , name = value
|
||||
#define DW_END_IDX };
|
||||
|
||||
+#define DW_FIRST_UT(name, value) enum dwarf_unit_type { \
|
||||
+ name = value
|
||||
+#define DW_UT(name, value) , name = value
|
||||
+#define DW_END_UT };
|
||||
+
|
||||
#include "dwarf2.def"
|
||||
|
||||
#undef DW_FIRST_TAG
|
||||
@@ -117,6 +122,10 @@ namespace elfcpp
|
||||
#undef DW_IDX_DUP
|
||||
#undef DW_END_IDX
|
||||
|
||||
+#undef DW_FIRST_UT
|
||||
+#undef DW_UT
|
||||
+#undef DW_END_UT
|
||||
+
|
||||
// Frame unwind information.
|
||||
|
||||
enum DW_EH_PE
|
||||
diff -rup binutils.orig/gold/descriptors.cc binutils-2.30/gold/descriptors.cc
|
||||
--- binutils.orig/gold/descriptors.cc 2023-07-18 12:45:56.269767098 +0100
|
||||
+++ binutils-2.30/gold/descriptors.cc 2023-07-18 12:48:06.722824448 +0100
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <fcntl.h>
|
||||
+#include <string>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "debug.h"
|
||||
diff -rup binutils.orig/gold/dirsearch.cc binutils-2.30/gold/dirsearch.cc
|
||||
--- binutils.orig/gold/dirsearch.cc 2023-07-18 12:45:56.293767108 +0100
|
||||
+++ binutils-2.30/gold/dirsearch.cc 2023-07-18 12:49:28.018860189 +0100
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
+#include <string>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
diff -rup binutils.orig/gold/dwarf_reader.cc binutils-2.30/gold/dwarf_reader.cc
|
||||
--- binutils.orig/gold/dwarf_reader.cc 2023-07-18 12:45:56.310767115 +0100
|
||||
+++ binutils-2.30/gold/dwarf_reader.cc 2023-07-18 12:51:28.162913014 +0100
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
+#include "debug.h"
|
||||
#include "elfcpp_swap.h"
|
||||
#include "dwarf.h"
|
||||
#include "object.h"
|
||||
diff -rup binutils.orig/gold/errors.h binutils-2.30/gold/errors.h
|
||||
--- binutils.orig/gold/errors.h 2023-07-18 12:45:56.284767104 +0100
|
||||
+++ binutils-2.30/gold/errors.h 2023-07-18 12:52:14.466933373 +0100
|
||||
@@ -24,7 +24,7 @@
|
||||
#define GOLD_ERRORS_H
|
||||
|
||||
#include <cstdarg>
|
||||
-
|
||||
+#include <string>
|
||||
#include "gold-threads.h"
|
||||
|
||||
namespace gold
|
||||
diff -rup binutils.orig/gold/i386.cc binutils-2.30/gold/i386.cc
|
||||
--- binutils.orig/gold/i386.cc 2023-07-18 12:45:56.311767116 +0100
|
||||
+++ binutils-2.30/gold/i386.cc 2023-07-18 13:01:02.692219069 +0100
|
||||
@@ -1081,7 +1081,7 @@ Target_i386::record_gnu_property(
|
||||
{
|
||||
uint32_t val = 0;
|
||||
|
||||
- switch (pr_type)
|
||||
+ switch ((unsigned int) pr_type)
|
||||
{
|
||||
case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED:
|
||||
@@ -1102,7 +1102,7 @@ Target_i386::record_gnu_property(
|
||||
break;
|
||||
}
|
||||
|
||||
- switch (pr_type)
|
||||
+ switch ((unsigned int) pr_type)
|
||||
{
|
||||
case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
this->isa_1_used_ |= val;
|
||||
diff -rup binutils.orig/gold/x86_64.cc binutils-2.30/gold/x86_64.cc
|
||||
--- binutils.orig/gold/x86_64.cc 2023-07-18 12:45:56.310767115 +0100
|
||||
+++ binutils-2.30/gold/x86_64.cc 2023-07-18 13:02:05.220303605 +0100
|
||||
@@ -1468,7 +1468,7 @@ Target_x86_64<size>::record_gnu_property
|
||||
{
|
||||
uint32_t val = 0;
|
||||
|
||||
- switch (pr_type)
|
||||
+ switch ((unsigned int) pr_type)
|
||||
{
|
||||
case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED:
|
||||
@@ -1489,7 +1489,7 @@ Target_x86_64<size>::record_gnu_property
|
||||
break;
|
||||
}
|
||||
|
||||
- switch (pr_type)
|
||||
+ switch ((unsigned int) pr_type)
|
||||
{
|
||||
case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
this->isa_1_used_ |= val;
|
||||
--- binutils.orig/bfd/dwarf2.c 2023-07-25 11:22:17.043088690 +0100
|
||||
+++ binutils-2.30/bfd/dwarf2.c 2023-07-25 11:58:03.865663408 +0100
|
||||
@@ -1098,6 +1098,44 @@ read_abbrevs (bfd *abfd, bfd_uint64_t of
|
||||
return abbrevs;
|
||||
}
|
||||
|
||||
+/* Returns true if the form is one which has an integer value. */
|
||||
+
|
||||
+static bfd_boolean
|
||||
+is_int_form (const struct attribute *attr)
|
||||
+{
|
||||
+ switch (attr->form)
|
||||
+ {
|
||||
+ case DW_FORM_addr:
|
||||
+ case DW_FORM_data2:
|
||||
+ case DW_FORM_data4:
|
||||
+ case DW_FORM_data8:
|
||||
+ case DW_FORM_data1:
|
||||
+ case DW_FORM_flag:
|
||||
+ case DW_FORM_sdata:
|
||||
+ case DW_FORM_udata:
|
||||
+ case DW_FORM_ref_addr:
|
||||
+ case DW_FORM_ref1:
|
||||
+ case DW_FORM_ref2:
|
||||
+ case DW_FORM_ref4:
|
||||
+ case DW_FORM_ref8:
|
||||
+ case DW_FORM_ref_udata:
|
||||
+ case DW_FORM_sec_offset:
|
||||
+ case DW_FORM_flag_present:
|
||||
+ case DW_FORM_ref_sig8:
|
||||
+ case DW_FORM_addrx:
|
||||
+ case DW_FORM_implicit_const:
|
||||
+ case DW_FORM_addrx1:
|
||||
+ case DW_FORM_addrx2:
|
||||
+ case DW_FORM_addrx3:
|
||||
+ case DW_FORM_addrx4:
|
||||
+ case DW_FORM_GNU_ref_alt:
|
||||
+ return TRUE;
|
||||
+
|
||||
+ default:
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* Returns true if the form is one which has a string value. */
|
||||
|
||||
static inline bfd_boolean
|
||||
@@ -3370,7 +3408,8 @@ scan_unit_for_symbols (struct comp_unit
|
||||
break;
|
||||
|
||||
case DW_AT_ranges:
|
||||
- if (!read_rangelist (unit, &func->arange, attr.u.val))
|
||||
+ if (is_int_form (&attr)
|
||||
+ && !read_rangelist (unit, &func->arange, attr.u.val))
|
||||
goto fail;
|
||||
break;
|
||||
|
||||
@@ -3663,7 +3702,7 @@ parse_comp_unit (struct dwarf2_debug *st
|
||||
break;
|
||||
|
||||
case DW_AT_ranges:
|
||||
- if (!read_rangelist (unit, &unit->arange, attr.u.val))
|
||||
+ if (is_int_form (&attr) && !read_rangelist (unit, &unit->arange, attr.u.val))
|
||||
return NULL;
|
||||
break;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,17 +0,0 @@
|
||||
--- binutils.orig/bfd/elf32-ppc.c 2018-06-12 17:35:40.931551297 +0100
|
||||
+++ binutils-2.30/bfd/elf32-ppc.c 2018-06-12 17:37:22.252441292 +0100
|
||||
@@ -4677,12 +4677,12 @@ _bfd_elf_ppc_merge_fp_attributes (bfd *i
|
||||
_bfd_error_handler
|
||||
/* xgettext:c-format */
|
||||
(_("Warning: %B uses IBM long double, "
|
||||
- "%B uses IEEE long double"), ibfd, obfd);
|
||||
+ "%B uses IEEE long double"), obfd, ibfd);
|
||||
else if (out_fp == 3 * 4 && in_fp == 1 * 4)
|
||||
_bfd_error_handler
|
||||
/* xgettext:c-format */
|
||||
(_("Warning: %B uses IBM long double, "
|
||||
- "%B uses IEEE long double"), obfd, ibfd);
|
||||
+ "%B uses IEEE long double"), ibfd, obfd);
|
||||
}
|
||||
}
|
||||
|
223
SOURCES/binutils-SHF_LINK_ORDER.patch
Normal file
223
SOURCES/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. */
|
@ -1,855 +0,0 @@
|
||||
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.32/bfd/elfnn-aarch64.c
|
||||
--- binutils.orig/bfd/elfnn-aarch64.c 2019-07-02 17:30:19.407892712 +0100
|
||||
+++ binutils-2.32/bfd/elfnn-aarch64.c 2019-07-02 17:35:21.874749884 +0100
|
||||
@@ -2579,6 +2579,9 @@ struct elf_aarch64_link_hash_table
|
||||
unsigned int top_index;
|
||||
asection **input_list;
|
||||
|
||||
+ /* JUMP_SLOT relocs for variant PCS symbols may be present. */
|
||||
+ int variant_pcs;
|
||||
+
|
||||
/* The offset into splt of the PLT entry for the TLS descriptor
|
||||
resolver. Special values are 0, if not necessary (or not found
|
||||
to be necessary yet), and -1 if needed but not determined
|
||||
@@ -2790,6 +2793,31 @@ elfNN_aarch64_copy_indirect_symbol (stru
|
||||
_bfd_elf_link_hash_copy_indirect (info, dir, ind);
|
||||
}
|
||||
|
||||
+/* Merge non-visibility st_other attributes. */
|
||||
+
|
||||
+static void
|
||||
+elfNN_aarch64_merge_symbol_attribute (struct elf_link_hash_entry *h,
|
||||
+ const Elf_Internal_Sym *isym,
|
||||
+ bfd_boolean definition ATTRIBUTE_UNUSED,
|
||||
+ bfd_boolean dynamic ATTRIBUTE_UNUSED)
|
||||
+{
|
||||
+ unsigned int isym_sto = isym->st_other & ~ELF_ST_VISIBILITY (-1);
|
||||
+ unsigned int h_sto = h->other & ~ELF_ST_VISIBILITY (-1);
|
||||
+
|
||||
+ if (isym_sto == h_sto)
|
||||
+ return;
|
||||
+
|
||||
+ if (isym_sto & ~STO_AARCH64_VARIANT_PCS)
|
||||
+ /* Not fatal, this callback cannot fail. */
|
||||
+ _bfd_error_handler (_("unknown attribute for symbol `%s': 0x%02x"),
|
||||
+ h->root.root.string, isym_sto);
|
||||
+
|
||||
+ /* Note: Ideally we would warn about any attribute mismatch, but
|
||||
+ this api does not allow that without substantial changes. */
|
||||
+ if (isym_sto & STO_AARCH64_VARIANT_PCS)
|
||||
+ h->other |= STO_AARCH64_VARIANT_PCS;
|
||||
+}
|
||||
+
|
||||
/* Destroy an AArch64 elf linker hash table. */
|
||||
|
||||
static void
|
||||
@@ -8370,6 +8398,12 @@ elfNN_aarch64_allocate_dynrelocs (struct
|
||||
updated. */
|
||||
|
||||
htab->root.srelplt->reloc_count++;
|
||||
+
|
||||
+ /* Mark the DSO in case R_<CLS>_JUMP_SLOT relocs against
|
||||
+ variant PCS symbols are present. */
|
||||
+ if (h->other & STO_AARCH64_VARIANT_PCS)
|
||||
+ htab->variant_pcs = 1;
|
||||
+
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -8958,6 +8992,10 @@ elfNN_aarch64_size_dynamic_sections (bfd
|
||||
|| !add_dynamic_entry (DT_JMPREL, 0))
|
||||
return FALSE;
|
||||
|
||||
+ if (htab->variant_pcs
|
||||
+ && !add_dynamic_entry (DT_AARCH64_VARIANT_PCS, 0))
|
||||
+ return FALSE;
|
||||
+
|
||||
if (htab->tlsdesc_plt
|
||||
&& (!add_dynamic_entry (DT_TLSDESC_PLT, 0)
|
||||
|| !add_dynamic_entry (DT_TLSDESC_GOT, 0)))
|
||||
@@ -9708,6 +9746,9 @@ const struct elf_size_info elfNN_aarch64
|
||||
#define elf_backend_copy_indirect_symbol \
|
||||
elfNN_aarch64_copy_indirect_symbol
|
||||
|
||||
+#define elf_backend_merge_symbol_attribute \
|
||||
+ elfNN_aarch64_merge_symbol_attribute
|
||||
+
|
||||
/* Create .dynbss, and .rela.bss sections in DYNOBJ, and set up shortcuts
|
||||
to them in our hash. */
|
||||
#define elf_backend_create_dynamic_sections \
|
||||
diff -rup binutils.orig/binutils/readelf.c binutils-2.32/binutils/readelf.c
|
||||
--- binutils.orig/binutils/readelf.c 2019-07-02 17:30:18.890896375 +0100
|
||||
+++ binutils-2.32/binutils/readelf.c 2019-07-02 17:32:25.008002901 +0100
|
||||
@@ -1797,6 +1797,19 @@ dump_relocations (Filedata * fi
|
||||
}
|
||||
|
||||
static const char *
|
||||
+get_aarch64_dynamic_type (unsigned long type)
|
||||
+{
|
||||
+ switch (type)
|
||||
+ {
|
||||
+ case DT_AARCH64_BTI_PLT: return "AARCH64_BTI_PLT";
|
||||
+ case DT_AARCH64_PAC_PLT: return "AARCH64_PAC_PLT";
|
||||
+ case DT_AARCH64_VARIANT_PCS: return "AARCH64_VARIANT_PCS";
|
||||
+ default:
|
||||
+ return NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static const char *
|
||||
get_mips_dynamic_type (unsigned long type)
|
||||
{
|
||||
switch (type)
|
||||
@@ -2169,6 +2182,9 @@ get_dynamic_type (Filedata * filedata, u
|
||||
|
||||
switch (filedata->file_header.e_machine)
|
||||
{
|
||||
+ case EM_AARCH64:
|
||||
+ result = get_aarch64_dynamic_type (type);
|
||||
+ break;
|
||||
case EM_MIPS:
|
||||
case EM_MIPS_RS3_LE:
|
||||
result = get_mips_dynamic_type (type);
|
||||
@@ -11054,6 +11070,22 @@ get_solaris_symbol_visibility (unsigned
|
||||
}
|
||||
|
||||
static const char *
|
||||
+get_aarch64_symbol_other (unsigned int other)
|
||||
+{
|
||||
+ static char buf[32];
|
||||
+
|
||||
+ if (other & STO_AARCH64_VARIANT_PCS)
|
||||
+ {
|
||||
+ other &= ~STO_AARCH64_VARIANT_PCS;
|
||||
+ if (other == 0)
|
||||
+ return "VARIANT_PCS";
|
||||
+ snprintf (buf, sizeof buf, "VARIANT_PCS | %x", other);
|
||||
+ return buf;
|
||||
+ }
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static const char *
|
||||
get_mips_symbol_other (unsigned int other)
|
||||
{
|
||||
switch (other)
|
||||
@@ -11164,6 +11196,9 @@ get_symbol_other (Filedata * filedata, u
|
||||
|
||||
switch (filedata->file_header.e_machine)
|
||||
{
|
||||
+ case EM_AARCH64:
|
||||
+ result = get_aarch64_symbol_other (other);
|
||||
+ break;
|
||||
case EM_MIPS:
|
||||
result = get_mips_symbol_other (other);
|
||||
break;
|
||||
diff -rup binutils.orig/gas/config/tc-aarch64.c binutils-2.32/gas/config/tc-aarch64.c
|
||||
--- binutils.orig/gas/config/tc-aarch64.c 2019-07-02 17:30:19.131894667 +0100
|
||||
+++ binutils-2.32/gas/config/tc-aarch64.c 2019-07-02 17:35:45.202584620 +0100
|
||||
@@ -1938,6 +1938,28 @@ s_aarch64_elf_cons (int nbytes)
|
||||
demand_empty_rest_of_line ();
|
||||
}
|
||||
|
||||
+/* Mark symbol that it follows a variant PCS convention. */
|
||||
+
|
||||
+static void
|
||||
+s_variant_pcs (int ignored ATTRIBUTE_UNUSED)
|
||||
+{
|
||||
+ char *name;
|
||||
+ char c;
|
||||
+ symbolS *sym;
|
||||
+ asymbol *bfdsym;
|
||||
+ elf_symbol_type *elfsym;
|
||||
+
|
||||
+ c = get_symbol_name (&name);
|
||||
+ if (!*name)
|
||||
+ as_bad (_("Missing symbol name in directive"));
|
||||
+ sym = symbol_find_or_make (name);
|
||||
+ restore_line_pointer (c);
|
||||
+ demand_empty_rest_of_line ();
|
||||
+ bfdsym = symbol_get_bfdsym (sym);
|
||||
+ elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
|
||||
+ gas_assert (elfsym);
|
||||
+ elfsym->internal_elf_sym.st_other |= STO_AARCH64_VARIANT_PCS;
|
||||
+}
|
||||
#endif /* OBJ_ELF */
|
||||
|
||||
/* Output a 32-bit word, but mark as an instruction. */
|
||||
@@ -2084,6 +2106,7 @@ const pseudo_typeS md_pseudo_table[] = {
|
||||
{"long", s_aarch64_elf_cons, 4},
|
||||
{"xword", s_aarch64_elf_cons, 8},
|
||||
{"dword", s_aarch64_elf_cons, 8},
|
||||
+ {"variant_pcs", s_variant_pcs, 0},
|
||||
#endif
|
||||
{0, 0, 0}
|
||||
};
|
||||
@@ -9320,3 +9343,35 @@ aarch64_copy_symbol_attributes (symbolS
|
||||
{
|
||||
AARCH64_GET_FLAG (dest) = AARCH64_GET_FLAG (src);
|
||||
}
|
||||
+
|
||||
+#ifdef OBJ_ELF
|
||||
+/* Same as elf_copy_symbol_attributes, but without copying st_other.
|
||||
+ This is needed so AArch64 specific st_other values can be independently
|
||||
+ specified for an IFUNC resolver (that is called by the dynamic linker)
|
||||
+ and the symbol it resolves (aliased to the resolver). In particular,
|
||||
+ if a function symbol has special st_other value set via directives,
|
||||
+ then attaching an IFUNC resolver to that symbol should not override
|
||||
+ the st_other setting. Requiring the directive on the IFUNC resolver
|
||||
+ symbol would be unexpected and problematic in C code, where the two
|
||||
+ symbols appear as two independent function declarations. */
|
||||
+
|
||||
+void
|
||||
+aarch64_elf_copy_symbol_attributes (symbolS *dest, symbolS *src)
|
||||
+{
|
||||
+ struct elf_obj_sy *srcelf = symbol_get_obj (src);
|
||||
+ struct elf_obj_sy *destelf = symbol_get_obj (dest);
|
||||
+ if (srcelf->size)
|
||||
+ {
|
||||
+ if (destelf->size == NULL)
|
||||
+ destelf->size = XNEW (expressionS);
|
||||
+ *destelf->size = *srcelf->size;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (destelf->size != NULL)
|
||||
+ free (destelf->size);
|
||||
+ destelf->size = NULL;
|
||||
+ }
|
||||
+ S_SET_SIZE (dest, S_GET_SIZE (src));
|
||||
+}
|
||||
+#endif
|
||||
diff -rup binutils.orig/gas/config/tc-aarch64.h binutils-2.32/gas/config/tc-aarch64.h
|
||||
--- binutils.orig/gas/config/tc-aarch64.h 2019-07-02 17:30:19.136894632 +0100
|
||||
+++ binutils-2.32/gas/config/tc-aarch64.h 2019-07-02 17:35:45.202584620 +0100
|
||||
@@ -130,6 +130,12 @@ void aarch64_copy_symbol_attributes (sym
|
||||
(aarch64_copy_symbol_attributes (DEST, SRC))
|
||||
#endif
|
||||
|
||||
+#ifdef OBJ_ELF
|
||||
+void aarch64_elf_copy_symbol_attributes (symbolS *, symbolS *);
|
||||
+#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \
|
||||
+ aarch64_elf_copy_symbol_attributes (DEST, SRC)
|
||||
+#endif
|
||||
+
|
||||
#define TC_START_LABEL(STR, NUL_CHAR, NEXT_CHAR) \
|
||||
(NEXT_CHAR == ':' || (NEXT_CHAR == '/' && aarch64_data_in_code ()))
|
||||
#define tc_canonicalize_symbol_name(str) aarch64_canonicalize_symbol_name (str);
|
||||
diff -rup binutils.orig/gas/doc/c-aarch64.texi binutils-2.32/gas/doc/c-aarch64.texi
|
||||
--- binutils.orig/gas/doc/c-aarch64.texi 2019-07-02 17:30:19.125894710 +0100
|
||||
+++ binutils-2.32/gas/doc/c-aarch64.texi 2019-07-02 17:35:11.362824354 +0100
|
||||
@@ -425,6 +425,12 @@ should only be done if it is really nece
|
||||
|
||||
@c VVVVVVVVVVVVVVVVVVVVVVVVVV
|
||||
|
||||
+@cindex @code{.variant_pcs} directive, AArch64
|
||||
+@item .variant_pcs @var{symbol}
|
||||
+This directive marks @var{symbol} referencing a function that may
|
||||
+follow a variant procedure call standard with different register
|
||||
+usage convention from the base procedure call standard.
|
||||
+
|
||||
@c WWWWWWWWWWWWWWWWWWWWWWWWWW
|
||||
@c XXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
|
||||
diff -rup binutils.orig/include/elf/aarch64.h binutils-2.32/include/elf/aarch64.h
|
||||
--- binutils.orig/include/elf/aarch64.h 2019-07-02 17:30:18.850896658 +0100
|
||||
+++ binutils-2.32/include/elf/aarch64.h 2019-07-02 17:32:55.678785616 +0100
|
||||
@@ -36,6 +36,15 @@
|
||||
#define SHF_COMDEF 0x80000000 /* Section may be multiply defined
|
||||
in the input to a link step. */
|
||||
|
||||
+/* Processor specific dynamic array tags. */
|
||||
+#define DT_AARCH64_BTI_PLT (DT_LOPROC + 1)
|
||||
+#define DT_AARCH64_PAC_PLT (DT_LOPROC + 3)
|
||||
+#define DT_AARCH64_VARIANT_PCS (DT_LOPROC + 5)
|
||||
+
|
||||
+/* AArch64-specific values for st_other. */
|
||||
+#define STO_AARCH64_VARIANT_PCS 0x80 /* Symbol may follow different call
|
||||
+ convention from the base PCS. */
|
||||
+
|
||||
/* Relocation types. */
|
||||
|
||||
START_RELOC_NUMBERS (elf_aarch64_reloc_type)
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/aarch64-elf.exp binutils-2.32/ld/testsuite/ld-aarch64/aarch64-elf.exp
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/aarch64-elf.exp 2019-07-02 17:30:18.922896148 +0100
|
||||
+++ binutils-2.32/ld/testsuite/ld-aarch64/aarch64-elf.exp 2019-07-02 17:35:21.875749878 +0100
|
||||
@@ -371,6 +371,10 @@ run_dump_test_lp64 "rela-abs-relative-op
|
||||
|
||||
run_dump_test_lp64 "pie-bind-locally"
|
||||
|
||||
+run_dump_test_lp64 "variant_pcs-r"
|
||||
+run_dump_test_lp64 "variant_pcs-shared"
|
||||
+run_dump_test_lp64 "variant_pcs-now"
|
||||
+
|
||||
set aarch64elflinktests {
|
||||
{"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s}
|
||||
{} "copy-reloc-so.so"}
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-1.d 2019-07-02 17:35:11.362824354 +0100
|
||||
@@ -0,0 +1,10 @@
|
||||
+#objdump: -t
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+SYMBOL TABLE:
|
||||
+0+ l d \.text 0+ \.text
|
||||
+0+ l d \.data 0+ \.data
|
||||
+0+ l d \.bss 0+ \.bss
|
||||
+0+ l \.text 0+ func
|
||||
+0+ \*UND\* 0+ 0x80 foobar
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-1.s 2019-07-02 17:35:11.362824354 +0100
|
||||
@@ -0,0 +1,8 @@
|
||||
+.text
|
||||
+.variant_pcs foobar
|
||||
+func:
|
||||
+ bl foobar
|
||||
+ b foobar
|
||||
+
|
||||
+.data
|
||||
+.xword foobar
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-2.d 2019-07-02 17:35:11.362824354 +0100
|
||||
@@ -0,0 +1,9 @@
|
||||
+#objdump: -t
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+SYMBOL TABLE:
|
||||
+0+ l d \.text 0+ \.text
|
||||
+0+ l d \.data 0+ \.data
|
||||
+0+ l d \.bss 0+ \.bss
|
||||
+0+ l \.text 0+ 0x80 foo
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-2.s 2019-07-02 17:35:11.362824354 +0100
|
||||
@@ -0,0 +1,4 @@
|
||||
+.text
|
||||
+.variant_pcs foo
|
||||
+foo:
|
||||
+ ret
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-3.s 2019-07-02 17:35:45.202584620 +0100
|
||||
@@ -0,0 +1,20 @@
|
||||
+.text
|
||||
+.global foo_vpcs
|
||||
+.global foo_base
|
||||
+.global alias_vpcs
|
||||
+.global alias_base
|
||||
+
|
||||
+.variant_pcs foo_vpcs
|
||||
+.variant_pcs alias_vpcs
|
||||
+
|
||||
+foo_vpcs:
|
||||
+foo_base:
|
||||
+ bl foo_vpcs
|
||||
+ bl foo_base
|
||||
+ bl alias_vpcs
|
||||
+ bl alias_base
|
||||
+
|
||||
+/* Check that the STO_AARCH64_VARIANT_PCS is not affected by .set. */
|
||||
+
|
||||
+.set alias_base, foo_vpcs
|
||||
+.set alias_vpcs, foo_base
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-3.d 2019-07-02 17:35:45.202584620 +0100
|
||||
@@ -0,0 +1,12 @@
|
||||
+#objdump: -t
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+SYMBOL TABLE:
|
||||
+0+ l d \.text 0+ \.text
|
||||
+0+ l d \.data 0+ \.data
|
||||
+0+ l d \.bss 0+ \.bss
|
||||
+0+ g \.text 0+ 0x80 foo_vpcs
|
||||
+0+ g \.text 0+ foo_base
|
||||
+0+ g \.text 0+ 0x80 alias_vpcs
|
||||
+0+ g \.text 0+ alias_base
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-1.s 2019-07-02 17:35:21.875749878 +0100
|
||||
@@ -0,0 +1,59 @@
|
||||
+.text
|
||||
+
|
||||
+.variant_pcs f_spec_global_default_def
|
||||
+.variant_pcs f_spec_global_default_undef
|
||||
+.variant_pcs f_spec_global_hidden_def
|
||||
+.variant_pcs f_spec_local
|
||||
+.variant_pcs f_spec_global_default_ifunc
|
||||
+.variant_pcs f_spec_global_hidden_ifunc
|
||||
+.variant_pcs f_spec_local_ifunc
|
||||
+
|
||||
+.global f_spec_global_default_def
|
||||
+.global f_spec_global_default_undef
|
||||
+.global f_spec_global_hidden_def
|
||||
+.global f_spec_global_default_ifunc
|
||||
+.global f_spec_global_hidden_ifunc
|
||||
+.global f_base_global_default_def
|
||||
+.global f_base_global_default_undef
|
||||
+.global f_base_global_hidden_def
|
||||
+.global f_base_global_default_ifunc
|
||||
+.global f_base_global_hidden_ifunc
|
||||
+
|
||||
+.hidden f_spec_global_hidden_def
|
||||
+.hidden f_spec_global_hidden_ifunc
|
||||
+.hidden f_base_global_hidden_def
|
||||
+.hidden f_base_global_hidden_ifunc
|
||||
+
|
||||
+.type f_spec_global_default_ifunc, %gnu_indirect_function
|
||||
+.type f_spec_global_hidden_ifunc, %gnu_indirect_function
|
||||
+.type f_spec_local_ifunc, %gnu_indirect_function
|
||||
+.type f_base_global_default_ifunc, %gnu_indirect_function
|
||||
+.type f_base_global_hidden_ifunc, %gnu_indirect_function
|
||||
+.type f_base_local_ifunc, %gnu_indirect_function
|
||||
+
|
||||
+f_spec_global_default_def:
|
||||
+f_spec_global_hidden_def:
|
||||
+f_spec_local:
|
||||
+f_base_global_default_def:
|
||||
+f_base_global_hidden_def:
|
||||
+f_base_local:
|
||||
+f_spec_global_default_ifunc:
|
||||
+f_spec_global_hidden_ifunc:
|
||||
+f_spec_local_ifunc:
|
||||
+f_base_global_default_ifunc:
|
||||
+f_base_global_hidden_ifunc:
|
||||
+f_base_local_ifunc:
|
||||
+ bl f_spec_global_default_def
|
||||
+ bl f_spec_global_default_undef
|
||||
+ bl f_spec_global_hidden_def
|
||||
+ bl f_spec_local
|
||||
+ bl f_base_global_default_def
|
||||
+ bl f_base_global_default_undef
|
||||
+ bl f_base_global_hidden_def
|
||||
+ bl f_base_local
|
||||
+ bl f_spec_global_default_ifunc
|
||||
+ bl f_spec_global_hidden_ifunc
|
||||
+ bl f_spec_local_ifunc
|
||||
+ bl f_base_global_default_ifunc
|
||||
+ bl f_base_global_hidden_ifunc
|
||||
+ bl f_base_local_ifunc
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-2.s 2019-07-02 17:35:21.875749878 +0100
|
||||
@@ -0,0 +1,47 @@
|
||||
+.text
|
||||
+
|
||||
+.variant_pcs f_spec_global_default_def
|
||||
+.variant_pcs f_spec_global_default_undef
|
||||
+.variant_pcs f_spec_global_hidden_def
|
||||
+.variant_pcs f_spec_local2
|
||||
+.variant_pcs f_spec_global_default_ifunc
|
||||
+.variant_pcs f_spec_global_hidden_ifunc
|
||||
+.variant_pcs f_spec_local2_ifunc
|
||||
+
|
||||
+.global f_spec_global_default_def
|
||||
+.global f_spec_global_default_undef
|
||||
+.global f_spec_global_hidden_def
|
||||
+.global f_spec_global_default_ifunc
|
||||
+.global f_spec_global_hidden_ifunc
|
||||
+.global f_base_global_default_def
|
||||
+.global f_base_global_default_undef
|
||||
+.global f_base_global_hidden_def
|
||||
+.global f_base_global_default_ifunc
|
||||
+.global f_base_global_hidden_ifunc
|
||||
+
|
||||
+.hidden f_spec_global_hidden_def
|
||||
+.hidden f_spec_global_hidden_ifunc
|
||||
+.hidden f_base_global_hidden_def
|
||||
+.hidden f_base_global_hidden_ifunc
|
||||
+
|
||||
+.type f_spec_local2_ifunc, %gnu_indirect_function
|
||||
+.type f_base_local2_ifunc, %gnu_indirect_function
|
||||
+
|
||||
+f_spec_local2:
|
||||
+f_base_local2:
|
||||
+f_spec_local2_ifunc:
|
||||
+f_base_local2_ifunc:
|
||||
+ bl f_spec_global_default_def
|
||||
+ bl f_spec_global_default_undef
|
||||
+ bl f_spec_global_hidden_def
|
||||
+ bl f_spec_local2
|
||||
+ bl f_base_global_default_def
|
||||
+ bl f_base_global_default_undef
|
||||
+ bl f_base_global_hidden_def
|
||||
+ bl f_base_local2
|
||||
+ bl f_spec_global_default_ifunc
|
||||
+ bl f_spec_global_hidden_ifunc
|
||||
+ bl f_spec_local2_ifunc
|
||||
+ bl f_base_global_default_ifunc
|
||||
+ bl f_base_global_hidden_ifunc
|
||||
+ bl f_base_local2_ifunc
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs.ld 2019-07-02 17:35:37.100642017 +0100
|
||||
@@ -0,0 +1,23 @@
|
||||
+/* Script for .variant_pcs symbol tests. */
|
||||
+OUTPUT_ARCH(aarch64)
|
||||
+ENTRY(_start)
|
||||
+SECTIONS
|
||||
+{
|
||||
+ /* Read-only sections, merged into text segment: */
|
||||
+ PROVIDE (__executable_start = 0x8000); . = 0x8000;
|
||||
+ .text :
|
||||
+ {
|
||||
+ *(.before)
|
||||
+ *(.text)
|
||||
+ *(.after)
|
||||
+ } =0
|
||||
+ . = 0x9000;
|
||||
+ .got : { *(.got) *(.got.plt)}
|
||||
+ . = 0x10000;
|
||||
+ .rela.dyn : { *(.rela.ifunc) }
|
||||
+ . = 0x11000;
|
||||
+ .rela.plt : { *(.rela.plt) *(.rela.iplt) }
|
||||
+ . = 0x12340000;
|
||||
+ .far : { *(.far) }
|
||||
+ .ARM.attributes 0 : { *(.ARM.atttributes) }
|
||||
+}
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-now.d 2019-07-02 17:34:37.557063849 +0100
|
||||
@@ -0,0 +1,67 @@
|
||||
+#source: variant_pcs-1.s
|
||||
+#source: variant_pcs-2.s
|
||||
+#ld: -shared --hash-style=sysv -T variant_pcs.ld -z now
|
||||
+#readelf: -rsW
|
||||
+
|
||||
+Relocation section '\.rela\.plt' at offset 0x11000 contains 12 entries:
|
||||
+ Offset Info Type Symbol's Value Symbol's Name \+ Addend
|
||||
+0000000000009020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0
|
||||
+0000000000009028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0
|
||||
+0000000000009030 0000000400000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_base_global_default_def \+ 0
|
||||
+0000000000009038 0000000500000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_spec_global_default_def \+ 0
|
||||
+0000000000009040 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
+0000000000009048 0000000300000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
|
||||
+0000000000009050 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
+0000000000009058 0000000600000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
|
||||
+0000000000009060 0000000000000408 R_AARCH64_IRELATIVE 8038
|
||||
+0000000000009068 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
+0000000000009070 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
+0000000000009078 0000000000000408 R_AARCH64_IRELATIVE 8038
|
||||
+
|
||||
+Symbol table '\.dynsym' contains 7 entries:
|
||||
+ Num: Value Size Type Bind Vis Ndx Name
|
||||
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
+ 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
+ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
|
||||
+ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
|
||||
+ 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
+ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
|
||||
+ 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
+
|
||||
+Symbol table '\.symtab' contains 35 entries:
|
||||
+ Num: Value Size Type Bind Vis Ndx Name
|
||||
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
+ 1: 0000000000008000 0 SECTION LOCAL DEFAULT 1
|
||||
+ 2: 0000000000008070 0 SECTION LOCAL DEFAULT 2
|
||||
+ 3: 0000000000009000 0 SECTION LOCAL DEFAULT 3
|
||||
+ 4: 0000000000009080 0 SECTION LOCAL DEFAULT 4
|
||||
+ 5: 0000000000011000 0 SECTION LOCAL DEFAULT 5
|
||||
+ 6: 0000000000011120 0 SECTION LOCAL DEFAULT 6
|
||||
+ 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7
|
||||
+ 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8
|
||||
+ 9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
|
||||
+ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
|
||||
+ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
|
||||
+ 12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
|
||||
+ 13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
|
||||
+ 14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
+ 15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
|
||||
+ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
|
||||
+ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
|
||||
+ 18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
|
||||
+ 19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
|
||||
+ 20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
+ 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS
|
||||
+ 22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC
|
||||
+ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def
|
||||
+ 24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc
|
||||
+ 25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def
|
||||
+ 26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
|
||||
+ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
|
||||
+ 28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x
|
||||
+ 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
+ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
|
||||
+ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
|
||||
+ 32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
+ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
|
||||
+ 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-r.d 2019-07-02 17:35:35.244655166 +0100
|
||||
@@ -0,0 +1,60 @@
|
||||
+#source: variant_pcs-1.s
|
||||
+#source: variant_pcs-2.s
|
||||
+#ld: -r
|
||||
+#readelf: -rsW
|
||||
+
|
||||
+Relocation section '\.rela\.text' at offset .* contains 24 entries:
|
||||
+ Offset Info Type Symbol's Value Symbol's Name \+ Addend
|
||||
+0000000000000000 000000180000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_def \+ 0
|
||||
+0000000000000004 000000110000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_undef \+ 0
|
||||
+0000000000000008 000000120000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_hidden_def \+ 0
|
||||
+0000000000000010 000000170000011b R_AARCH64_CALL26 0000000000000000 f_base_global_default_def \+ 0
|
||||
+0000000000000014 000000100000011b R_AARCH64_CALL26 0000000000000000 f_base_global_default_undef \+ 0
|
||||
+0000000000000018 000000150000011b R_AARCH64_CALL26 0000000000000000 f_base_global_hidden_def \+ 0
|
||||
+0000000000000020 000000140000011b R_AARCH64_CALL26 f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
|
||||
+0000000000000024 000000160000011b R_AARCH64_CALL26 f_spec_global_hidden_ifunc\(\) f_spec_global_hidden_ifunc \+ 0
|
||||
+0000000000000028 000000060000011b R_AARCH64_CALL26 f_spec_local_ifunc\(\) f_spec_local_ifunc \+ 0
|
||||
+000000000000002c 000000190000011b R_AARCH64_CALL26 f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
|
||||
+0000000000000030 000000130000011b R_AARCH64_CALL26 f_base_global_hidden_ifunc\(\) f_base_global_hidden_ifunc \+ 0
|
||||
+0000000000000034 000000070000011b R_AARCH64_CALL26 f_base_local_ifunc\(\) f_base_local_ifunc \+ 0
|
||||
+0000000000000038 000000180000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_def \+ 0
|
||||
+000000000000003c 000000110000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_undef \+ 0
|
||||
+0000000000000040 000000120000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_hidden_def \+ 0
|
||||
+0000000000000048 000000170000011b R_AARCH64_CALL26 0000000000000000 f_base_global_default_def \+ 0
|
||||
+000000000000004c 000000100000011b R_AARCH64_CALL26 0000000000000000 f_base_global_default_undef \+ 0
|
||||
+0000000000000050 000000150000011b R_AARCH64_CALL26 0000000000000000 f_base_global_hidden_def \+ 0
|
||||
+0000000000000058 000000140000011b R_AARCH64_CALL26 f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
|
||||
+000000000000005c 000000160000011b R_AARCH64_CALL26 f_spec_global_hidden_ifunc\(\) f_spec_global_hidden_ifunc \+ 0
|
||||
+0000000000000060 0000000c0000011b R_AARCH64_CALL26 f_spec_local2_ifunc\(\) f_spec_local2_ifunc \+ 0
|
||||
+0000000000000064 000000190000011b R_AARCH64_CALL26 f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
|
||||
+0000000000000068 000000130000011b R_AARCH64_CALL26 f_base_global_hidden_ifunc\(\) f_base_global_hidden_ifunc \+ 0
|
||||
+000000000000006c 0000000d0000011b R_AARCH64_CALL26 f_base_local2_ifunc\(\) f_base_local2_ifunc \+ 0
|
||||
+
|
||||
+Symbol table '\.symtab' contains 26 entries:
|
||||
+ Num: Value Size Type Bind Vis Ndx Name
|
||||
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
+ 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1
|
||||
+ 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3
|
||||
+ 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4
|
||||
+ 4: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
|
||||
+ 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
|
||||
+ 6: 0000000000000000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
|
||||
+ 7: 0000000000000000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
|
||||
+ 8: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
|
||||
+ 9: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
+ 10: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
|
||||
+ 11: 0000000000000038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
|
||||
+ 12: 0000000000000038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
|
||||
+ 13: 0000000000000038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
|
||||
+ 14: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
|
||||
+ 15: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
+ 16: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
+ 17: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
|
||||
+ 18: 0000000000000000 0 NOTYPE GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_def
|
||||
+ 19: 0000000000000000 0 IFUNC GLOBAL HIDDEN 1 f_base_global_hidden_ifunc
|
||||
+ 20: 0000000000000000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
|
||||
+ 21: 0000000000000000 0 NOTYPE GLOBAL HIDDEN 1 f_base_global_hidden_def
|
||||
+ 22: 0000000000000000 0 IFUNC GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
|
||||
+ 23: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
+ 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
|
||||
+ 25: 0000000000000000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
|
||||
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2019-07-02 17:34:45.635006622 +0100
|
||||
@@ -0,0 +1,67 @@
|
||||
+#source: variant_pcs-1.s
|
||||
+#source: variant_pcs-2.s
|
||||
+#ld: -shared --hash-style=sysv -T variant_pcs.ld
|
||||
+#readelf: -rsW
|
||||
+
|
||||
+Relocation section '\.rela\.plt' at offset 0x11000 contains 12 entries:
|
||||
+ Offset Info Type Symbol's Value Symbol's Name \+ Addend
|
||||
+0000000000009020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0
|
||||
+0000000000009028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0
|
||||
+0000000000009030 0000000400000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_base_global_default_def \+ 0
|
||||
+0000000000009038 0000000500000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_spec_global_default_def \+ 0
|
||||
+0000000000009040 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
+0000000000009048 0000000300000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
|
||||
+0000000000009050 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
+0000000000009058 0000000600000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
|
||||
+0000000000009060 0000000000000408 R_AARCH64_IRELATIVE 8038
|
||||
+0000000000009068 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
+0000000000009070 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
+0000000000009078 0000000000000408 R_AARCH64_IRELATIVE 8038
|
||||
+
|
||||
+Symbol table '\.dynsym' contains 7 entries:
|
||||
+ Num: Value Size Type Bind Vis Ndx Name
|
||||
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
+ 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
+ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
|
||||
+ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
|
||||
+ 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
+ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
|
||||
+ 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
+
|
||||
+Symbol table '\.symtab' contains 35 entries:
|
||||
+ Num: Value Size Type Bind Vis Ndx Name
|
||||
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
+ 1: 0000000000008000 0 SECTION LOCAL DEFAULT 1
|
||||
+ 2: 0000000000008070 0 SECTION LOCAL DEFAULT 2
|
||||
+ 3: 0000000000009000 0 SECTION LOCAL DEFAULT 3
|
||||
+ 4: 0000000000009080 0 SECTION LOCAL DEFAULT 4
|
||||
+ 5: 0000000000011000 0 SECTION LOCAL DEFAULT 5
|
||||
+ 6: 0000000000011120 0 SECTION LOCAL DEFAULT 6
|
||||
+ 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7
|
||||
+ 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8
|
||||
+ 9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
|
||||
+ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
|
||||
+ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
|
||||
+ 12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
|
||||
+ 13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
|
||||
+ 14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
+ 15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
|
||||
+ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
|
||||
+ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
|
||||
+ 18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
|
||||
+ 19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
|
||||
+ 20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
+ 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS
|
||||
+ 22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC
|
||||
+ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def
|
||||
+ 24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc
|
||||
+ 25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def
|
||||
+ 26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
|
||||
+ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
|
||||
+ 28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x
|
||||
+ 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
+ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
|
||||
+ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
|
||||
+ 32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
+ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
|
||||
+ 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d 2019-07-03 10:06:20.012412075 +0100
|
||||
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-now.d 2019-07-03 10:20:51.959203582 +0100
|
||||
@@ -22,10 +22,10 @@ Symbol table '\.dynsym' contains 7 entri
|
||||
Num: Value Size Type Bind Vis Ndx Name
|
||||
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
- 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
|
||||
- 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
|
||||
+ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
|
||||
+ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
|
||||
4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
- 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
|
||||
+ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
|
||||
6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
|
||||
Symbol table '\.symtab' contains 35 entries:
|
||||
@@ -40,28 +40,28 @@ Symbol table '\.symtab' contains 35 entr
|
||||
7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7
|
||||
8: 0000000000011270 0 SECTION LOCAL DEFAULT 8
|
||||
9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
|
||||
- 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
|
||||
- 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
|
||||
+ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local \[VARIANT_PCS\]
|
||||
+ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc \[VARIANT_PCS\]
|
||||
12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
|
||||
13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
|
||||
14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
|
||||
- 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
|
||||
- 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
|
||||
+ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2 \[VARIANT_PCS\]
|
||||
+ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc \[VARIANT_PCS\]
|
||||
18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
|
||||
19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
|
||||
20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
21: 0000000000000000 0 FILE LOCAL DEFAULT ABS
|
||||
22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC
|
||||
- 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def
|
||||
+ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_global_hidden_def \[VARIANT_PCS\]
|
||||
24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc
|
||||
25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def
|
||||
26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
|
||||
- 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
|
||||
+ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_global_hidden_ifunc \[VARIANT_PCS\]
|
||||
28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x
|
||||
29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
- 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
|
||||
- 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
|
||||
+ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
|
||||
+ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
|
||||
32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
- 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
|
||||
+ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
|
||||
34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-r.d binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-r.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-r.d 2019-07-03 10:06:20.012412075 +0100
|
||||
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-r.d 2019-07-03 10:14:28.152933189 +0100
|
||||
@@ -37,24 +37,24 @@ Symbol table '\.symtab' contains 26 entr
|
||||
2: 0000000000000000 0 SECTION LOCAL DEFAULT 3
|
||||
3: 0000000000000000 0 SECTION LOCAL DEFAULT 4
|
||||
4: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
|
||||
- 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
|
||||
- 6: 0000000000000000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
|
||||
+ 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local \[VARIANT_PCS\]
|
||||
+ 6: 0000000000000000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc \[VARIANT_PCS\]
|
||||
7: 0000000000000000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
|
||||
8: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
|
||||
9: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
10: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
|
||||
- 11: 0000000000000038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
|
||||
- 12: 0000000000000038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
|
||||
+ 11: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2 \[VARIANT_PCS\]
|
||||
+ 12: 0000000000000038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc \[VARIANT_PCS\]
|
||||
13: 0000000000000038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
|
||||
14: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
|
||||
15: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
16: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
- 17: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
|
||||
- 18: 0000000000000000 0 NOTYPE GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_def
|
||||
+ 17: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
|
||||
+ 18: 0000000000000000 0 NOTYPE GLOBAL HIDDEN 1 f_spec_global_hidden_def \[VARIANT_PCS\]
|
||||
19: 0000000000000000 0 IFUNC GLOBAL HIDDEN 1 f_base_global_hidden_ifunc
|
||||
- 20: 0000000000000000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
|
||||
+ 20: 0000000000000000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
|
||||
21: 0000000000000000 0 NOTYPE GLOBAL HIDDEN 1 f_base_global_hidden_def
|
||||
- 22: 0000000000000000 0 IFUNC GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
|
||||
+ 22: 0000000000000000 0 IFUNC GLOBAL HIDDEN 1 f_spec_global_hidden_ifunc \[VARIANT_PCS\]
|
||||
23: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
- 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
|
||||
+ 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
|
||||
25: 0000000000000000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-shared.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2019-07-03 10:06:20.012412075 +0100
|
||||
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2019-07-03 10:19:00.760994532 +0100
|
||||
@@ -22,10 +22,10 @@ Symbol table '\.dynsym' contains 7 entri
|
||||
Num: Value Size Type Bind Vis Ndx Name
|
||||
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
- 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
|
||||
- 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
|
||||
+ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
|
||||
+ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
|
||||
4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
- 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
|
||||
+ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
|
||||
6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
|
||||
Symbol table '\.symtab' contains 35 entries:
|
||||
@@ -40,28 +40,28 @@ Symbol table '\.symtab' contains 35 entr
|
||||
7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7
|
||||
8: 0000000000011270 0 SECTION LOCAL DEFAULT 8
|
||||
9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
|
||||
- 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
|
||||
- 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
|
||||
+ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local \[VARIANT_PCS\]
|
||||
+ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc \[VARIANT_PCS\]
|
||||
12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
|
||||
13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
|
||||
14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
|
||||
- 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
|
||||
- 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
|
||||
+ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2 \[VARIANT_PCS\]
|
||||
+ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc \[VARIANT_PCS\]
|
||||
18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
|
||||
19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
|
||||
20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x
|
||||
21: 0000000000000000 0 FILE LOCAL DEFAULT ABS
|
||||
22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC
|
||||
- 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def
|
||||
+ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_global_hidden_def \[VARIANT_PCS\]
|
||||
24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc
|
||||
25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def
|
||||
26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
|
||||
- 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
|
||||
+ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_global_hidden_ifunc \[VARIANT_PCS\]
|
||||
28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x
|
||||
29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
- 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
|
||||
- 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
|
||||
+ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
|
||||
+ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
|
||||
32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
- 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
|
||||
+ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
|
||||
34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
93
SOURCES/binutils-aarch64-condbranch-relocs.patch
Normal file
93
SOURCES/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
|
152
SOURCES/binutils-aarch64-flagm.patch
Normal file
152
SOURCES/binutils-aarch64-flagm.patch
Normal file
@ -0,0 +1,152 @@
|
||||
diff -rup binutils.orig/gas/NEWS binutils-2.35.2/gas/NEWS
|
||||
--- binutils.orig/gas/NEWS 2023-04-26 11:29:49.525097847 +0100
|
||||
+++ binutils-2.35.2/gas/NEWS 2023-04-26 11:30:59.811955065 +0100
|
||||
@@ -1,5 +1,7 @@
|
||||
-*- text -*-
|
||||
|
||||
+* Add support for +flagm feature for -march in Armv8.4 AArch64.
|
||||
+
|
||||
* Add support for Intel AMX instructions.
|
||||
|
||||
* Add {disp16} pseudo prefix to x86 assembler.
|
||||
diff -rup binutils.orig/gas/config/tc-aarch64.c binutils-2.35.2/gas/config/tc-aarch64.c
|
||||
--- binutils.orig/gas/config/tc-aarch64.c 2023-04-26 11:29:48.944099025 +0100
|
||||
+++ binutils-2.35.2/gas/config/tc-aarch64.c 2023-04-26 11:31:42.994864009 +0100
|
||||
@@ -9080,6 +9080,8 @@ static const struct aarch64_option_cpu_v
|
||||
AARCH64_FEATURE (AARCH64_FEATURE_SVE, 0)},
|
||||
{"f64mm", AARCH64_FEATURE (AARCH64_FEATURE_F64MM, 0),
|
||||
AARCH64_FEATURE (AARCH64_FEATURE_SVE, 0)},
|
||||
+ {"flagm", AARCH64_FEATURE (AARCH64_FEATURE_FLAGM, 0),
|
||||
+ AARCH64_ARCH_NONE},
|
||||
{NULL, AARCH64_ARCH_NONE, AARCH64_ARCH_NONE},
|
||||
};
|
||||
|
||||
diff -rup binutils.orig/gas/doc/c-aarch64.texi binutils-2.35.2/gas/doc/c-aarch64.texi
|
||||
--- binutils.orig/gas/doc/c-aarch64.texi 2023-04-26 11:29:48.881099153 +0100
|
||||
+++ binutils-2.35.2/gas/doc/c-aarch64.texi 2023-04-26 11:32:22.402780914 +0100
|
||||
@@ -222,6 +222,8 @@ automatically cause those extensions to
|
||||
@code{pmullt} and @code{pmullb} instructions.
|
||||
@item @code{sve2-sha3} @tab ARMv8-A @tab No
|
||||
@tab Enable SVE2 SHA3 Extension.
|
||||
+@item @code{flagm} @tab ARMv8-A @tab ARMv8.4-A or later
|
||||
+ @tab Enable Flag Manipulation instructions.
|
||||
@end multitable
|
||||
|
||||
@node AArch64 Syntax
|
||||
diff -rup binutils.orig/include/opcode/aarch64.h binutils-2.35.2/include/opcode/aarch64.h
|
||||
--- binutils.orig/include/opcode/aarch64.h 2023-04-26 11:29:48.702099517 +0100
|
||||
+++ binutils-2.35.2/include/opcode/aarch64.h 2023-04-26 11:35:17.346412224 +0100
|
||||
@@ -69,7 +69,7 @@ typedef uint32_t aarch64_insn;
|
||||
#define AARCH64_FEATURE_AES (1ULL << 35) /* AES instructions. */
|
||||
#define AARCH64_FEATURE_F16_FML (1ULL << 36) /* v8.2 FP16FML ins. */
|
||||
#define AARCH64_FEATURE_V8_5 (1ULL << 37) /* ARMv8.5 processors. */
|
||||
-#define AARCH64_FEATURE_FLAGMANIP (1ULL << 38) /* Flag Manipulation insns. */
|
||||
+#define AARCH64_FEATURE_FLAGMANIP (1ULL << 38) /* v8.5 Flag Manipulation version 2. */
|
||||
#define AARCH64_FEATURE_FRINTTS (1ULL << 39) /* FRINT[32,64][Z,X] insns. */
|
||||
#define AARCH64_FEATURE_SB (1ULL << 40) /* SB instruction. */
|
||||
#define AARCH64_FEATURE_PREDRES (1ULL << 41) /* Execution and Data Prediction Restriction instructions. */
|
||||
@@ -84,6 +84,7 @@ typedef uint32_t aarch64_insn;
|
||||
#define AARCH64_FEATURE_I8MM (1ULL << 52) /* Matrix Multiply instructions. */
|
||||
#define AARCH64_FEATURE_F32MM (1ULL << 53)
|
||||
#define AARCH64_FEATURE_F64MM (1ULL << 54)
|
||||
+#define AARCH64_FEATURE_FLAGM (1ULL << 55) /* v8.4 Flag Manipulation. */
|
||||
|
||||
/* Crypto instructions are the combination of AES and SHA2. */
|
||||
#define AARCH64_FEATURE_CRYPTO (AARCH64_FEATURE_SHA2 | AARCH64_FEATURE_AES)
|
||||
@@ -109,6 +110,7 @@ typedef uint32_t aarch64_insn;
|
||||
#define AARCH64_ARCH_V8_4 AARCH64_FEATURE (AARCH64_ARCH_V8_3, \
|
||||
AARCH64_FEATURE_V8_4 \
|
||||
| AARCH64_FEATURE_DOTPROD \
|
||||
+ | AARCH64_FEATURE_FLAGM \
|
||||
| AARCH64_FEATURE_F16_FML)
|
||||
#define AARCH64_ARCH_V8_5 AARCH64_FEATURE (AARCH64_ARCH_V8_4, \
|
||||
AARCH64_FEATURE_V8_5 \
|
||||
diff -rup binutils.orig/opcodes/aarch64-tbl.h binutils-2.35.2/opcodes/aarch64-tbl.h
|
||||
--- binutils.orig/opcodes/aarch64-tbl.h 2023-04-26 11:29:48.705099511 +0100
|
||||
+++ binutils-2.35.2/opcodes/aarch64-tbl.h 2023-04-26 11:37:27.299161621 +0100
|
||||
@@ -2406,6 +2406,8 @@ static const aarch64_feature_set aarch64
|
||||
static const aarch64_feature_set aarch64_feature_f64mm_sve =
|
||||
AARCH64_FEATURE (AARCH64_FEATURE_V8_2 | AARCH64_FEATURE_F64MM
|
||||
| AARCH64_FEATURE_SVE, 0);
|
||||
+static const aarch64_feature_set aarch64_feature_flagm =
|
||||
+ AARCH64_FEATURE (AARCH64_FEATURE_FLAGM, 0);
|
||||
|
||||
|
||||
#define CORE &aarch64_feature_v8
|
||||
@@ -2450,6 +2452,7 @@ static const aarch64_feature_set aarch64
|
||||
#define F32MM_SVE &aarch64_feature_f32mm_sve
|
||||
#define F64MM_SVE &aarch64_feature_f64mm_sve
|
||||
#define I8MM &aarch64_feature_i8mm
|
||||
+#define FLAGM &aarch64_feature_flagm
|
||||
|
||||
#define CORE_INSN(NAME,OPCODE,MASK,CLASS,OP,OPS,QUALS,FLAGS) \
|
||||
{ NAME, OPCODE, MASK, CLASS, OP, CORE, OPS, QUALS, FLAGS, 0, 0, NULL }
|
||||
@@ -2553,6 +2556,8 @@ static const aarch64_feature_set aarch64
|
||||
{ NAME, OPCODE, MASK, CLASS, 0, F64MM_SVE, OPS, QUALS, FLAGS, CONSTRAINTS, TIED, NULL }
|
||||
#define F32MATMUL_SVE_INSNC(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS, CONSTRAINTS, TIED) \
|
||||
{ NAME, OPCODE, MASK, CLASS, 0, F32MM_SVE, OPS, QUALS, FLAGS, CONSTRAINTS, TIED, NULL }
|
||||
+#define FLAGM_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \
|
||||
+ { NAME, OPCODE, MASK, CLASS, 0, FLAGM, OPS, QUALS, FLAGS, 0, 0, NULL }
|
||||
|
||||
struct aarch64_opcode aarch64_opcode_table[] =
|
||||
{
|
||||
@@ -3865,7 +3870,7 @@ struct aarch64_opcode aarch64_opcode_tab
|
||||
potentially alias with too many instructions and so the tree can't be constructed. As a work
|
||||
around we just place cfinv before msr. This means the order between these two shouldn't be
|
||||
changed. */
|
||||
- V8_4_INSN ("cfinv", 0xd500401f, 0xffffffff, ic_system, OP0 (), {}, 0),
|
||||
+ FLAGM_INSN ("cfinv", 0xd500401f, 0xffffffff, ic_system, OP0 (), {}, 0),
|
||||
CORE_INSN ("msr", 0xd5000000, 0xffe00000, ic_system, 0, OP2 (SYSREG, Rt), QL_SRC_X, F_SYS_WRITE),
|
||||
CORE_INSN ("sysl",0xd5280000, 0xfff80000, ic_system, 0, OP5 (Rt, UIMM3_OP1, CRn, CRm, UIMM3_OP2), QL_SYSL, 0),
|
||||
CORE_INSN ("mrs", 0xd5200000, 0xffe00000, ic_system, 0, OP2 (Rt, SYSREG), QL_DST_X, F_SYS_READ),
|
||||
@@ -5043,9 +5048,9 @@ struct aarch64_opcode aarch64_opcode_tab
|
||||
FP16_V8_2_INSN ("fmlal2", 0x6f808000, 0xffc0f400, asimdelem, OP3 (Vd, Vn, Em16), QL_V2FML4S, 0),
|
||||
FP16_V8_2_INSN ("fmlsl2", 0x6f80c000, 0xffc0f400, asimdelem, OP3 (Vd, Vn, Em16), QL_V2FML4S, 0),
|
||||
/* System extensions ARMv8.4-a. */
|
||||
- V8_4_INSN ("rmif", 0xba000400, 0xffe07c10, ic_system, OP3 (Rn, IMM_2, MASK), QL_RMIF, 0),
|
||||
- V8_4_INSN ("setf8", 0x3a00080d, 0xfffffc1f, ic_system, OP1 (Rn), QL_SETF, 0),
|
||||
- V8_4_INSN ("setf16", 0x3a00480d, 0xfffffc1f, ic_system, OP1 (Rn), QL_SETF, 0),
|
||||
+ FLAGM_INSN ("rmif", 0xba000400, 0xffe07c10, ic_system, OP3 (Rn, IMM_2, MASK), QL_RMIF, 0),
|
||||
+ FLAGM_INSN ("setf8", 0x3a00080d, 0xfffffc1f, ic_system, OP1 (Rn), QL_SETF, 0),
|
||||
+ FLAGM_INSN ("setf16", 0x3a00480d, 0xfffffc1f, ic_system, OP1 (Rn), QL_SETF, 0),
|
||||
/* Memory access instructions ARMv8.4-a. */
|
||||
V8_4_INSN ("stlurb" , 0x19000000, 0xffe00c00, ldst_unscaled, OP2 (Rt, ADDR_OFFSET), QL_STLW, 0),
|
||||
V8_4_INSN ("ldapurb", 0x19400000, 0xffe00c00, ldst_unscaled, OP2 (Rt, ADDR_OFFSET), QL_STLW, 0),
|
||||
--- /dev/null 2023-04-26 09:16:03.694889721 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/aarch64/flagm.d 2023-04-26 11:33:08.910682842 +0100
|
||||
@@ -0,0 +1,16 @@
|
||||
+#name: FLAGM (Condition flag manipulation) feature
|
||||
+#objdump: -dr
|
||||
+
|
||||
+.*: file format .*
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+0+ <.*>:
|
||||
+.*: d500401f cfinv
|
||||
+.*: ba0407cf rmif x30, #8, #15
|
||||
+.*: 3a00080d setf8 w0
|
||||
+.*: 3a00480d setf16 w0
|
||||
+.*: d500401f cfinv
|
||||
+.*: ba0407cf rmif x30, #8, #15
|
||||
+.*: 3a00080d setf8 w0
|
||||
+.*: 3a00480d setf16 w0
|
||||
--- /dev/null 2023-04-26 09:16:03.694889721 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/aarch64/flagm.s 2023-04-26 11:39:10.597962432 +0100
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* FLAGM (Condition flag manipulation) feature from Armv8.4-A. */
|
||||
+.arch armv8.4-a
|
||||
+
|
||||
+ cfinv
|
||||
+ rmif x30, #8, #15
|
||||
+ setf8 w0
|
||||
+ setf16 w0
|
||||
+
|
||||
+
|
||||
+/* FLAGM feature enabled with +flagm. */
|
||||
+.arch armv8-a+flagm
|
||||
+
|
||||
+ cfinv
|
||||
+ rmif x30, #8, #15
|
||||
+ setf8 w0
|
||||
+ setf16 w0
|
@ -1,122 +0,0 @@
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d binutils-2.30/ld/testsuite/ld-aarch64/variant_pcs-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d 2020-04-06 16:21:53.296852157 +0100
|
||||
+++ binutils-2.30/ld/testsuite/ld-aarch64/variant_pcs-now.d 2020-04-06 16:28:56.733001935 +0100
|
||||
@@ -5,28 +5,29 @@
|
||||
|
||||
Relocation section '\.rela\.plt' at offset 0x11000 contains 12 entries:
|
||||
Offset Info Type Symbol's Value Symbol's Name \+ Addend
|
||||
-0000000000009020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0
|
||||
-0000000000009028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0
|
||||
-0000000000009030 0000000400000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_base_global_default_def \+ 0
|
||||
-0000000000009038 0000000500000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_spec_global_default_def \+ 0
|
||||
+0000000000009020 0000000.00000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0
|
||||
+0000000000009028 0000000.00000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0
|
||||
+0000000000009030 0000000.00000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_base_global_default_def \+ 0
|
||||
+0000000000009038 0000000.00000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_spec_global_default_def \+ 0
|
||||
0000000000009040 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
-0000000000009048 0000000300000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
|
||||
+0000000000009048 0000000.00000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
|
||||
0000000000009050 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
-0000000000009058 0000000600000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
|
||||
+0000000000009058 0000000.00000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
|
||||
0000000000009060 0000000000000408 R_AARCH64_IRELATIVE 8038
|
||||
0000000000009068 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
0000000000009070 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
0000000000009078 0000000000000408 R_AARCH64_IRELATIVE 8038
|
||||
|
||||
-Symbol table '\.dynsym' contains 7 entries:
|
||||
+Symbol table '\.dynsym' contains . entries:
|
||||
Num: Value Size Type Bind Vis Ndx Name
|
||||
- 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
- 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
- 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
|
||||
- 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
|
||||
- 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
- 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
|
||||
- 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
+#...
|
||||
+ .: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
+ .: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
|
||||
+ .: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
|
||||
+ .: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
+ .: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
|
||||
+ .: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
|
||||
Symbol table '\.symtab' contains 35 entries:
|
||||
Num: Value Size Type Bind Vis Ndx Name
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d binutils-2.30/ld/testsuite/ld-aarch64/variant_pcs-shared.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2020-04-06 16:21:53.296852157 +0100
|
||||
+++ binutils-2.30/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2020-04-06 16:28:35.565094429 +0100
|
||||
@@ -5,28 +5,29 @@
|
||||
|
||||
Relocation section '\.rela\.plt' at offset 0x11000 contains 12 entries:
|
||||
Offset Info Type Symbol's Value Symbol's Name \+ Addend
|
||||
-0000000000009020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0
|
||||
-0000000000009028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0
|
||||
-0000000000009030 0000000400000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_base_global_default_def \+ 0
|
||||
-0000000000009038 0000000500000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_spec_global_default_def \+ 0
|
||||
+0000000000009020 0000000.00000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0
|
||||
+0000000000009028 0000000.00000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0
|
||||
+0000000000009030 0000000.00000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_base_global_default_def \+ 0
|
||||
+0000000000009038 0000000.00000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_spec_global_default_def \+ 0
|
||||
0000000000009040 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
-0000000000009048 0000000300000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
|
||||
+0000000000009048 0000000.00000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
|
||||
0000000000009050 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
-0000000000009058 0000000600000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
|
||||
+0000000000009058 0000000.00000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
|
||||
0000000000009060 0000000000000408 R_AARCH64_IRELATIVE 8038
|
||||
0000000000009068 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
0000000000009070 0000000000000408 R_AARCH64_IRELATIVE 8000
|
||||
0000000000009078 0000000000000408 R_AARCH64_IRELATIVE 8038
|
||||
|
||||
-Symbol table '\.dynsym' contains 7 entries:
|
||||
+Symbol table '\.dynsym' contains . entries:
|
||||
Num: Value Size Type Bind Vis Ndx Name
|
||||
- 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
- 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
- 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
|
||||
- 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
|
||||
- 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
- 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
|
||||
- 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
+#...
|
||||
+ .: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
|
||||
+ .: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
|
||||
+ .: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
|
||||
+ .: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
|
||||
+ .: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
|
||||
+ .: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
|
||||
|
||||
Symbol table '\.symtab' contains 35 entries:
|
||||
Num: Value Size Type Bind Vis Ndx Name
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d binutils-2.30/ld/testsuite/ld-aarch64/variant_pcs-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d 2020-04-06 17:27:02.890275588 +0100
|
||||
+++ binutils-2.30/ld/testsuite/ld-aarch64/variant_pcs-now.d 2020-04-06 17:33:51.136464165 +0100
|
||||
@@ -38,8 +38,8 @@ Symbol table '\.symtab' contains 35 entr
|
||||
4: 0000000000009080 0 SECTION LOCAL DEFAULT 4
|
||||
5: 0000000000011000 0 SECTION LOCAL DEFAULT 5
|
||||
6: 0000000000011120 0 SECTION LOCAL DEFAULT 6
|
||||
- 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7
|
||||
- 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8
|
||||
+ 7: 00000000000111.. 0 SECTION LOCAL DEFAULT 7
|
||||
+ 8: 00000000000112.. 0 SECTION LOCAL DEFAULT 8
|
||||
9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
|
||||
10: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local \[VARIANT_PCS\]
|
||||
11: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc \[VARIANT_PCS\]
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d binutils-2.30/ld/testsuite/ld-aarch64/variant_pcs-shared.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2020-04-06 17:27:02.890275588 +0100
|
||||
+++ binutils-2.30/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2020-04-06 17:33:56.512440347 +0100
|
||||
@@ -38,8 +38,8 @@ Symbol table '\.symtab' contains 35 entr
|
||||
4: 0000000000009080 0 SECTION LOCAL DEFAULT 4
|
||||
5: 0000000000011000 0 SECTION LOCAL DEFAULT 5
|
||||
6: 0000000000011120 0 SECTION LOCAL DEFAULT 6
|
||||
- 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7
|
||||
- 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8
|
||||
+ 7: 00000000000111.. 0 SECTION LOCAL DEFAULT 7
|
||||
+ 8: 00000000000112.. 0 SECTION LOCAL DEFAULT 8
|
||||
9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
|
||||
10: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local \[VARIANT_PCS\]
|
||||
11: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc \[VARIANT_PCS\]
|
@ -1,547 +0,0 @@
|
||||
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.30/bfd/elfnn-aarch64.c
|
||||
--- binutils.orig/bfd/elfnn-aarch64.c 2020-11-04 14:53:52.144476367 +0000
|
||||
+++ binutils-2.30/bfd/elfnn-aarch64.c 2020-11-04 14:56:42.275422499 +0000
|
||||
@@ -2191,6 +2191,9 @@ struct elf_aarch64_obj_tdata
|
||||
|
||||
/* Zero to warn when linking objects with incompatible wchar_t sizes. */
|
||||
int no_wchar_size_warning;
|
||||
+
|
||||
+ /* All GNU_PROPERTY_AARCH64_FEATURE_1_AND properties. */
|
||||
+ uint32_t gnu_and_prop;
|
||||
};
|
||||
|
||||
#define elf_aarch64_tdata(bfd) \
|
||||
@@ -9311,6 +9314,32 @@ elfNN_aarch64_backend_symbol_processing
|
||||
sym->flags |= BSF_KEEP;
|
||||
}
|
||||
|
||||
+/* Implement elf_backend_setup_gnu_properties for AArch64. It serves as a
|
||||
+ wrapper function for _bfd_aarch64_elf_link_setup_gnu_properties to account
|
||||
+ for the effect of GNU properties of the output_bfd. */
|
||||
+static bfd *
|
||||
+elfNN_aarch64_link_setup_gnu_properties (struct bfd_link_info *info)
|
||||
+{
|
||||
+ uint32_t prop = elf_aarch64_tdata (info->output_bfd)->gnu_and_prop;
|
||||
+ bfd *pbfd = _bfd_aarch64_elf_link_setup_gnu_properties (info, &prop);
|
||||
+ elf_aarch64_tdata (info->output_bfd)->gnu_and_prop = prop;
|
||||
+ return pbfd;
|
||||
+}
|
||||
+
|
||||
+/* Implement elf_backend_merge_gnu_properties for AArch64. It serves as a
|
||||
+ wrapper function for _bfd_aarch64_elf_merge_gnu_properties to account
|
||||
+ for the effect of GNU properties of the output_bfd. */
|
||||
+static bfd_boolean
|
||||
+elfNN_aarch64_merge_gnu_properties (struct bfd_link_info *info,
|
||||
+ bfd *abfd,
|
||||
+ elf_property *aprop,
|
||||
+ elf_property *bprop)
|
||||
+{
|
||||
+ uint32_t prop
|
||||
+ = elf_aarch64_tdata (info->output_bfd)->gnu_and_prop;
|
||||
+ return _bfd_aarch64_elf_merge_gnu_properties (info, abfd, aprop,
|
||||
+ bprop, prop);
|
||||
+}
|
||||
|
||||
/* We use this so we can override certain functions
|
||||
(though currently we don't). */
|
||||
@@ -9453,6 +9482,12 @@ const struct elf_size_info elfNN_aarch64
|
||||
#define elf_backend_symbol_processing \
|
||||
elfNN_aarch64_backend_symbol_processing
|
||||
|
||||
+#define elf_backend_setup_gnu_properties \
|
||||
+ elfNN_aarch64_link_setup_gnu_properties
|
||||
+
|
||||
+#define elf_backend_merge_gnu_properties \
|
||||
+ elfNN_aarch64_merge_gnu_properties
|
||||
+
|
||||
#define elf_backend_can_refcount 1
|
||||
#define elf_backend_can_gc_sections 1
|
||||
#define elf_backend_plt_readonly 1
|
||||
diff -rup binutils.orig/bfd/elfxx-aarch64.c binutils-2.30/bfd/elfxx-aarch64.c
|
||||
--- binutils.orig/bfd/elfxx-aarch64.c 2020-11-04 14:53:52.138476401 +0000
|
||||
+++ binutils-2.30/bfd/elfxx-aarch64.c 2020-11-04 14:56:42.276422492 +0000
|
||||
@@ -660,3 +660,183 @@ _bfd_aarch64_elf_write_core_note (bfd *a
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+/* Find the first input bfd with GNU property and merge it with GPROP. If no
|
||||
+ such input is found, add it to a new section at the last input. Update
|
||||
+ GPROP accordingly. */
|
||||
+bfd *
|
||||
+_bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info,
|
||||
+ uint32_t *gprop)
|
||||
+{
|
||||
+ asection *sec;
|
||||
+ bfd *pbfd;
|
||||
+ bfd *ebfd = NULL;
|
||||
+ elf_property *prop;
|
||||
+
|
||||
+ uint32_t gnu_prop = *gprop;
|
||||
+
|
||||
+ /* Find a normal input file with GNU property note. */
|
||||
+ for (pbfd = info->input_bfds;
|
||||
+ pbfd != NULL;
|
||||
+ pbfd = pbfd->link.next)
|
||||
+ if (bfd_get_flavour (pbfd) == bfd_target_elf_flavour
|
||||
+ && bfd_count_sections (pbfd) != 0)
|
||||
+ {
|
||||
+ ebfd = pbfd;
|
||||
+
|
||||
+ if (elf_properties (pbfd) != NULL)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* If ebfd != NULL it is either an input with property note or the last
|
||||
+ input. Either way if we have gnu_prop, we should add it (by creating
|
||||
+ a section if needed). */
|
||||
+ if (ebfd != NULL && gnu_prop)
|
||||
+ {
|
||||
+ prop = _bfd_elf_get_property (ebfd,
|
||||
+ GNU_PROPERTY_AARCH64_FEATURE_1_AND,
|
||||
+ 4);
|
||||
+ prop->u.number |= gnu_prop;
|
||||
+ prop->pr_kind = property_number;
|
||||
+
|
||||
+ /* pbfd being NULL implies ebfd is the last input. Create the GNU
|
||||
+ property note section. */
|
||||
+ if (pbfd == NULL)
|
||||
+ {
|
||||
+ sec = bfd_make_section_with_flags (ebfd,
|
||||
+ NOTE_GNU_PROPERTY_SECTION_NAME,
|
||||
+ (SEC_ALLOC
|
||||
+ | SEC_LOAD
|
||||
+ | SEC_IN_MEMORY
|
||||
+ | SEC_READONLY
|
||||
+ | SEC_HAS_CONTENTS
|
||||
+ | SEC_DATA));
|
||||
+ if (sec == NULL)
|
||||
+ info->callbacks->einfo (
|
||||
+ _("%F%P: failed to create GNU property section\n"));
|
||||
+
|
||||
+ elf_section_type (sec) = SHT_NOTE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ pbfd = _bfd_elf_link_setup_gnu_properties (info);
|
||||
+
|
||||
+ if (bfd_link_relocatable (info))
|
||||
+ return pbfd;
|
||||
+
|
||||
+ /* If pbfd has any GNU_PROPERTY_AARCH64_FEATURE_1_AND properties, update
|
||||
+ gnu_prop accordingly. */
|
||||
+ if (pbfd != NULL)
|
||||
+ {
|
||||
+ elf_property_list *p;
|
||||
+
|
||||
+ /* The property list is sorted in order of type. */
|
||||
+ for (p = elf_properties (pbfd); p; p = p->next)
|
||||
+ {
|
||||
+ /* Check for all GNU_PROPERTY_AARCH64_FEATURE_1_AND. */
|
||||
+ if (GNU_PROPERTY_AARCH64_FEATURE_1_AND == p->property.pr_type)
|
||||
+ {
|
||||
+ gnu_prop = (p->property.u.number
|
||||
+ & (GNU_PROPERTY_AARCH64_FEATURE_1_PAC
|
||||
+ | GNU_PROPERTY_AARCH64_FEATURE_1_BTI));
|
||||
+ break;
|
||||
+ }
|
||||
+ else if (GNU_PROPERTY_AARCH64_FEATURE_1_AND < p->property.pr_type)
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ *gprop = gnu_prop;
|
||||
+ return pbfd;
|
||||
+}
|
||||
+
|
||||
+/* Define elf_backend_parse_gnu_properties for AArch64. */
|
||||
+enum elf_property_kind
|
||||
+_bfd_aarch64_elf_parse_gnu_properties (bfd *abfd, unsigned int type,
|
||||
+ bfd_byte *ptr, unsigned int datasz)
|
||||
+{
|
||||
+ elf_property *prop;
|
||||
+
|
||||
+ switch (type)
|
||||
+ {
|
||||
+ case GNU_PROPERTY_AARCH64_FEATURE_1_AND:
|
||||
+ if (datasz != 4)
|
||||
+ {
|
||||
+ _bfd_error_handler
|
||||
+ ( _("error: %pB: <corrupt AArch64 used size: 0x%x>"),
|
||||
+ abfd, datasz);
|
||||
+ return property_corrupt;
|
||||
+ }
|
||||
+ prop = _bfd_elf_get_property (abfd, type, datasz);
|
||||
+ /* Combine properties of the same type. */
|
||||
+ prop->u.number |= bfd_h_get_32 (abfd, ptr);
|
||||
+ prop->pr_kind = property_number;
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ return property_ignored;
|
||||
+ }
|
||||
+
|
||||
+ return property_number;
|
||||
+}
|
||||
+
|
||||
+/* Merge AArch64 GNU property BPROP with APROP also accounting for PROP.
|
||||
+ If APROP isn't NULL, merge it with BPROP and/or PROP. Vice-versa if BROP
|
||||
+ isn't NULL. Return TRUE if there is any update to APROP or if BPROP should
|
||||
+ be merge with ABFD. */
|
||||
+bfd_boolean
|
||||
+_bfd_aarch64_elf_merge_gnu_properties (struct bfd_link_info *info
|
||||
+ ATTRIBUTE_UNUSED,
|
||||
+ bfd *abfd ATTRIBUTE_UNUSED,
|
||||
+ elf_property *aprop,
|
||||
+ elf_property *bprop,
|
||||
+ uint32_t prop)
|
||||
+{
|
||||
+ unsigned int orig_number;
|
||||
+ bfd_boolean updated = FALSE;
|
||||
+ unsigned int pr_type = aprop != NULL ? aprop->pr_type : bprop->pr_type;
|
||||
+
|
||||
+ switch (pr_type)
|
||||
+ {
|
||||
+ case GNU_PROPERTY_AARCH64_FEATURE_1_AND:
|
||||
+ {
|
||||
+ if (aprop != NULL && bprop != NULL)
|
||||
+ {
|
||||
+ orig_number = aprop->u.number;
|
||||
+ aprop->u.number = (orig_number & bprop->u.number) | prop;
|
||||
+ updated = orig_number != aprop->u.number;
|
||||
+ /* Remove the property if all feature bits are cleared. */
|
||||
+ if (aprop->u.number == 0)
|
||||
+ aprop->pr_kind = property_remove;
|
||||
+ break;
|
||||
+ }
|
||||
+ /* If either is NULL, the AND would be 0 so, if there is
|
||||
+ any PROP, asign it to the input that is not NULL. */
|
||||
+ if (prop)
|
||||
+ {
|
||||
+ if (aprop != NULL)
|
||||
+ {
|
||||
+ orig_number = aprop->u.number;
|
||||
+ aprop->u.number = prop;
|
||||
+ updated = orig_number != aprop->u.number;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ bprop->u.number = prop;
|
||||
+ updated = TRUE;
|
||||
+ }
|
||||
+ }
|
||||
+ /* No PROP and BPROP is NULL, so remove APROP. */
|
||||
+ else if (aprop != NULL)
|
||||
+ {
|
||||
+ aprop->pr_kind = property_remove;
|
||||
+ updated = TRUE;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ abort ();
|
||||
+ }
|
||||
+
|
||||
+ return updated;
|
||||
+}
|
||||
diff -rup binutils.orig/bfd/elfxx-aarch64.h binutils-2.30/bfd/elfxx-aarch64.h
|
||||
--- binutils.orig/bfd/elfxx-aarch64.h 2020-11-04 14:53:52.134476424 +0000
|
||||
+++ binutils-2.30/bfd/elfxx-aarch64.h 2020-11-04 14:56:42.276422492 +0000
|
||||
@@ -65,3 +65,19 @@ _bfd_aarch64_elf_write_core_note (bfd *,
|
||||
#define elf_backend_grok_prstatus _bfd_aarch64_elf_grok_prstatus
|
||||
#define elf_backend_grok_psinfo _bfd_aarch64_elf_grok_psinfo
|
||||
#define elf_backend_write_core_note _bfd_aarch64_elf_write_core_note
|
||||
+
|
||||
+extern bfd *
|
||||
+_bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *,
|
||||
+ uint32_t *);
|
||||
+
|
||||
+extern enum elf_property_kind
|
||||
+_bfd_aarch64_elf_parse_gnu_properties (bfd *, unsigned int,
|
||||
+ bfd_byte *, unsigned int);
|
||||
+
|
||||
+extern bfd_boolean
|
||||
+_bfd_aarch64_elf_merge_gnu_properties (struct bfd_link_info *, bfd *,
|
||||
+ elf_property *, elf_property *,
|
||||
+ uint32_t);
|
||||
+
|
||||
+#define elf_backend_parse_gnu_properties \
|
||||
+ _bfd_aarch64_elf_parse_gnu_properties
|
||||
diff -rup binutils.orig/binutils/readelf.c binutils-2.30/binutils/readelf.c
|
||||
--- binutils.orig/binutils/readelf.c 2020-11-04 14:53:51.723478764 +0000
|
||||
+++ binutils-2.30/binutils/readelf.c 2020-11-04 14:56:42.277422485 +0000
|
||||
@@ -17103,6 +17103,33 @@ decode_x86_feature_2 (unsigned int bitma
|
||||
}
|
||||
|
||||
static void
|
||||
+decode_aarch64_feature_1_and (unsigned int bitmask)
|
||||
+{
|
||||
+ while (bitmask)
|
||||
+ {
|
||||
+ unsigned int bit = bitmask & (- bitmask);
|
||||
+
|
||||
+ bitmask &= ~ bit;
|
||||
+ switch (bit)
|
||||
+ {
|
||||
+ case GNU_PROPERTY_AARCH64_FEATURE_1_BTI:
|
||||
+ printf ("BTI");
|
||||
+ break;
|
||||
+
|
||||
+ case GNU_PROPERTY_AARCH64_FEATURE_1_PAC:
|
||||
+ printf ("PAC");
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ printf (_("<unknown: %x>"), bit);
|
||||
+ break;
|
||||
+ }
|
||||
+ if (bitmask)
|
||||
+ printf (", ");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
print_gnu_property_note (Filedata * filedata, Elf_Internal_Note * pnote)
|
||||
{
|
||||
unsigned char * ptr = (unsigned char *) pnote->descdata;
|
||||
@@ -17236,6 +17263,18 @@ print_gnu_property_note (Filedata * file
|
||||
break;
|
||||
}
|
||||
}
|
||||
+ else if (filedata->file_header.e_machine == EM_AARCH64)
|
||||
+ {
|
||||
+ if (type == GNU_PROPERTY_AARCH64_FEATURE_1_AND)
|
||||
+ {
|
||||
+ printf ("AArch64 feature: ");
|
||||
+ if (datasz != 4)
|
||||
+ printf (_("<corrupt length: %#x> "), datasz);
|
||||
+ else
|
||||
+ decode_aarch64_feature_1_and (byte_get (ptr, 4));
|
||||
+ goto next;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
diff -rup binutils.orig/include/elf/common.h binutils-2.30/include/elf/common.h
|
||||
--- binutils.orig/include/elf/common.h 2020-11-04 14:53:52.155476304 +0000
|
||||
+++ binutils-2.30/include/elf/common.h 2020-11-04 14:56:42.277422485 +0000
|
||||
@@ -832,6 +832,12 @@
|
||||
#define GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT (1U << 8)
|
||||
#define GNU_PROPERTY_X86_FEATURE_2_XSAVEC (1U << 9)
|
||||
|
||||
+/* AArch64 specific GNU PROPERTY. */
|
||||
+#define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000
|
||||
+
|
||||
+#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0)
|
||||
+#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1)
|
||||
+
|
||||
/* Values used in GNU .note.ABI-tag notes (NT_GNU_ABI_TAG). */
|
||||
#define GNU_ABI_TAG_LINUX 0
|
||||
#define GNU_ABI_TAG_HURD 1
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/aarch64-elf.exp binutils-2.30/ld/testsuite/ld-aarch64/aarch64-elf.exp
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/aarch64-elf.exp 2020-11-04 14:53:51.843478081 +0000
|
||||
+++ binutils-2.30/ld/testsuite/ld-aarch64/aarch64-elf.exp 2020-11-04 14:56:42.278422479 +0000
|
||||
@@ -337,6 +337,10 @@ run_dump_test_lp64 "variant_pcs-r"
|
||||
run_dump_test_lp64 "variant_pcs-shared"
|
||||
run_dump_test_lp64 "variant_pcs-now"
|
||||
|
||||
+run_dump_test "property-bti-pac1"
|
||||
+run_dump_test "property-bti-pac2"
|
||||
+run_dump_test "property-bti-pac3"
|
||||
+
|
||||
set aarch64elflinktests {
|
||||
{"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s}
|
||||
{} "copy-reloc-so.so"}
|
||||
--- /dev/null 2020-11-04 08:04:13.849482156 +0000
|
||||
+++ binutils-2.30/ld/testsuite/ld-aarch64/property-bti-pac1.d 2020-11-04 14:56:42.278422479 +0000
|
||||
@@ -0,0 +1,11 @@
|
||||
+#name: GNU Property (single input, combine section)
|
||||
+#source: property-bti-pac1.s
|
||||
+#as: -march=armv8.5-a -defsym __mult__=0
|
||||
+#ld: -shared
|
||||
+#readelf: -n
|
||||
+#target: *linux*
|
||||
+
|
||||
+Displaying notes found in: .note.gnu.property
|
||||
+ Owner Data size Description
|
||||
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
|
||||
+ Properties: AArch64 feature: BTI, PAC
|
||||
--- /dev/null 2020-11-04 08:04:13.849482156 +0000
|
||||
+++ binutils-2.30/ld/testsuite/ld-aarch64/property-bti-pac1.s 2020-11-04 14:56:42.278422479 +0000
|
||||
@@ -0,0 +1,37 @@
|
||||
+ .text
|
||||
+ .globl _start
|
||||
+ .type _start,@function
|
||||
+_start:
|
||||
+ mov x1, #2
|
||||
+.ifndef __mult__
|
||||
+ bl foo
|
||||
+.endif
|
||||
+ .section ".note.gnu.property", "a"
|
||||
+ .p2align 3
|
||||
+ .long 1f - 0f /* name length */
|
||||
+ .long 5f - 2f /* data length */
|
||||
+ .long 5 /* note type */
|
||||
+0: .asciz "GNU" /* vendor name */
|
||||
+1:
|
||||
+ .p2align 3
|
||||
+2: .long 0xc0000000 /* pr_type. */
|
||||
+ .long 4f - 3f /* pr_datasz. */
|
||||
+3:
|
||||
+ .long 0x2 /* PAC. */
|
||||
+4:
|
||||
+ .p2align 3
|
||||
+5:
|
||||
+ .p2align 3
|
||||
+ .long 1f - 0f /* name length */
|
||||
+ .long 5f - 2f /* data length */
|
||||
+ .long 5 /* note type */
|
||||
+0: .asciz "GNU" /* vendor name */
|
||||
+1:
|
||||
+ .p2align 3
|
||||
+2: .long 0xc0000000 /* pr_type. */
|
||||
+ .long 4f - 3f /* pr_datasz. */
|
||||
+3:
|
||||
+ .long 0x1 /* BTI. */
|
||||
+4:
|
||||
+ .p2align 3
|
||||
+5:
|
||||
--- /dev/null 2020-11-04 08:04:13.849482156 +0000
|
||||
+++ binutils-2.30/ld/testsuite/ld-aarch64/property-bti-pac2.s 2020-11-04 14:56:42.278422479 +0000
|
||||
@@ -0,0 +1,50 @@
|
||||
+ .text
|
||||
+ .global foo
|
||||
+ .type foo, %function
|
||||
+foo:
|
||||
+ sub sp, sp, #16
|
||||
+ mov w0, 9
|
||||
+ str w0, [sp, 12]
|
||||
+ ldr w0, [sp, 12]
|
||||
+ add w0, w0, 4
|
||||
+ str w0, [sp, 12]
|
||||
+ nop
|
||||
+ add sp, sp, 16
|
||||
+ ret
|
||||
+ .size foo, .-foo
|
||||
+ .global bar
|
||||
+ .type bar, %function
|
||||
+.ifdef __property_bti__
|
||||
+ .section ".note.gnu.property", "a"
|
||||
+ .p2align 3
|
||||
+ .long 1f - 0f /* name length */
|
||||
+ .long 5f - 2f /* data length */
|
||||
+ .long 5 /* note type */
|
||||
+0: .asciz "GNU" /* vendor name */
|
||||
+1:
|
||||
+ .p2align 3
|
||||
+2: .long 0xc0000000 /* pr_type. */
|
||||
+ .long 4f - 3f /* pr_datasz. */
|
||||
+3:
|
||||
+ .long 0x1 /* BTI. */
|
||||
+4:
|
||||
+ .p2align 3
|
||||
+5:
|
||||
+.endif
|
||||
+.ifdef __property_pac__
|
||||
+ .section ".note.gnu.property", "a"
|
||||
+ .p2align 3
|
||||
+ .long 1f - 0f /* name length */
|
||||
+ .long 5f - 2f /* data length */
|
||||
+ .long 5 /* note type */
|
||||
+0: .asciz "GNU" /* vendor name */
|
||||
+1:
|
||||
+ .p2align 3
|
||||
+2: .long 0xc0000000 /* pr_type. */
|
||||
+ .long 4f - 3f /* pr_datasz. */
|
||||
+3:
|
||||
+ .long 0x2 /* PAC. */
|
||||
+4:
|
||||
+ .p2align 3
|
||||
+5:
|
||||
+.endif
|
||||
--- /dev/null 2020-11-04 08:04:13.849482156 +0000
|
||||
+++ binutils-2.30/ld/testsuite/ld-aarch64/property-bti-pac2.d 2020-11-04 14:56:42.278422479 +0000
|
||||
@@ -0,0 +1,12 @@
|
||||
+#name: GNU Property (combine multiple with BTI)
|
||||
+#source: property-bti-pac1.s
|
||||
+#source: property-bti-pac2.s
|
||||
+#as: -mabi=lp64 -defsym __property_bti__=1
|
||||
+#ld: -e _start
|
||||
+#readelf: -n
|
||||
+#target: *linux*
|
||||
+
|
||||
+Displaying notes found in: .note.gnu.property
|
||||
+ Owner Data size Description
|
||||
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
|
||||
+ Properties: AArch64 feature: BTI
|
||||
--- /dev/null 2020-11-04 08:04:13.849482156 +0000
|
||||
+++ binutils-2.30/ld/testsuite/ld-aarch64/property-bti-pac3.d 2020-11-04 14:56:42.278422479 +0000
|
||||
@@ -0,0 +1,12 @@
|
||||
+#name: GNU Property (combine multiple with PAC)
|
||||
+#source: property-bti-pac1.s
|
||||
+#source: property-bti-pac2.s
|
||||
+#as: -mabi=lp64 -defsym __property_pac__=1
|
||||
+#ld: -e _start
|
||||
+#readelf: -n
|
||||
+#target: *linux*
|
||||
+
|
||||
+Displaying notes found in: .note.gnu.property
|
||||
+ Owner Data size Description
|
||||
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
|
||||
+ Properties: AArch64 feature: PAC
|
||||
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.30/bfd/elfnn-aarch64.c
|
||||
--- binutils.orig/bfd/elfnn-aarch64.c 2020-11-25 11:53:26.648275978 +0000
|
||||
+++ binutils-2.30/bfd/elfnn-aarch64.c 2020-11-25 12:21:39.276864970 +0000
|
||||
@@ -9331,12 +9331,14 @@ elfNN_aarch64_link_setup_gnu_properties
|
||||
for the effect of GNU properties of the output_bfd. */
|
||||
static bfd_boolean
|
||||
elfNN_aarch64_merge_gnu_properties (struct bfd_link_info *info,
|
||||
- bfd *abfd,
|
||||
- elf_property *aprop,
|
||||
- elf_property *bprop)
|
||||
+ bfd *abfd,
|
||||
+ bfd *bbfd ATTRIBUTE_UNUSED,
|
||||
+ elf_property *aprop,
|
||||
+ elf_property *bprop)
|
||||
{
|
||||
uint32_t prop
|
||||
= elf_aarch64_tdata (info->output_bfd)->gnu_and_prop;
|
||||
+
|
||||
return _bfd_aarch64_elf_merge_gnu_properties (info, abfd, aprop,
|
||||
bprop, prop);
|
||||
}
|
||||
diff -rup binutils.orig/bfd/elfxx-aarch64.c binutils-2.30/bfd/elfxx-aarch64.c
|
||||
--- binutils.orig/bfd/elfxx-aarch64.c 2020-11-25 11:53:26.655275930 +0000
|
||||
+++ binutils-2.30/bfd/elfxx-aarch64.c 2020-11-25 12:21:34.689895875 +0000
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "elfxx-aarch64.h"
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
+#include "libbfd.h"
|
||||
|
||||
#define MASK(n) ((1u << (n)) - 1)
|
||||
|
||||
@@ -835,7 +836,10 @@ _bfd_aarch64_elf_merge_gnu_properties (s
|
||||
break;
|
||||
|
||||
default:
|
||||
- abort ();
|
||||
+ _bfd_error_handler
|
||||
+ ( _("error: %pB: <corrupt AArch64 property note: 0x%x>"),
|
||||
+ abfd, pr_type);
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
return updated;
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/property-bti-pac1.d binutils-2.30/ld/testsuite/ld-aarch64/property-bti-pac1.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/property-bti-pac1.d 2020-11-25 11:53:26.344278044 +0000
|
||||
+++ binutils-2.30/ld/testsuite/ld-aarch64/property-bti-pac1.d 2020-11-25 11:57:53.179471900 +0000
|
||||
@@ -1,6 +1,6 @@
|
||||
#name: GNU Property (single input, combine section)
|
||||
#source: property-bti-pac1.s
|
||||
-#as: -march=armv8.5-a -defsym __mult__=0
|
||||
+#as: -defsym __mult__=0
|
||||
#ld: -shared
|
||||
#readelf: -n
|
||||
#target: *linux*
|
@ -1,74 +1,34 @@
|
||||
diff -rup binutils.orig/gas/config/tc-aarch64.c binutils-2.30/gas/config/tc-aarch64.c
|
||||
--- binutils.orig/gas/config/tc-aarch64.c 2022-04-05 10:30:32.735881142 +0100
|
||||
+++ binutils-2.30/gas/config/tc-aarch64.c 2022-04-05 10:31:28.198694747 +0100
|
||||
@@ -8553,6 +8553,8 @@ static const struct aarch64_option_cpu_v
|
||||
{"sha3", AARCH64_FEATURE (AARCH64_FEATURE_SHA2
|
||||
| AARCH64_FEATURE_SHA3, 0),
|
||||
AARCH64_ARCH_NONE},
|
||||
+ {"rng", AARCH64_FEATURE (AARCH64_FEATURE_RNG, 0),
|
||||
+ AARCH64_ARCH_NONE},
|
||||
{NULL, AARCH64_ARCH_NONE, AARCH64_ARCH_NONE},
|
||||
};
|
||||
|
||||
diff -rup binutils.orig/gas/doc/c-aarch64.texi binutils-2.30/gas/doc/c-aarch64.texi
|
||||
--- binutils.orig/gas/doc/c-aarch64.texi 2022-04-05 10:30:32.735881142 +0100
|
||||
+++ binutils-2.30/gas/doc/c-aarch64.texi 2022-04-05 10:32:35.814423321 +0100
|
||||
@@ -179,6 +179,8 @@ automatically cause those extensions to
|
||||
@item @code{fp16fml} @tab ARMv8.2-A @tab ARMv8.4-A or later
|
||||
@tab Enable ARMv8.2 16-bit floating-point multiplication variant support.
|
||||
This implies @code{fp16}.
|
||||
+@item @code{rng} @tab ARMv8.5-A @tab No
|
||||
+ @tab Enable ARMv8.5-A random number instructions.
|
||||
@end multitable
|
||||
|
||||
@node AArch64 Syntax
|
||||
Only in binutils-2.30/gas/testsuite/gas/aarch64: rng-1.d
|
||||
Only in binutils-2.30/gas/testsuite/gas/aarch64: rng-1.s
|
||||
diff -rup binutils.orig/include/opcode/aarch64.h binutils-2.30/include/opcode/aarch64.h
|
||||
--- binutils.orig/include/opcode/aarch64.h 2022-04-05 10:30:33.256879707 +0100
|
||||
+++ binutils-2.30/include/opcode/aarch64.h 2022-04-05 10:42:30.241087320 +0100
|
||||
@@ -62,6 +62,7 @@ typedef uint32_t aarch64_insn;
|
||||
#define AARCH64_FEATURE_COMPNUM 0x40000000 /* Complex # instructions. */
|
||||
#define AARCH64_FEATURE_DOTPROD 0x080000000 /* Dot Product instructions. */
|
||||
#define AARCH64_FEATURE_F16_FML 0x1000000000ULL /* v8.2 FP16FML ins. */
|
||||
+#define AARCH64_FEATURE_RNG 0x80000000000ULL /* Random Number instructions. */
|
||||
|
||||
/* Architectures are the sum of the base and extensions. */
|
||||
#define AARCH64_ARCH_V8 AARCH64_FEATURE (AARCH64_FEATURE_V8, \
|
||||
diff -rup binutils.orig/opcodes/aarch64-opc.c binutils-2.30/opcodes/aarch64-opc.c
|
||||
--- binutils.orig/opcodes/aarch64-opc.c 2022-04-05 10:30:33.019880360 +0100
|
||||
+++ binutils-2.30/opcodes/aarch64-opc.c 2022-04-05 10:58:07.179526356 +0100
|
||||
@@ -3823,6 +3823,8 @@ const aarch64_sys_reg aarch64_sys_regs [
|
||||
{ "contextidr_el1", CPENC(3,0,C13,C0,1), 0 },
|
||||
{ "contextidr_el2", CPENC (3, 4, C13, C0, 1), F_ARCHEXT },
|
||||
{ "contextidr_el12", CPENC (3, 5, C13, C0, 1), F_ARCHEXT },
|
||||
+ { "rndr", CPENC(3,3,C2,C4,0), F_ARCHEXT }, /* RO */
|
||||
+ { "rndrrs", CPENC(3,3,C2,C4,1), F_ARCHEXT }, /* RO */
|
||||
{ "tpidr_el0", CPENC(3,3,C13,C0,2), 0 },
|
||||
{ "tpidrro_el0", CPENC(3,3,C13,C0,3), 0 }, /* RO */
|
||||
{ "tpidr_el1", CPENC(3,0,C13,C0,4), 0 },
|
||||
@@ -4254,6 +4256,13 @@ aarch64_sys_reg_supported_p (const aarch
|
||||
&& !AARCH64_CPU_HAS_FEATURE (features, AARCH64_FEATURE_V8_4))
|
||||
return FALSE;
|
||||
|
||||
+ /* Random Number Instructions. For now they are available
|
||||
+ (and optional) only with ARMv8.5-A. */
|
||||
+ if (( reg->value == CPENC (3, 3, C2, C4, 0)
|
||||
+ || reg->value == CPENC (3, 3, C2, C4, 1))
|
||||
+ && !(AARCH64_CPU_HAS_FEATURE (features, AARCH64_FEATURE_RNG)))
|
||||
+ return FALSE;
|
||||
+
|
||||
return TRUE;
|
||||
}
|
||||
Only in binutils-2.35.2/gas/testsuite/gas/aarch64: rng-1.d
|
||||
Only in binutils-2.35.2/gas/testsuite/gas/aarch64: rng-1.s
|
||||
diff -rup binutils.orig/opcodes/aarch64-opc.c binutils-2.35.2/opcodes/aarch64-opc.c
|
||||
--- binutils.orig/opcodes/aarch64-opc.c 2022-04-05 11:50:10.131798329 +0100
|
||||
+++ binutils-2.35.2/opcodes/aarch64-opc.c 2022-04-05 11:54:32.596827591 +0100
|
||||
@@ -3810,9 +3810,6 @@ aarch64_print_operand (char *buf, size_t
|
||||
#define SR_FEAT(n,e,f,feat) \
|
||||
SYSREG ((n), (e), (f) | F_ARCHEXT, AARCH64_FEATURE_##feat)
|
||||
|
||||
-#define SR_RNG(n,e,f) \
|
||||
- SYSREG ((n), (e), (f) | F_ARCHEXT, AARCH64_FEATURE_RNG | AARCH64_FEATURE_V8_5)
|
||||
-
|
||||
#define SR_V8_1(n,e,f) SR_FEAT (n,e,f,V8_1)
|
||||
#define SR_V8_2(n,e,f) SR_FEAT (n,e,f,V8_2)
|
||||
#define SR_V8_3(n,e,f) SR_FEAT (n,e,f,V8_3)
|
||||
@@ -3820,6 +3817,7 @@ aarch64_print_operand (char *buf, size_t
|
||||
#define SR_V8_4(n,e,f) SR_FEAT (n,e,f,V8_4)
|
||||
#define SR_PAN(n,e,f) SR_FEAT (n,e,f,PAN)
|
||||
#define SR_RAS(n,e,f) SR_FEAT (n,e,f,RAS)
|
||||
+#define SR_RNG(n,e,f) SR_FEAT (n,e,f,RNG)
|
||||
#define SR_SSBS(n,e,f) SR_FEAT (n,e,f,SSBS)
|
||||
#define SR_SVE(n,e,f) SR_FEAT (n,e,f,SVE)
|
||||
#define SR_ID_PFR2(n,e,f) SR_FEAT (n,e,f,ID_PFR2)
|
||||
--- /dev/null 2022-04-05 09:32:54.900867346 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/aarch64/rng-1.s 2022-04-05 10:36:04.921589937 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/aarch64/rng-1.s 2022-04-05 11:55:13.973674567 +0100
|
||||
@@ -0,0 +1,3 @@
|
||||
+ .arch armv8.4-a+rng
|
||||
+ mrs x5, rndr
|
||||
+ mrs x6, rndrrs
|
||||
--- /dev/null 2022-04-05 09:32:54.900867346 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/aarch64/rng-1.d 2022-04-05 10:35:48.937653638 +0100
|
||||
+++ binutils-2.35.2/gas/testsuite/gas/aarch64/rng-1.d 2022-04-05 11:55:45.338558554 +0100
|
||||
@@ -0,0 +1,10 @@
|
||||
+#source: rng-1.s
|
||||
+#objdump: -dr
|
||||
@ -80,3 +40,14 @@ diff -rup binutils.orig/opcodes/aarch64-opc.c binutils-2.30/opcodes/aarch64-opc.
|
||||
+0+ <.*>:
|
||||
+.*: d53b2405 mrs x5, rndr
|
||||
+.*: d53b2426 mrs x6, rndrrs
|
||||
--- binutils.orig/gas/config/tc-aarch64.c 2022-05-23 09:44:07.623234684 +0100
|
||||
+++ binutils-2.35.2/gas/config/tc-aarch64.c 2022-05-23 09:47:09.147696001 +0100
|
||||
@@ -9206,7 +9206,7 @@ aarch64_parse_features (const char *str,
|
||||
break;
|
||||
}
|
||||
|
||||
- if (opt->name == NULL)
|
||||
+ if (opt->name == NULL && adding_value)
|
||||
{
|
||||
as_bad (_("unknown architectural extension `%s'"), str);
|
||||
return 0;
|
||||
|
12
SOURCES/binutils-aarch64-small-plt0.patch
Normal file
12
SOURCES/binutils-aarch64-small-plt0.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- binutils.orig/bfd/elfnn-aarch64.c 2025-02-07 12:48:33.944978470 +0000
|
||||
+++ binutils-2.35.2/bfd/elfnn-aarch64.c 2025-02-07 12:48:43.791002138 +0000
|
||||
@@ -9515,7 +9515,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
SOURCES/binutils-add-sym-cache-to-elf-link-hash.patch
Normal file
1981
SOURCES/binutils-add-sym-cache-to-elf-link-hash.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.30/gas/config/obj-elf.c
|
||||
--- binutils.orig/gas/config/obj-elf.c 2018-09-24 17:50:06.974172867 +0100
|
||||
+++ binutils-2.30/gas/config/obj-elf.c 2018-09-25 15:19:33.559830794 +0100
|
||||
@@ -82,9 +82,11 @@ static void obj_elf_gnu_attribute (int);
|
||||
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);
|
||||
@ -13,7 +13,7 @@ diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.30/gas/config/obj-elf.c
|
||||
{"comm", obj_elf_common, 0},
|
||||
{"common", obj_elf_common, 1},
|
||||
{"ident", obj_elf_ident, 0},
|
||||
@@ -1007,6 +1009,27 @@ obj_elf_section_name (void)
|
||||
@@ -1003,6 +1005,27 @@ obj_elf_section_name (void)
|
||||
return name;
|
||||
}
|
||||
|
||||
@ -41,18 +41,19 @@ diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.30/gas/config/obj-elf.c
|
||||
void
|
||||
obj_elf_section (int push)
|
||||
{
|
||||
diff -rup binutils.orig/gas/doc/as.texinfo binutils-2.30/gas/doc/as.texinfo
|
||||
--- binutils.orig/gas/doc/as.texinfo 2018-09-24 17:50:06.984172788 +0100
|
||||
+++ binutils-2.30/gas/doc/as.texinfo 2018-09-25 15:19:43.557748972 +0100
|
||||
@@ -4407,6 +4407,7 @@ Some machine configurations provide addi
|
||||
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}}
|
||||
* Balign:: @code{.balign [@var{abs-expr}[, @var{abs-expr}]]}
|
||||
* Bundle directives:: @code{.bundle_align_mode @var{abs-expr}}, etc
|
||||
* Byte:: @code{.byte @var{expressions}}
|
||||
@@ -4703,6 +4704,12 @@ trailing zero byte) into consecutive add
|
||||
@@ -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''.
|
||||
|
||||
@ -63,6 +64,7 @@ diff -rup binutils.orig/gas/doc/as.texinfo binutils-2.30/gas/doc/as.texinfo
|
||||
+has been created.
|
||||
+
|
||||
@node Balign
|
||||
@section @code{.balign[wl] @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
|
||||
@section @code{.balign[wl] [@var{abs-expr}[, @var{abs-expr}[, @var{abs-expr}]]]}
|
||||
|
||||
Only in binutils-2.30/gas/doc: as.texinfo.orig
|
||||
Only in binutils-2.34/gas/doc: as.texi.orig
|
||||
Only in binutils-2.34/gas/doc: as.texi.rej
|
||||
|
11
SOURCES/binutils-autoconf-version.patch
Normal file
11
SOURCES/binutils-autoconf-version.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- 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
|
@ -1,306 +0,0 @@
|
||||
diff -rup binutils.orig/bfd/cofflink.c binutils-2.30/bfd/cofflink.c
|
||||
--- binutils.orig/bfd/cofflink.c 2021-06-15 15:38:31.578170486 +0100
|
||||
+++ binutils-2.30/bfd/cofflink.c 2021-06-15 15:59:12.394611963 +0100
|
||||
@@ -3084,8 +3084,8 @@ _bfd_coff_generic_relocate_section (bfd
|
||||
then zero this reloc field. */
|
||||
if (sec != NULL && discarded_section (sec))
|
||||
{
|
||||
- _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
- contents + (rel->r_vaddr - input_section->vma));
|
||||
+ (void) _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
+ contents, (rel->r_vaddr - input_section->vma));
|
||||
continue;
|
||||
}
|
||||
|
||||
diff -rup binutils.orig/bfd/dwarf2.c binutils-2.30/bfd/dwarf2.c
|
||||
--- binutils.orig/bfd/dwarf2.c 2021-06-15 15:38:31.597170370 +0100
|
||||
+++ binutils-2.30/bfd/dwarf2.c 2021-06-15 15:42:19.979779516 +0100
|
||||
@@ -2865,7 +2865,9 @@ find_abstract_instance_name (struct comp
|
||||
info_ptr = unit->stash->info_ptr_memory;
|
||||
info_ptr_end = unit->stash->info_ptr_end;
|
||||
total = info_ptr_end - info_ptr;
|
||||
- if (!die_ref || die_ref >= total)
|
||||
+ if (!die_ref)
|
||||
+ return TRUE;
|
||||
+ if (die_ref >= total)
|
||||
{
|
||||
_bfd_error_handler
|
||||
(_("Dwarf Error: Invalid abstract instance DIE ref."));
|
||||
diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.30/bfd/elf-bfd.h
|
||||
--- binutils.orig/bfd/elf-bfd.h 2021-06-15 15:38:31.595170382 +0100
|
||||
+++ binutils-2.30/bfd/elf-bfd.h 2021-06-15 15:58:55.365715715 +0100
|
||||
@@ -2829,8 +2829,8 @@ extern asection _bfd_elf_large_com_secti
|
||||
howto, index, contents) \
|
||||
{ \
|
||||
int i_; \
|
||||
- _bfd_clear_contents (howto, input_bfd, input_section, \
|
||||
- contents + rel[index].r_offset); \
|
||||
+ (void) _bfd_clear_contents (howto, input_bfd, input_section, \
|
||||
+ contents, rel[index].r_offset); \
|
||||
\
|
||||
if (bfd_link_relocatable (info) \
|
||||
&& (input_section->flags & SEC_DEBUGGING)) \
|
||||
diff -rup binutils.orig/bfd/elf32-arc.c binutils-2.30/bfd/elf32-arc.c
|
||||
--- binutils.orig/bfd/elf32-arc.c 2021-06-15 15:38:31.579170480 +0100
|
||||
+++ binutils-2.30/bfd/elf32-arc.c 2021-06-15 15:58:28.869877138 +0100
|
||||
@@ -1532,8 +1532,8 @@ elf_arc_relocate_section (bfd * outp
|
||||
/* Clean relocs for symbols in discarded sections. */
|
||||
if (sec != NULL && discarded_section (sec))
|
||||
{
|
||||
- _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
- contents + rel->r_offset);
|
||||
+ (void) _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
+ contents, rel->r_offset);
|
||||
rel->r_offset = rel->r_offset;
|
||||
rel->r_info = 0;
|
||||
rel->r_addend = 0;
|
||||
diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.30/bfd/elf32-i386.c
|
||||
--- binutils.orig/bfd/elf32-i386.c 2021-06-15 15:38:31.578170486 +0100
|
||||
+++ binutils-2.30/bfd/elf32-i386.c 2021-06-15 15:58:12.694975692 +0100
|
||||
@@ -2165,8 +2165,8 @@ elf_i386_relocate_section (bfd *output_b
|
||||
|
||||
if (sec != NULL && discarded_section (sec))
|
||||
{
|
||||
- _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
- contents + rel->r_offset);
|
||||
+ (void) _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
+ contents, rel->r_offset);
|
||||
wrel->r_offset = rel->r_offset;
|
||||
wrel->r_info = 0;
|
||||
wrel->r_addend = 0;
|
||||
diff -rup binutils.orig/bfd/elf32-metag.c binutils-2.30/bfd/elf32-metag.c
|
||||
--- binutils.orig/bfd/elf32-metag.c 2021-06-15 15:38:31.593170394 +0100
|
||||
+++ binutils-2.30/bfd/elf32-metag.c 2021-06-15 15:57:48.039125909 +0100
|
||||
@@ -1392,8 +1392,8 @@ metag_final_link_relocate (reloc_howto_t
|
||||
#define METAG_RELOC_AGAINST_DISCARDED_SECTION(info, input_bfd, input_section, \
|
||||
rel, relend, howto, contents) \
|
||||
{ \
|
||||
- _bfd_clear_contents (howto, input_bfd, input_section, \
|
||||
- contents + rel->r_offset); \
|
||||
+ (void) _bfd_clear_contents (howto, input_bfd, input_section, \
|
||||
+ contents, rel->r_offset); \
|
||||
\
|
||||
if (bfd_link_relocatable (info) \
|
||||
&& (input_section->flags & SEC_DEBUGGING)) \
|
||||
diff -rup binutils.orig/bfd/elf32-nds32.c binutils-2.30/bfd/elf32-nds32.c
|
||||
--- binutils.orig/bfd/elf32-nds32.c 2021-06-15 15:38:31.589170419 +0100
|
||||
+++ binutils-2.30/bfd/elf32-nds32.c 2021-06-15 15:56:30.184600239 +0100
|
||||
@@ -12771,18 +12771,17 @@ nds32_elf_get_relocated_section_contents
|
||||
symbol = *(*parent)->sym_ptr_ptr;
|
||||
if (symbol->section && discarded_section (symbol->section))
|
||||
{
|
||||
- bfd_byte *p;
|
||||
+ bfd_vma off;
|
||||
static reloc_howto_type none_howto
|
||||
= HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL,
|
||||
"unused", FALSE, 0, 0, FALSE);
|
||||
|
||||
- p = data + (*parent)->address * bfd_octets_per_byte (input_bfd);
|
||||
- _bfd_clear_contents ((*parent)->howto, input_bfd, input_section,
|
||||
- p);
|
||||
- (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
|
||||
+ off = (*parent)->address * bfd_octets_per_byte (input_bfd);
|
||||
+ r = _bfd_clear_contents ((*parent)->howto, input_bfd,
|
||||
+ input_section, data, off);
|
||||
+ (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
|
||||
(*parent)->addend = 0;
|
||||
(*parent)->howto = &none_howto;
|
||||
- r = bfd_reloc_ok;
|
||||
}
|
||||
else
|
||||
r = bfd_perform_relocation (input_bfd, *parent, data,
|
||||
diff -rup binutils.orig/bfd/elf32-ppc.c binutils-2.30/bfd/elf32-ppc.c
|
||||
--- binutils.orig/bfd/elf32-ppc.c 2021-06-15 15:38:31.597170370 +0100
|
||||
+++ binutils-2.30/bfd/elf32-ppc.c 2021-06-15 15:56:39.367544293 +0100
|
||||
@@ -7778,8 +7778,8 @@ ppc_elf_relocate_section (bfd *output_bf
|
||||
if (r_type < R_PPC_max)
|
||||
howto = ppc_elf_howto_table[r_type];
|
||||
|
||||
- _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
- contents + rel->r_offset);
|
||||
+ (void) _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
+ contents, rel->r_offset);
|
||||
wrel->r_offset = rel->r_offset;
|
||||
wrel->r_info = 0;
|
||||
wrel->r_addend = 0;
|
||||
diff -rup binutils.orig/bfd/elf32-visium.c binutils-2.30/bfd/elf32-visium.c
|
||||
--- binutils.orig/bfd/elf32-visium.c 2021-06-15 15:38:31.580170473 +0100
|
||||
+++ binutils-2.30/bfd/elf32-visium.c 2021-06-15 15:57:29.271240254 +0100
|
||||
@@ -616,8 +616,8 @@ visium_elf_relocate_section (bfd *output
|
||||
/* For relocs against symbols from removed linkonce sections,
|
||||
or sections discarded by a linker script, we just want the
|
||||
section contents zeroed. Avoid any special processing. */
|
||||
- _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
- contents + rel->r_offset);
|
||||
+ (void) _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
+ contents, rel->r_offset);
|
||||
|
||||
rel->r_info = 0;
|
||||
rel->r_addend = 0;
|
||||
diff -rup binutils.orig/bfd/elf64-ppc.c binutils-2.30/bfd/elf64-ppc.c
|
||||
--- binutils.orig/bfd/elf64-ppc.c 2021-06-15 15:38:31.578170486 +0100
|
||||
+++ binutils-2.30/bfd/elf64-ppc.c 2021-06-15 15:57:01.529409265 +0100
|
||||
@@ -13526,9 +13526,9 @@ ppc64_elf_relocate_section (bfd *output_
|
||||
|
||||
if (sec != NULL && discarded_section (sec))
|
||||
{
|
||||
- _bfd_clear_contents (ppc64_elf_howto_table[r_type],
|
||||
- input_bfd, input_section,
|
||||
- contents + rel->r_offset);
|
||||
+ (void) _bfd_clear_contents (ppc64_elf_howto_table[r_type],
|
||||
+ input_bfd, input_section,
|
||||
+ contents, rel->r_offset);
|
||||
wrel->r_offset = rel->r_offset;
|
||||
wrel->r_info = 0;
|
||||
wrel->r_addend = 0;
|
||||
diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.30/bfd/elf64-x86-64.c
|
||||
--- binutils.orig/bfd/elf64-x86-64.c 2021-06-15 15:38:31.585170443 +0100
|
||||
+++ binutils-2.30/bfd/elf64-x86-64.c 2021-06-15 15:57:09.831358693 +0100
|
||||
@@ -2457,8 +2457,8 @@ elf_x86_64_relocate_section (bfd *output
|
||||
|
||||
if (sec != NULL && discarded_section (sec))
|
||||
{
|
||||
- _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
- contents + rel->r_offset);
|
||||
+ (void) _bfd_clear_contents (howto, input_bfd, input_section,
|
||||
+ contents, rel->r_offset);
|
||||
wrel->r_offset = rel->r_offset;
|
||||
wrel->r_info = 0;
|
||||
wrel->r_addend = 0;
|
||||
diff -rup binutils.orig/bfd/libbfd-in.h binutils-2.30/bfd/libbfd-in.h
|
||||
--- binutils.orig/bfd/libbfd-in.h 2021-06-15 15:38:31.593170394 +0100
|
||||
+++ binutils-2.30/bfd/libbfd-in.h 2021-06-15 15:54:10.856449129 +0100
|
||||
@@ -674,8 +674,9 @@ extern bfd_reloc_status_type _bfd_reloca
|
||||
(reloc_howto_type *, bfd *, bfd_vma, bfd_byte *);
|
||||
|
||||
/* Clear a given location using a given howto. */
|
||||
-extern void _bfd_clear_contents (reloc_howto_type *howto, bfd *input_bfd,
|
||||
- asection *input_section, bfd_byte *location);
|
||||
+extern bfd_reloc_status_type _bfd_clear_contents
|
||||
+ (reloc_howto_type *howto, bfd *input_bfd,
|
||||
+ asection *input_section, bfd_byte *, bfd_vma);
|
||||
|
||||
/* Link stabs in sections in the first pass. */
|
||||
|
||||
diff -rup binutils.orig/bfd/libbfd.h binutils-2.30/bfd/libbfd.h
|
||||
--- binutils.orig/bfd/libbfd.h 2021-06-15 15:38:31.581170467 +0100
|
||||
+++ binutils-2.30/bfd/libbfd.h 2021-06-15 15:53:55.863540475 +0100
|
||||
@@ -679,8 +679,9 @@ extern bfd_reloc_status_type _bfd_reloca
|
||||
(reloc_howto_type *, bfd *, bfd_vma, bfd_byte *);
|
||||
|
||||
/* Clear a given location using a given howto. */
|
||||
-extern void _bfd_clear_contents (reloc_howto_type *howto, bfd *input_bfd,
|
||||
- asection *input_section, bfd_byte *location);
|
||||
+extern bfd_reloc_status_type _bfd_clear_contents
|
||||
+ (reloc_howto_type *howto, bfd *input_bfd,
|
||||
+ asection *input_section, bfd_byte *, bfd_vma);
|
||||
|
||||
/* Link stabs in sections in the first pass. */
|
||||
|
||||
diff -rup binutils.orig/bfd/reloc.c binutils-2.30/bfd/reloc.c
|
||||
--- binutils.orig/bfd/reloc.c 2021-06-15 15:38:31.593170394 +0100
|
||||
+++ binutils-2.30/bfd/reloc.c 2021-06-15 15:51:59.449249747 +0100
|
||||
@@ -1604,23 +1604,29 @@ _bfd_relocate_contents (reloc_howto_type
|
||||
relocations against discarded symbols, to make ignorable debug or unwind
|
||||
information more obvious. */
|
||||
|
||||
-void
|
||||
+bfd_reloc_status_type
|
||||
_bfd_clear_contents (reloc_howto_type *howto,
|
||||
bfd *input_bfd,
|
||||
asection *input_section,
|
||||
- bfd_byte *location)
|
||||
+ bfd_byte *buf,
|
||||
+ bfd_vma off)
|
||||
{
|
||||
int size;
|
||||
bfd_vma x = 0;
|
||||
+ bfd_byte *location;
|
||||
+
|
||||
+ if (!bfd_reloc_offset_in_range (howto, input_bfd, input_section, off))
|
||||
+ return bfd_reloc_outofrange;
|
||||
|
||||
/* Get the value we are going to relocate. */
|
||||
- size = bfd_get_reloc_size (howto);
|
||||
+ location = buf + off;
|
||||
+ size = bfd_get_reloc_size (howto);
|
||||
switch (size)
|
||||
{
|
||||
default:
|
||||
- abort ();
|
||||
+ return bfd_reloc_notsupported;
|
||||
case 0:
|
||||
- return;
|
||||
+ return bfd_reloc_ok;
|
||||
case 1:
|
||||
x = bfd_get_8 (input_bfd, location);
|
||||
break;
|
||||
@@ -1634,7 +1640,7 @@ _bfd_clear_contents (reloc_howto_type *h
|
||||
#ifdef BFD64
|
||||
x = bfd_get_64 (input_bfd, location);
|
||||
#else
|
||||
- abort ();
|
||||
+ return bfd_reloc_notsupported;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1654,7 +1660,7 @@ _bfd_clear_contents (reloc_howto_type *h
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
- abort ();
|
||||
+ return bfd_reloc_notsupported;
|
||||
case 1:
|
||||
bfd_put_8 (input_bfd, x, location);
|
||||
break;
|
||||
@@ -1668,10 +1674,12 @@ _bfd_clear_contents (reloc_howto_type *h
|
||||
#ifdef BFD64
|
||||
bfd_put_64 (input_bfd, x, location);
|
||||
#else
|
||||
- abort ();
|
||||
+ return bfd_reloc_notsupported;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
+
|
||||
+ return bfd_reloc_ok;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8209,20 +8217,30 @@ bfd_generic_get_relocated_section_conten
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
- if (symbol->section && discarded_section (symbol->section))
|
||||
+ /* Zap reloc field when the symbol is from a discarded
|
||||
+ section, ignoring any addend. Do the same when called
|
||||
+ from bfd_simple_get_relocated_section_contents for
|
||||
+ undefined symbols in debug sections. This is to keep
|
||||
+ debug info reasonably sane, in particular so that
|
||||
+ DW_FORM_ref_addr to another file's .debug_info isn't
|
||||
+ confused with an offset into the current file's
|
||||
+ .debug_info. */
|
||||
+ if ((symbol->section != NULL && discarded_section (symbol->section))
|
||||
+ || (symbol->section == bfd_und_section_ptr
|
||||
+ && (input_section->flags & SEC_DEBUGGING) != 0
|
||||
+ && link_info->input_bfds == link_info->output_bfd))
|
||||
{
|
||||
- bfd_byte *p;
|
||||
+ bfd_vma off;
|
||||
static reloc_howto_type none_howto
|
||||
= HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL,
|
||||
"unused", FALSE, 0, 0, FALSE);
|
||||
|
||||
- p = data + (*parent)->address * bfd_octets_per_byte (input_bfd);
|
||||
- _bfd_clear_contents ((*parent)->howto, input_bfd, input_section,
|
||||
- p);
|
||||
+ off = (*parent)->address * bfd_octets_per_byte (input_bfd);
|
||||
+ r = _bfd_clear_contents ((*parent)->howto, input_bfd,
|
||||
+ input_section, data, off);
|
||||
(*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
|
||||
(*parent)->addend = 0;
|
||||
(*parent)->howto = &none_howto;
|
||||
- r = bfd_reloc_ok;
|
||||
}
|
||||
else
|
||||
r = bfd_perform_relocation (input_bfd,
|
@ -1,14 +0,0 @@
|
||||
--- binutils.orig/bfd/coffgen.c 2022-04-25 13:43:52.724745386 +0100
|
||||
+++ binutils-2.30/bfd/coffgen.c 2022-04-25 13:46:39.583596137 +0100
|
||||
@@ -1838,10 +1838,7 @@ coff_get_normalized_symtab (bfd *abfd)
|
||||
internal_ptr->is_sym = TRUE;
|
||||
|
||||
/* PR 17512: file: 1353-1166-0.004. */
|
||||
- if (symbol_ptr->u.syment.n_sclass == C_FILE
|
||||
- && symbol_ptr->u.syment.n_numaux > 0
|
||||
- && raw_src + symesz + symbol_ptr->u.syment.n_numaux
|
||||
- * symesz > raw_end)
|
||||
+ if (symbol_ptr->u.syment.n_numaux > ((raw_end - 1) - raw_src) / symesz)
|
||||
{
|
||||
bfd_release (abfd, internal);
|
||||
return NULL;
|
@ -1,29 +0,0 @@
|
||||
--- binutils.orig/bfd/elflink.c 2020-12-08 17:45:26.487260908 +0000
|
||||
+++ binutils-2.30/bfd/elflink.c 2020-12-08 17:48:06.650728413 +0000
|
||||
@@ -1895,7 +1895,7 @@ _bfd_elf_add_default_symbol (bfd *abfd,
|
||||
if (skip)
|
||||
goto nondefault;
|
||||
|
||||
- if (hi->def_regular)
|
||||
+ if (hi->def_regular || ELF_COMMON_DEF_P (hi))
|
||||
{
|
||||
/* If the undecorated symbol will have a version added by a
|
||||
script different to H, then don't indirect to/from the
|
||||
@@ -2236,7 +2236,7 @@ _bfd_elf_link_assign_sym_version (struct
|
||||
|
||||
/* We only need version numbers for symbols defined in regular
|
||||
objects. */
|
||||
- if (!h->def_regular)
|
||||
+ if (!h->def_regular && !ELF_COMMON_DEF_P (h))
|
||||
return TRUE;
|
||||
|
||||
bed = get_elf_backend_data (info->output_bfd);
|
||||
@@ -9957,7 +9957,7 @@ elf_link_output_extsym (struct bfd_hash_
|
||||
Elf_Internal_Versym iversym;
|
||||
Elf_External_Versym *eversym;
|
||||
|
||||
- if (!h->def_regular)
|
||||
+ if (!h->def_regular && !ELF_COMMON_DEF_P (h))
|
||||
{
|
||||
if (h->verinfo.verdef == NULL
|
||||
|| (elf_dyn_lib_class (h->verinfo.verdef->vd_bfd)
|
44
SOURCES/binutils-config.patch
Normal file
44
SOURCES/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,591 +0,0 @@
|
||||
diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.30/bfd/elf-bfd.h
|
||||
--- binutils.orig/bfd/elf-bfd.h 2020-02-12 13:31:20.348605538 +0000
|
||||
+++ binutils-2.30/bfd/elf-bfd.h 2020-02-12 13:31:33.831507582 +0000
|
||||
@@ -1479,6 +1479,19 @@ struct elf_backend_data
|
||||
/* Opcode representing no unwind. */
|
||||
int (*cant_unwind_opcode) (struct bfd_link_info *);
|
||||
|
||||
+ /* Called when a section has extra reloc sections. */
|
||||
+ bfd_boolean (*init_secondary_reloc_section) (bfd *, Elf_Internal_Shdr *, const char *, unsigned int);
|
||||
+
|
||||
+ /* Called when after loading the normal relocs for a section. */
|
||||
+ bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **);
|
||||
+
|
||||
+ /* Called after writing the normal relocs for a section. */
|
||||
+ bfd_boolean (*write_secondary_relocs) (bfd *, asection *);
|
||||
+
|
||||
+ /* Called to return the value to set in the ST_SHNDX field of an ELF symbol
|
||||
+ from an iternal symbol which does not map to any known section. */
|
||||
+ unsigned int (*symbol_section_index) (bfd *, elf_symbol_type *);
|
||||
+
|
||||
/* This is non-zero if static TLS segments require a special alignment. */
|
||||
unsigned static_tls_alignment;
|
||||
|
||||
@@ -2696,6 +2709,19 @@ extern bfd_vma elf64_r_sym (bfd_vma);
|
||||
extern bfd_vma elf32_r_info (bfd_vma, bfd_vma);
|
||||
extern bfd_vma elf32_r_sym (bfd_vma);
|
||||
|
||||
+
|
||||
+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 **);
|
||||
+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
|
||||
+ (bfd *, asection *);
|
||||
+extern unsigned int _bfd_elf_symbol_section_index
|
||||
+ (bfd *, elf_symbol_type *);
|
||||
+
|
||||
+
|
||||
/* Large common section. */
|
||||
extern asection _bfd_elf_large_com_section;
|
||||
|
||||
diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c
|
||||
--- binutils.orig/bfd/elf.c 2020-02-12 13:31:20.347605546 +0000
|
||||
+++ binutils-2.30/bfd/elf.c 2020-02-12 13:33:19.635738944 +0000
|
||||
@@ -1572,7 +1572,7 @@ _bfd_elf_copy_private_bfd_data (bfd *ibf
|
||||
/* Final attempt. Call the backend copy function
|
||||
with a NULL input section. */
|
||||
if (bed->elf_backend_copy_special_section_fields != NULL)
|
||||
- bed->elf_backend_copy_special_section_fields (ibfd, obfd, NULL, oheader);
|
||||
+ (void) bed->elf_backend_copy_special_section_fields (ibfd, obfd, NULL, oheader);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2416,11 +2416,14 @@ bfd_section_from_shdr (bfd *abfd, unsign
|
||||
sections. */
|
||||
if (*p_hdr != NULL)
|
||||
{
|
||||
- _bfd_error_handler
|
||||
- /* xgettext:c-format */
|
||||
- (_("%B: warning: multiple relocation sections for section %A \
|
||||
-found - ignoring all but the first"),
|
||||
- abfd, target_sect);
|
||||
+ if (bed->init_secondary_reloc_section == NULL
|
||||
+ || ! bed->init_secondary_reloc_section (abfd, hdr, name, shindex))
|
||||
+ {
|
||||
+ _bfd_error_handler
|
||||
+ /* xgettext:c-format */
|
||||
+ (_("%pB: warning: secondary relocation section '%s' for section %pA found - ignoring"),
|
||||
+ abfd, name, target_sect);
|
||||
+ }
|
||||
goto success;
|
||||
}
|
||||
hdr2 = (Elf_Internal_Shdr *) bfd_alloc (abfd, sizeof (*hdr2));
|
||||
@@ -7948,9 +7951,20 @@ error_return:
|
||||
if (elf_symtab_shndx_list (abfd))
|
||||
shndx = elf_symtab_shndx_list (abfd)->ndx;
|
||||
break;
|
||||
- default:
|
||||
+ case SHN_COMMON:
|
||||
+ case SHN_ABS:
|
||||
shndx = SHN_ABS;
|
||||
break;
|
||||
+ default:
|
||||
+ if (bed->symbol_section_index)
|
||||
+ shndx = bed->symbol_section_index (abfd, type_ptr);
|
||||
+ else
|
||||
+ {
|
||||
+ _bfd_error_handler (_("%pB: Unable to handle section index %x in ELF symbol. Using ABS instead. (%x)"),
|
||||
+ abfd, shndx, SHN_COMMON);
|
||||
+ shndx = SHN_ABS;
|
||||
+ }
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -11556,3 +11570,354 @@ _bfd_elf_maybe_function_sym (const asymb
|
||||
size = 1;
|
||||
return size;
|
||||
}
|
||||
+
|
||||
+/* Set to non-zero to enable some debug messages. */
|
||||
+#define DEBUG_SECONDARY_RELOCS 0
|
||||
+
|
||||
+/* An internal-to-the-bfd-library only section type
|
||||
+ used to indicate a cached secondary reloc section. */
|
||||
+#define SHT_SECONDARY_RELOC (SHT_LOOS + SHT_RELA)
|
||||
+
|
||||
+/* Create a BFD section to hold a secondary reloc section. */
|
||||
+
|
||||
+bfd_boolean
|
||||
+_bfd_elf_init_secondary_reloc_section (bfd * abfd,
|
||||
+ Elf_Internal_Shdr *hdr,
|
||||
+ const char * name,
|
||||
+ unsigned int shindex)
|
||||
+{
|
||||
+ /* We only support RELA secondary relocs. */
|
||||
+ if (hdr->sh_type != SHT_RELA)
|
||||
+ return FALSE;
|
||||
+
|
||||
+#if DEBUG_SECONDARY_RELOCS
|
||||
+ fprintf (stderr, "secondary reloc section %s encountered\n", name);
|
||||
+#endif
|
||||
+ hdr->sh_type = SHT_SECONDARY_RELOC;
|
||||
+ return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
|
||||
+}
|
||||
+
|
||||
+/* Read in any secondary relocs associated with SEC. */
|
||||
+
|
||||
+bfd_boolean
|
||||
+_bfd_elf_slurp_secondary_reloc_section (bfd * abfd,
|
||||
+ asection * sec,
|
||||
+ asymbol ** symbols)
|
||||
+{
|
||||
+ const struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
|
||||
+ asection * relsec;
|
||||
+ bfd_boolean result = TRUE;
|
||||
+ bfd_vma (*r_sym) (bfd_vma);
|
||||
+
|
||||
+
|
||||
+#ifdef BFD64
|
||||
+ if (bfd_arch_bits_per_address (abfd) != 32)
|
||||
+ r_sym = elf64_r_sym;
|
||||
+ else
|
||||
+#endif
|
||||
+ r_sym = elf32_r_sym;
|
||||
+
|
||||
+ /* Discover if there are any secondary reloc sections
|
||||
+ associated with SEC. */
|
||||
+ for (relsec = abfd->sections; relsec != NULL; relsec = relsec->next)
|
||||
+ {
|
||||
+ 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)
|
||||
+ {
|
||||
+ bfd_byte * native_relocs;
|
||||
+ bfd_byte * native_reloc;
|
||||
+ arelent * internal_relocs;
|
||||
+ arelent * internal_reloc;
|
||||
+ unsigned int i;
|
||||
+ unsigned int entsize;
|
||||
+ unsigned int symcount;
|
||||
+ unsigned int reloc_count;
|
||||
+
|
||||
+#if DEBUG_SECONDARY_RELOCS
|
||||
+ fprintf (stderr, "read secondary relocs for %s from %s\n", sec->name, relsec->name);
|
||||
+#endif
|
||||
+ entsize = hdr->sh_entsize;
|
||||
+
|
||||
+ native_relocs = bfd_malloc (hdr->sh_size);
|
||||
+ if (native_relocs == NULL)
|
||||
+ {
|
||||
+ result = FALSE;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ reloc_count = NUM_SHDR_ENTRIES (hdr);
|
||||
+ internal_relocs = (arelent *) bfd_alloc2 (abfd, reloc_count, sizeof (arelent));
|
||||
+ if (internal_relocs == NULL)
|
||||
+ {
|
||||
+ free (native_relocs);
|
||||
+ result = FALSE;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0
|
||||
+ || (bfd_bread (native_relocs, hdr->sh_size, abfd) != hdr->sh_size))
|
||||
+ {
|
||||
+ free (native_relocs);
|
||||
+ free (internal_relocs);
|
||||
+ result = FALSE;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ symcount = bfd_get_symcount (abfd);
|
||||
+
|
||||
+ for (i = 0, internal_reloc = internal_relocs, native_reloc = native_relocs;
|
||||
+ i < reloc_count;
|
||||
+ i++, internal_reloc++, native_reloc += entsize)
|
||||
+ {
|
||||
+ ;
|
||||
+ Elf_Internal_Rela rela;
|
||||
+
|
||||
+ ebd->s->swap_reloca_in (abfd, native_reloc, & rela);
|
||||
+
|
||||
+ /* The address of an ELF reloc is section relative for an object
|
||||
+ file, and absolute for an executable file or shared library.
|
||||
+ The address of a normal BFD reloc is always section relative,
|
||||
+ and the address of a dynamic reloc is absolute.. */
|
||||
+ if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
|
||||
+ internal_reloc->address = rela.r_offset;
|
||||
+ else
|
||||
+ internal_reloc->address = rela.r_offset - sec->vma;
|
||||
+
|
||||
+ if (r_sym (rela.r_info) == STN_UNDEF)
|
||||
+ {
|
||||
+ /* FIXME: This and the error case below mean that we
|
||||
+ have a symbol on relocs that is not elf_symbol_type. */
|
||||
+ internal_reloc->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
|
||||
+ }
|
||||
+ else if (r_sym (rela.r_info) > symcount)
|
||||
+ {
|
||||
+ _bfd_error_handler
|
||||
+ /* xgettext:c-format */
|
||||
+ (_("%pB(%pA): relocation %d has invalid symbol index %ld"),
|
||||
+ abfd, sec, i, (long) r_sym (rela.r_info));
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ internal_reloc->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
|
||||
+ result = FALSE;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ asymbol **ps;
|
||||
+
|
||||
+ ps = symbols + r_sym (rela.r_info) - 1;
|
||||
+
|
||||
+ internal_reloc->sym_ptr_ptr = ps;
|
||||
+ /* Make sure that this symbol is not removed by strip. */
|
||||
+ (*ps)->flags |= BSF_KEEP;
|
||||
+ }
|
||||
+
|
||||
+ internal_reloc->addend = rela.r_addend;
|
||||
+
|
||||
+ ebd->elf_info_to_howto (abfd, internal_reloc, & rela);
|
||||
+ if (internal_reloc->howto == NULL)
|
||||
+ {
|
||||
+#if DEBUG_SECONDARY_RELOCS
|
||||
+ fprintf (stderr, "there is no howto associated with reloc %lx\n", rela.r_info);
|
||||
+#endif
|
||||
+ result = FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ free (native_relocs);
|
||||
+ /* Store the internal relocs. */
|
||||
+ elf_section_data (relsec)->sec_info = internal_relocs;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+/* Set the ELF section header fields of an output secondary reloc section. */
|
||||
+
|
||||
+bfd_boolean
|
||||
+_bfd_elf_copy_special_section_fields (const bfd * ibfd ATTRIBUTE_UNUSED,
|
||||
+ bfd * obfd ATTRIBUTE_UNUSED,
|
||||
+ const Elf_Internal_Shdr * isection,
|
||||
+ Elf_Internal_Shdr * osection)
|
||||
+{
|
||||
+ if (isection == NULL)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ if (isection->sh_type != SHT_SECONDARY_RELOC)
|
||||
+ return TRUE;
|
||||
+
|
||||
+ asection * isec = isection->bfd_section;
|
||||
+ if (isec == NULL)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ asection * osec = osection->bfd_section;
|
||||
+ if (osec == NULL)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ BFD_ASSERT (elf_section_data (osec)->sec_info == NULL);
|
||||
+ elf_section_data (osec)->sec_info = elf_section_data (isec)->sec_info;
|
||||
+ osection->sh_type = SHT_RELA;
|
||||
+ osection->sh_link = elf_onesymtab (obfd);
|
||||
+ if (osection->sh_link == 0)
|
||||
+ {
|
||||
+ /* There is no symbol table - we are hosed... */
|
||||
+ _bfd_error_handler
|
||||
+ /* xgettext:c-format */
|
||||
+ (_("%pB(%pA): link section cannot be set because the output file does not have a symbol table"),
|
||||
+ obfd, osec);
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ /* Find the output section that corresponds to the isection's sh_info link. */
|
||||
+ BFD_ASSERT (isection->sh_info > 0 && isection->sh_info < elf_numsections (ibfd));
|
||||
+ isection = elf_elfsections (ibfd)[isection->sh_info];
|
||||
+
|
||||
+ BFD_ASSERT (isection != NULL);
|
||||
+ BFD_ASSERT (isection->bfd_section != NULL);
|
||||
+ BFD_ASSERT (isection->bfd_section->output_section != NULL);
|
||||
+ osection->sh_info = elf_section_data (isection->bfd_section->output_section)->this_idx;
|
||||
+
|
||||
+#if DEBUG_SECONDARY_RELOCS
|
||||
+ fprintf (stderr, "update header of %s, sh_link = %u, sh_info = %u\n",
|
||||
+ osec->name, osection->sh_link, osection->sh_info);
|
||||
+#endif
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+/* Write out a secondary reloc section. */
|
||||
+
|
||||
+bfd_boolean
|
||||
+_bfd_elf_write_secondary_reloc_section (bfd *abfd, asection *sec)
|
||||
+{
|
||||
+ const struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
|
||||
+ bfd_vma addr_offset;
|
||||
+ asection * relsec;
|
||||
+ bfd_vma (*r_info) (bfd_vma, bfd_vma);
|
||||
+
|
||||
+#ifdef BFD64
|
||||
+ if (bfd_arch_bits_per_address (abfd) != 32)
|
||||
+ r_info = elf64_r_info;
|
||||
+ else
|
||||
+#endif
|
||||
+ r_info = elf32_r_info;
|
||||
+
|
||||
+ if (sec == NULL)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ /* The address of an ELF reloc is section relative for an object
|
||||
+ file, and absolute for an executable file or shared library.
|
||||
+ The address of a BFD reloc is always section relative. */
|
||||
+ addr_offset = 0;
|
||||
+ if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
|
||||
+ addr_offset = sec->vma;
|
||||
+
|
||||
+ /* Discover if there are any secondary reloc sections
|
||||
+ associated with SEC. */
|
||||
+ for (relsec = abfd->sections; relsec != NULL; relsec = relsec->next)
|
||||
+ {
|
||||
+ const struct bfd_elf_section_data * const esd = elf_section_data (relsec);
|
||||
+ Elf_Internal_Shdr * const hdr = (Elf_Internal_Shdr *) & esd->this_hdr;
|
||||
+
|
||||
+ if (hdr->sh_type == SHT_RELA
|
||||
+ && hdr->sh_info == (unsigned) elf_section_data (sec)->this_idx)
|
||||
+ {
|
||||
+ asymbol * last_sym;
|
||||
+ int last_sym_idx;
|
||||
+ unsigned int reloc_count;
|
||||
+ unsigned int idx;
|
||||
+ arelent * src_irel;
|
||||
+ bfd_byte * dst_rela;
|
||||
+
|
||||
+ BFD_ASSERT (hdr->contents == NULL);
|
||||
+
|
||||
+ reloc_count = hdr->sh_size / hdr->sh_entsize;
|
||||
+ BFD_ASSERT (reloc_count > 0);
|
||||
+
|
||||
+ hdr->contents = bfd_alloc (abfd, hdr->sh_size);
|
||||
+ if (hdr->contents == NULL)
|
||||
+ continue;
|
||||
+
|
||||
+#if DEBUG_SECONDARY_RELOCS
|
||||
+ fprintf (stderr, "write %u secondary relocs for %s from %s\n", reloc_count, sec->name, relsec->name);
|
||||
+#endif
|
||||
+ last_sym = NULL;
|
||||
+ last_sym_idx = 0;
|
||||
+ dst_rela = hdr->contents;
|
||||
+ src_irel = (arelent *) esd->sec_info;
|
||||
+ BFD_ASSERT (src_irel != NULL);
|
||||
+
|
||||
+ for (idx = 0; idx < reloc_count; idx++, dst_rela += hdr->sh_entsize)
|
||||
+ {
|
||||
+ Elf_Internal_Rela src_rela;
|
||||
+ arelent *ptr;
|
||||
+ asymbol *sym;
|
||||
+ int n;
|
||||
+
|
||||
+ ptr = src_irel + idx;
|
||||
+ sym = *ptr->sym_ptr_ptr;
|
||||
+
|
||||
+ if (sym == last_sym)
|
||||
+ n = last_sym_idx;
|
||||
+ else
|
||||
+ {
|
||||
+ last_sym = sym;
|
||||
+ n = _bfd_elf_symbol_from_bfd_symbol (abfd, & sym);
|
||||
+ if (n < 0)
|
||||
+ {
|
||||
+#if DEBUG_SECONDARY_RELOCS
|
||||
+ fprintf (stderr, "failed to find symbol %s whilst rewriting relocs\n",
|
||||
+ sym->name);
|
||||
+#endif
|
||||
+ /* FIXME: Signal failure somehow. */
|
||||
+ n = 0;
|
||||
+ }
|
||||
+ last_sym_idx = n;
|
||||
+ }
|
||||
+
|
||||
+ if ((*ptr->sym_ptr_ptr)->the_bfd != NULL
|
||||
+ && (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec
|
||||
+ && ! _bfd_elf_validate_reloc (abfd, ptr))
|
||||
+ {
|
||||
+#if DEBUG_SECONDARY_RELOCS
|
||||
+ fprintf (stderr, "symbol %s is not in the output bfd\n",
|
||||
+ sym->name);
|
||||
+#endif
|
||||
+ /* FIXME: Signal failure somehow. */
|
||||
+ n = 0;
|
||||
+ }
|
||||
+
|
||||
+ if (ptr->howto == NULL)
|
||||
+ {
|
||||
+#if DEBUG_SECONDARY_RELOCS
|
||||
+ fprintf (stderr, "reloc for symbol %s does not have a howto associated with it\n",
|
||||
+ sym->name);
|
||||
+#endif
|
||||
+ /* FIXME: Signal failure somehow. */
|
||||
+ n = 0;
|
||||
+ }
|
||||
+
|
||||
+ src_rela.r_offset = ptr->address + addr_offset;
|
||||
+ src_rela.r_info = r_info (n, ptr->howto->type);
|
||||
+ src_rela.r_addend = ptr->addend;
|
||||
+ ebd->s->swap_reloca_out (abfd, &src_rela, dst_rela);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+/* Preserve any OS or PROCESSOR specific section indicies. */
|
||||
+
|
||||
+unsigned int
|
||||
+_bfd_elf_symbol_section_index (bfd * abfd ATTRIBUTE_UNUSED,
|
||||
+ elf_symbol_type * sym)
|
||||
+{
|
||||
+ unsigned int shndx = sym->internal_elf_sym.st_shndx;
|
||||
+
|
||||
+ /* Preserve special section indicies. */
|
||||
+ return shndx >= SHN_LORESERVE ? shndx : SHN_ABS;
|
||||
+}
|
||||
diff -rup binutils.orig/bfd/elfcode.h binutils-2.30/bfd/elfcode.h
|
||||
--- binutils.orig/bfd/elfcode.h 2020-02-12 13:31:20.334605640 +0000
|
||||
+++ binutils-2.30/bfd/elfcode.h 2020-02-12 13:31:33.833507567 +0000
|
||||
@@ -855,6 +855,7 @@ elf_object_p (bfd *abfd)
|
||||
void
|
||||
elf_write_relocs (bfd *abfd, asection *sec, void *data)
|
||||
{
|
||||
+ const struct elf_backend_data * const bed = get_elf_backend_data (abfd);
|
||||
bfd_boolean *failedp = (bfd_boolean *) data;
|
||||
Elf_Internal_Shdr *rela_hdr;
|
||||
bfd_vma addr_offset;
|
||||
@@ -969,6 +970,13 @@ elf_write_relocs (bfd *abfd, asection *s
|
||||
src_rela.r_addend = ptr->addend;
|
||||
(*swap_out) (abfd, &src_rela, dst_rela);
|
||||
}
|
||||
+
|
||||
+ if (bed->write_secondary_relocs != NULL)
|
||||
+ if (! bed->write_secondary_relocs (abfd, sec))
|
||||
+ {
|
||||
+ *failedp = TRUE;
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Write out the program headers. */
|
||||
@@ -1271,7 +1279,10 @@ elf_slurp_symbol_table (bfd *abfd, asymb
|
||||
{
|
||||
/* This symbol is in a section for which we did not
|
||||
create a BFD section. Just use bfd_abs_section,
|
||||
- although it is wrong. FIXME. */
|
||||
+ although it is wrong. FIXME. Note - there is
|
||||
+ code in elf.c:swap_out_syms that calls
|
||||
+ symbol_section_index() in the elf backend for
|
||||
+ cases like this. */
|
||||
sym->symbol.section = bfd_abs_section_ptr;
|
||||
}
|
||||
}
|
||||
@@ -1501,6 +1512,7 @@ elf_slurp_reloc_table (bfd *abfd,
|
||||
asymbol **symbols,
|
||||
bfd_boolean dynamic)
|
||||
{
|
||||
+ const struct elf_backend_data * const bed = get_elf_backend_data (abfd);
|
||||
struct bfd_elf_section_data * const d = elf_section_data (asect);
|
||||
Elf_Internal_Shdr *rel_hdr;
|
||||
Elf_Internal_Shdr *rel_hdr2;
|
||||
@@ -1564,6 +1576,10 @@ elf_slurp_reloc_table (bfd *abfd,
|
||||
symbols, dynamic))
|
||||
return FALSE;
|
||||
|
||||
+ if (bed->slurp_secondary_relocs != NULL
|
||||
+ && ! bed->slurp_secondary_relocs (abfd, asect, symbols))
|
||||
+ return FALSE;
|
||||
+
|
||||
asect->relocation = relents;
|
||||
return TRUE;
|
||||
}
|
||||
diff -rup binutils.orig/bfd/elflink.c binutils-2.30/bfd/elflink.c
|
||||
--- binutils.orig/bfd/elflink.c 2020-02-12 13:31:20.338605611 +0000
|
||||
+++ binutils-2.30/bfd/elflink.c 2020-02-12 13:31:33.834507560 +0000
|
||||
@@ -11514,6 +11514,10 @@ elf_final_link_free (bfd *obfd, struct e
|
||||
}
|
||||
}
|
||||
|
||||
+#define is_reloc_section(ESDO) \
|
||||
+ ( (ESDO)->this_hdr.sh_type == SHT_REL \
|
||||
+ || (ESDO)->this_hdr.sh_type == SHT_RELA)
|
||||
+
|
||||
/* Do the final step of an ELF link. */
|
||||
|
||||
bfd_boolean
|
||||
@@ -11685,8 +11689,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
|
||||
&& elf_symtab_shndx_list (sec->owner) != NULL)
|
||||
max_sym_shndx_count = sym_count;
|
||||
|
||||
- if (esdo->this_hdr.sh_type == SHT_REL
|
||||
- || esdo->this_hdr.sh_type == SHT_RELA)
|
||||
+ if (is_reloc_section (esdo))
|
||||
/* Some backends use reloc_count in relocation sections
|
||||
to count particular types of relocs. Of course,
|
||||
reloc sections themselves can't have relocations. */
|
||||
@@ -12290,6 +12293,9 @@ bfd_elf_final_link (bfd *abfd, struct bf
|
||||
struct bfd_elf_section_data *esdo = elf_section_data (o);
|
||||
bfd_boolean sort;
|
||||
|
||||
+ if (esdo == NULL)
|
||||
+ continue;
|
||||
+
|
||||
if ((o->flags & SEC_RELOC) == 0)
|
||||
continue;
|
||||
|
||||
diff -rup binutils.orig/bfd/elfxx-target.h binutils-2.30/bfd/elfxx-target.h
|
||||
--- binutils.orig/bfd/elfxx-target.h 2020-02-12 13:31:20.338605611 +0000
|
||||
+++ binutils-2.30/bfd/elfxx-target.h 2020-02-12 13:31:33.834507560 +0000
|
||||
@@ -737,7 +737,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef elf_backend_copy_special_section_fields
|
||||
-#define elf_backend_copy_special_section_fields NULL
|
||||
+#define elf_backend_copy_special_section_fields _bfd_elf_copy_special_section_fields
|
||||
#endif
|
||||
|
||||
#ifndef elf_backend_compact_eh_encoding
|
||||
@@ -745,7 +745,23 @@
|
||||
#endif
|
||||
|
||||
#ifndef elf_backend_cant_unwind_opcode
|
||||
-#define elf_backend_cant_unwind_opcode 0
|
||||
+#define elf_backend_cant_unwind_opcode NULL
|
||||
+#endif
|
||||
+
|
||||
+#ifndef elf_backend_init_secondary_reloc_section
|
||||
+#define elf_backend_init_secondary_reloc_section _bfd_elf_init_secondary_reloc_section
|
||||
+#endif
|
||||
+
|
||||
+#ifndef elf_backend_slurp_secondary_reloc_section
|
||||
+#define elf_backend_slurp_secondary_reloc_section _bfd_elf_slurp_secondary_reloc_section
|
||||
+#endif
|
||||
+
|
||||
+#ifndef elf_backend_write_secondary_reloc_section
|
||||
+#define elf_backend_write_secondary_reloc_section _bfd_elf_write_secondary_reloc_section
|
||||
+#endif
|
||||
+
|
||||
+#ifndef elf_backend_symbol_section_index
|
||||
+#define elf_backend_symbol_section_index _bfd_elf_symbol_section_index
|
||||
#endif
|
||||
|
||||
#ifndef elf_match_priority
|
||||
@@ -870,6 +886,10 @@ static struct elf_backend_data elfNN_bed
|
||||
elf_backend_setup_gnu_properties,
|
||||
elf_backend_compact_eh_encoding,
|
||||
elf_backend_cant_unwind_opcode,
|
||||
+ elf_backend_init_secondary_reloc_section,
|
||||
+ elf_backend_slurp_secondary_reloc_section,
|
||||
+ elf_backend_write_secondary_reloc_section,
|
||||
+ elf_backend_symbol_section_index,
|
||||
elf_backend_static_tls_alignment,
|
||||
elf_backend_stack_align,
|
||||
elf_backend_strtab_flags,
|
||||
Only in binutils-2.30/bfd: elfxx-target.h.orig
|
File diff suppressed because it is too large
Load Diff
@ -1,39 +0,0 @@
|
||||
--- binutils.orig/bfd/elflink.c 2018-03-14 10:14:49.729271271 +0000
|
||||
+++ binutils-2.30/bfd/elflink.c 2018-03-14 10:15:15.748967793 +0000
|
||||
@@ -12785,7 +12785,7 @@ _bfd_elf_gc_mark_hook (asection *sec,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-/* Return the global debug definition section. */
|
||||
+/* Return the debug definition section. */
|
||||
|
||||
static asection *
|
||||
elf_gc_mark_debug_section (asection *sec ATTRIBUTE_UNUSED,
|
||||
@@ -12794,11 +12794,22 @@ elf_gc_mark_debug_section (asection *sec
|
||||
struct elf_link_hash_entry *h,
|
||||
Elf_Internal_Sym *sym ATTRIBUTE_UNUSED)
|
||||
{
|
||||
- if (h != NULL
|
||||
- && (h->root.type == bfd_link_hash_defined
|
||||
- || h->root.type == bfd_link_hash_defweak)
|
||||
- && (h->root.u.def.section->flags & SEC_DEBUGGING) != 0)
|
||||
- return h->root.u.def.section;
|
||||
+ if (h != NULL)
|
||||
+ {
|
||||
+ /* Return the global debug definition section. */
|
||||
+ if ((h->root.type == bfd_link_hash_defined
|
||||
+ || h->root.type == bfd_link_hash_defweak)
|
||||
+ && (h->root.u.def.section->flags & SEC_DEBUGGING) != 0)
|
||||
+ return h->root.u.def.section;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* Return the local debug definition section. */
|
||||
+ asection *isec = bfd_section_from_elf_index (sec->owner,
|
||||
+ sym->st_shndx);
|
||||
+ if ((isec->flags & SEC_DEBUGGING) != 0)
|
||||
+ return isec;
|
||||
+ }
|
||||
|
||||
return NULL;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
--- binutils.orig/binutils/readelf.c 2018-09-05 14:08:22.733186922 +0100
|
||||
+++ binutils-2.30/binutils/readelf.c 2018-09-05 15:35:38.009749485 +0100
|
||||
@@ -17634,11 +17634,12 @@ print_gnu_build_attribute_description (E
|
||||
|
||||
if (is_open_attr)
|
||||
{
|
||||
+#if 0
|
||||
/* FIXME: Need to properly allow for section alignment. 16 is just the alignment used on x86_64. */
|
||||
if (global_end > 0 && start > BFD_ALIGN (global_end, 16))
|
||||
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;
|
||||
|
@ -66,11 +66,11 @@ diff -rup binutils.orig/configure.ac binutils-2.30/configure.ac
|
||||
- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
|
||||
- AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
|
||||
- AC_LANG_PUSH(C++)
|
||||
- AC_LINK_IFELSE([
|
||||
- AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
|
||||
-#error -static-libstdc++ not implemented
|
||||
-#endif
|
||||
-int main() {}],
|
||||
-int main() {}])],
|
||||
- [AC_MSG_RESULT([yes]); have_static_libs=yes],
|
||||
- [AC_MSG_RESULT([no])])
|
||||
- AC_LANG_POP(C++)
|
||||
|
@ -1,18 +0,0 @@
|
||||
--- binutils.orig/ld/emultempl/elf32.em 2019-07-22 13:25:51.601030174 +0100
|
||||
+++ binutils-2.32/ld/emultempl/elf32.em 2019-07-22 13:27:36.070394830 +0100
|
||||
@@ -2029,10 +2029,12 @@ elf_orphan_compatible (asection *in, ase
|
||||
if (elf_section_data (out)->this_hdr.sh_info
|
||||
!= elf_section_data (in)->this_hdr.sh_info)
|
||||
return FALSE;
|
||||
- /* We can't merge two sections with differing SHF_EXCLUDE when doing
|
||||
- a relocatable link. */
|
||||
+ /* We can't merge with member of output section group nor merge two
|
||||
+ sections with differing SHF_EXCLUDE when doing a relocatable link. */
|
||||
if (bfd_link_relocatable (&link_info)
|
||||
- && ((elf_section_flags (out) ^ elf_section_flags (in)) & SHF_EXCLUDE) != 0)
|
||||
+ && (elf_next_in_group (out) != NULL
|
||||
+ || ((elf_section_flags (out) ^ elf_section_flags (in))
|
||||
+ & SHF_EXCLUDE) != 0))
|
||||
return FALSE;
|
||||
return _bfd_elf_match_sections_by_type (link_info.output_bfd, out,
|
||||
in->owner, in);
|
@ -1,68 +0,0 @@
|
||||
diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.30/bfd/elf-bfd.h
|
||||
--- binutils.orig/bfd/elf-bfd.h 2020-04-06 13:08:43.081659992 +0100
|
||||
+++ binutils-2.30/bfd/elf-bfd.h 2020-04-06 13:09:17.040517295 +0100
|
||||
@@ -2722,6 +2722,8 @@ extern unsigned int _bfd_elf_symbol_sect
|
||||
(bfd *, elf_symbol_type *);
|
||||
|
||||
|
||||
+extern bfd_boolean is_debuginfo_file (bfd *);
|
||||
+
|
||||
/* Large common section. */
|
||||
extern asection _bfd_elf_large_com_section;
|
||||
|
||||
Only in binutils-2.30/bfd: elf-bfd.h.orig
|
||||
diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c
|
||||
--- binutils.orig/bfd/elf.c 2020-04-06 13:08:43.104659896 +0100
|
||||
+++ binutils-2.30/bfd/elf.c 2020-04-06 13:09:17.042517287 +0100
|
||||
@@ -5749,6 +5749,35 @@ assign_file_positions_for_load_sections
|
||||
#define IS_TBSS(s) \
|
||||
((s->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) == SEC_THREAD_LOCAL)
|
||||
|
||||
+/* Determine if a bfd is a debuginfo file. Unfortunately there
|
||||
+ is no defined method for detecting such files, so we have to
|
||||
+ use heuristics instead. */
|
||||
+
|
||||
+bfd_boolean
|
||||
+is_debuginfo_file (bfd *abfd)
|
||||
+{
|
||||
+ if (abfd == NULL || bfd_get_flavour (abfd) != bfd_target_elf_flavour)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ Elf_Internal_Shdr **start_headers = elf_elfsections (abfd);
|
||||
+ Elf_Internal_Shdr **end_headers = start_headers + elf_numsections (abfd);
|
||||
+ Elf_Internal_Shdr **headerp;
|
||||
+
|
||||
+ for (headerp = start_headers; headerp < end_headers; headerp ++)
|
||||
+ {
|
||||
+ Elf_Internal_Shdr *header = * headerp;
|
||||
+
|
||||
+ /* Debuginfo files do not have any allocated SHT_PROGBITS sections.
|
||||
+ The only allocated sections are SHT_NOBITS or SHT_NOTES. */
|
||||
+ if ((header->sh_flags & SHF_ALLOC) == SHF_ALLOC
|
||||
+ && header->sh_type != SHT_NOBITS
|
||||
+ && header->sh_type != SHT_NOTE)
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
/* Assign file positions for the other sections. */
|
||||
|
||||
static bfd_boolean
|
||||
@@ -5782,7 +5811,13 @@ assign_file_positions_for_non_load_secti
|
||||
BFD_ASSERT (hdr->sh_offset == hdr->bfd_section->filepos);
|
||||
else if ((hdr->sh_flags & SHF_ALLOC) != 0)
|
||||
{
|
||||
- if (hdr->sh_size != 0)
|
||||
+ if (hdr->sh_size != 0
|
||||
+ /* PR 24717 - debuginfo files are known to be not strictly
|
||||
+ compliant with the ELF standard. In particular they often
|
||||
+ have .note.gnu.property sections that are outside of any
|
||||
+ loadable segment. This is not a problem for such files,
|
||||
+ so do not warn about them. */
|
||||
+ && ! is_debuginfo_file (abfd))
|
||||
_bfd_error_handler
|
||||
/* xgettext:c-format */
|
||||
(_("%B: warning: allocated section `%s' not in segment"),
|
||||
Only in binutils-2.30/bfd: elf.c.orig
|
34
SOURCES/binutils-duplicate-sections.patch
Normal file
34
SOURCES/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
SOURCES/binutils-dwarf-5-dir0.patch
Normal file
186
SOURCES/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
|
||||
+
|
||||
+
|
36
SOURCES/binutils-elf-add-objects.patch
Normal file
36
SOURCES/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),
|
146
SOURCES/binutils-execstack-error-tests.patch
Normal file
146
SOURCES/binutils-execstack-error-tests.patch
Normal file
@ -0,0 +1,146 @@
|
||||
commit 17e62fe5f78d33db23bf43eb7c20accd56e65ebe (HEAD -> master, origin/master, origin/HEAD)
|
||||
Author: Nick Clifton <nickc@redhat.com>
|
||||
Date: Tue Aug 19 15:25:39 2025 +0100
|
||||
|
||||
Add tests of the linker's --errror-execstack and --error-rwx-segments options
|
||||
|
||||
diff -rup binutils-2.35.2.orig/ld/testsuite/ld-elf/elf.exp binutils-2.35.2/ld/testsuite/ld-elf/elf.exp
|
||||
--- binutils-2.35.2.orig/ld/testsuite/ld-elf/elf.exp 2025-08-19 16:49:58.651597488 +0100
|
||||
+++ binutils-2.35.2/ld/testsuite/ld-elf/elf.exp 2025-08-19 16:50:14.483671894 +0100
|
||||
@@ -244,6 +244,13 @@ if { [istarget *-*-*linux*]
|
||||
{pr29072-a.s} \
|
||||
{{ld pr29072.a.warn}} \
|
||||
"pr29072-a.exe"] \
|
||||
+ [list "Test --error-execstack with an executable .note.GNU-stack" \
|
||||
+ "--warn-execstack --error-execstack" \
|
||||
+ "" \
|
||||
+ "" \
|
||||
+ {pr29072-a.s} \
|
||||
+ {{ld gnu_execstack.err}} \
|
||||
+ "gnu_execstack.exe"] \
|
||||
[list "PR 29072 (warn about -z execstack)" \
|
||||
"-z execstack --warn-execstack --no-error-execstack" \
|
||||
"" \
|
||||
@@ -251,6 +258,13 @@ if { [istarget *-*-*linux*]
|
||||
{stack.s} \
|
||||
{{ld pr29072.c.warn}} \
|
||||
"pr29072-c.exe"] \
|
||||
+ [list "Test --error-execstack with -z execstack" \
|
||||
+ "-z execstack --warn-execstack --error-execstack" \
|
||||
+ "" \
|
||||
+ "" \
|
||||
+ {stack.s} \
|
||||
+ {{ld z_execstack.err}} \
|
||||
+ "execstack.exe"] \
|
||||
[list "PR ld/29072 (suppress warnings about executable stack)" \
|
||||
"-e 0 --no-warn-execstack" \
|
||||
"" \
|
||||
@@ -258,13 +272,20 @@ if { [istarget *-*-*linux*]
|
||||
{pr29072-a.s} \
|
||||
{} \
|
||||
"pr29072-d.exe"] \
|
||||
- [list "Ensure that a warning issued when creating a segment with RWX permissions" \
|
||||
+ [list "Ensure that a warning is issued when creating a segment with RWX permissions" \
|
||||
"-e 0 -Tnobits-1.t --warn-rwx-segments --no-error-rwx-segments" \
|
||||
"" \
|
||||
"" \
|
||||
{nobits-1.s} \
|
||||
{{ld rwx-segments-1.l}} \
|
||||
"rwx-segments-1.exe"] \
|
||||
+ [list "Ensure that a error can be issued when creating a segment with RWX permissions" \
|
||||
+ "-e 0 -Tnobits-1.t --warn-rwx-segments --error-rwx-segments" \
|
||||
+ "" \
|
||||
+ "" \
|
||||
+ {nobits-1.s} \
|
||||
+ {{ld rwx-segments-3.err}} \
|
||||
+ "rwx-segments-3.exe"] \
|
||||
[list "Ensure that a warning issued when creating a TLS segment with execute permission" \
|
||||
"-e 0 -T rwx-segments-2.t --warn-rwx-segments --no-error-rwx-segments" \
|
||||
"" \
|
||||
@@ -272,6 +293,13 @@ if { [istarget *-*-*linux*]
|
||||
{size-2.s} \
|
||||
{{ld rwx-segments-2.l}} \
|
||||
"rwx-segments-2.exe"] \
|
||||
+ [list "Ensure that an error cn be issued when creating a TLS segment with execute permission" \
|
||||
+ "-e 0 -T rwx-segments-2.t --warn-rwx-segments --error-rwx-segments" \
|
||||
+ "" \
|
||||
+ "" \
|
||||
+ {size-2.s} \
|
||||
+ {{ld rwx-segments-4.err}} \
|
||||
+ "rwx-segments-4.exe"] \
|
||||
[list "Ensure that the RWX warning can be suppressed" \
|
||||
"-e 0 -Tnobits-1.t --no-warn-rwx-segments" \
|
||||
"" \
|
||||
@@ -293,6 +321,16 @@ if { [istarget *-*-*linux*]
|
||||
{{ld pr29072.b.warn}} \
|
||||
"pr29072-b.exe"] \
|
||||
]
|
||||
+
|
||||
+ run_ld_link_tests [list \
|
||||
+ [list "error when .note.GNU-stack is absent" \
|
||||
+ "-e 0 -z stack-size=0x123400 --warn-execstack --error-execstack" \
|
||||
+ "" \
|
||||
+ "" \
|
||||
+ {pr29072-b.s} \
|
||||
+ {{ld missing-execstack.err}} \
|
||||
+ "missing-execstack.exe"] \
|
||||
+ ]
|
||||
} else {
|
||||
run_ld_link_tests [list \
|
||||
[list "PR ld/29072 (ignore absent .note.GNU-stack)" \
|
||||
diff --git a/ld/testsuite/ld-elf/gnu_execstack.err b/ld/testsuite/ld-elf/gnu_execstack.err
|
||||
new file mode 100644
|
||||
index 00000000000..be70b63043a
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-elf/gnu_execstack.err
|
||||
@@ -0,0 +1,3 @@
|
||||
+#...
|
||||
+.*: error: .*: is triggering the generation of an executable stack \(because it has an executable .note.GNU-stack section\)
|
||||
+#...
|
||||
diff --git a/ld/testsuite/ld-elf/missing-execstack.err b/ld/testsuite/ld-elf/missing-execstack.err
|
||||
new file mode 100644
|
||||
index 00000000000..9549cf5cd28
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-elf/missing-execstack.err
|
||||
@@ -0,0 +1,3 @@
|
||||
+#...
|
||||
+.*: error: .*\.o: is triggering the generation of an executable stack because it does not have a .note.GNU-stack section
|
||||
+#...
|
||||
diff --git a/ld/testsuite/ld-elf/rwx-segments-3.err b/ld/testsuite/ld-elf/rwx-segments-3.err
|
||||
new file mode 100644
|
||||
index 00000000000..5a584db19be
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-elf/rwx-segments-3.err
|
||||
@@ -0,0 +1,3 @@
|
||||
+#...
|
||||
+.* error: .* has a LOAD segment with RWX permissions
|
||||
+#...
|
||||
\ No newline at end of file
|
||||
diff --git a/ld/testsuite/ld-elf/rwx-segments-4.err b/ld/testsuite/ld-elf/rwx-segments-4.err
|
||||
new file mode 100644
|
||||
index 00000000000..2603f57db47
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-elf/rwx-segments-4.err
|
||||
@@ -0,0 +1,3 @@
|
||||
+#...
|
||||
+.*: error: .* has a TLS segment with execute permission
|
||||
+#...
|
||||
diff --git a/ld/testsuite/ld-elf/z_execstack.err b/ld/testsuite/ld-elf/z_execstack.err
|
||||
new file mode 100644
|
||||
index 00000000000..703b42a9e01
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-elf/z_execstack.err
|
||||
@@ -0,0 +1,4 @@
|
||||
+#...
|
||||
+.*: error: creating an executable stack because of -z execstack command line option
|
||||
+#...
|
||||
+
|
||||
|
||||
diff -rup binutils-2.35.2.orig/ld/testsuite/ld-elf/z_execstack.err binutils-2.35.2/ld/testsuite/ld-elf/z_execstack.err
|
||||
--- binutils-2.35.2.orig/ld/testsuite/ld-elf/z_execstack.err 2025-08-20 15:22:19.495234206 +0100
|
||||
+++ binutils-2.35.2/ld/testsuite/ld-elf/z_execstack.err 2025-08-20 15:22:55.953388857 +0100
|
||||
@@ -1,4 +1,3 @@
|
||||
#...
|
||||
.*: error: creating an executable stack because of -z execstack command line option
|
||||
#...
|
||||
-
|
33
SOURCES/binutils-export-demangle.h.patch
Normal file
33
SOURCES/binutils-export-demangle.h.patch
Normal file
@ -0,0 +1,33 @@
|
||||
diff -rup binutils.orig/bfd/Makefile.am binutils-2.32/bfd/Makefile.am
|
||||
--- binutils.orig/bfd/Makefile.am 2019-02-08 12:22:51.395684251 +0000
|
||||
+++ binutils-2.32/bfd/Makefile.am 2019-02-08 12:22:53.970664973 +0000
|
||||
@@ -33,7 +33,7 @@ bfdlibdir = @bfdlibdir@
|
||||
bfdincludedir = @bfdincludedir@
|
||||
bfdlib_LTLIBRARIES = libbfd.la
|
||||
bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.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 =
|
||||
diff -rup binutils.orig/bfd/Makefile.in binutils-2.32/bfd/Makefile.in
|
||||
--- binutils.orig/bfd/Makefile.in 2019-02-08 12:21:35.291254044 +0000
|
||||
+++ binutils-2.32/bfd/Makefile.in 2019-02-08 12:22:10.163992947 +0000
|
||||
@@ -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 bfd_stdint.h \
|
||||
- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
|
||||
+ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
|
||||
HEADERS = $(bfdinclude_HEADERS)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
@@ -468,7 +468,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel
|
||||
@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@ 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
|
@ -1,40 +1,10 @@
|
||||
diff -rup binutils.orig/gas/config/tc-s390.c binutils-2.30/gas/config/tc-s390.c
|
||||
--- binutils.orig/gas/config/tc-s390.c 2021-09-29 15:59:10.710209740 +0100
|
||||
+++ binutils-2.30/gas/config/tc-s390.c 2021-09-29 16:03:03.951577660 +0100
|
||||
@@ -293,6 +293,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 (""), 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.30/gas/doc/c-s390.texi
|
||||
--- binutils.orig/gas/doc/c-s390.texi 2021-09-29 15:59:10.710209740 +0100
|
||||
+++ binutils-2.30/gas/doc/c-s390.texi 2021-09-29 16:04:39.597908390 +0100
|
||||
@@ -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 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{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.
|
||||
@@ -312,7 +313,7 @@ field. The notation changes as follows:
|
||||
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
|
||||
|
||||
@ -43,7 +13,7 @@ diff -rup binutils.orig/gas/doc/c-s390.texi binutils-2.30/gas/doc/c-s390.texi
|
||||
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
|
||||
@@ -544,6 +545,54 @@ with the @samp{.insn} pseudo directive:
|
||||
@@ -545,6 +545,54 @@ with the @samp{.insn} pseudo directive:
|
||||
0 8 12 16 20 32 36 47
|
||||
@end verbatim
|
||||
|
||||
@ -98,9 +68,11 @@ diff -rup binutils.orig/gas/doc/c-s390.texi binutils-2.30/gas/doc/c-s390.texi
|
||||
@end table
|
||||
|
||||
For the complete list of all instruction format variants see the
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/esa-g5.d binutils-2.30/gas/testsuite/gas/s390/esa-g5.d
|
||||
--- binutils.orig/gas/testsuite/gas/s390/esa-g5.d 2021-09-29 15:59:10.716209698 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/esa-g5.d 2021-09-29 16:00:26.051682531 +0100
|
||||
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
|
||||
@ -197,9 +169,9 @@ diff -rup binutils.orig/gas/testsuite/gas/s390/esa-g5.d binutils-2.30/gas/testsu
|
||||
.*: 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.30/gas/testsuite/gas/s390/esa-g5.s
|
||||
--- binutils.orig/gas/testsuite/gas/s390/esa-g5.s 2021-09-29 15:59:10.716209698 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/esa-g5.s 2021-09-29 16:00:26.052682524 +0100
|
||||
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
|
||||
@ -244,9 +216,9 @@ diff -rup binutils.orig/gas/testsuite/gas/s390/esa-g5.s binutils-2.30/gas/testsu
|
||||
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.30/gas/testsuite/gas/s390/esa-z900.d
|
||||
--- binutils.orig/gas/testsuite/gas/s390/esa-z900.d 2021-09-29 15:59:10.717209691 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/esa-z900.d 2021-09-29 16:00:26.052682524 +0100
|
||||
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:
|
||||
|
||||
@ -337,9 +309,9 @@ diff -rup binutils.orig/gas/testsuite/gas/s390/esa-z900.d binutils-2.30/gas/test
|
||||
.*: 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.30/gas/testsuite/gas/s390/esa-z900.s
|
||||
--- binutils.orig/gas/testsuite/gas/s390/esa-z900.s 2021-09-29 15:59:10.716209698 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/esa-z900.s 2021-09-29 16:00:26.053682517 +0100
|
||||
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:
|
||||
@ -378,20 +350,12 @@ diff -rup binutils.orig/gas/testsuite/gas/s390/esa-z900.s binutils-2.30/gas/test
|
||||
tam
|
||||
sam24
|
||||
sam31
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/s390.exp binutils-2.30/gas/testsuite/gas/s390/s390.exp
|
||||
--- binutils.orig/gas/testsuite/gas/s390/s390.exp 2021-09-29 15:59:10.716209698 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/s390.exp 2021-09-29 16:01:42.244149395 +0100
|
||||
@@ -30,6 +30,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}"
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z10.d binutils-2.30/gas/testsuite/gas/s390/zarch-z10.d
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-z10.d 2021-09-29 15:59:10.716209698 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/zarch-z10.d 2021-09-29 16:01:16.115332226 +0100
|
||||
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
|
||||
@ -411,9 +375,9 @@ diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z10.d binutils-2.30/gas/tes
|
||||
.*: 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.30/gas/testsuite/gas/s390/zarch-z10.s
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-z10.s 2021-09-29 15:59:10.716209698 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/zarch-z10.s 2021-09-29 16:01:16.116332219 +0100
|
||||
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
|
||||
@ -425,9 +389,9 @@ diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z10.s binutils-2.30/gas/tes
|
||||
strl %r6,.
|
||||
stgrl %r6,.
|
||||
sthrl %r6,.
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z900.d binutils-2.30/gas/testsuite/gas/s390/zarch-z900.d
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-z900.d 2021-09-29 15:59:10.717209691 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/zarch-z900.d 2021-09-29 16:00:26.053682517 +0100
|
||||
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
|
||||
@ -442,9 +406,9 @@ diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z900.d binutils-2.30/gas/te
|
||||
.*: 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.30/gas/testsuite/gas/s390/zarch-z900.s
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-z900.s 2021-09-29 15:59:10.716209698 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/zarch-z900.s 2021-09-29 16:00:26.053682517 +0100
|
||||
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
|
||||
@ -457,9 +421,9 @@ diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z900.s binutils-2.30/gas/te
|
||||
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.30/gas/testsuite/gas/s390/zarch-zEC12.d
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.d 2021-09-29 15:59:10.716209698 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/zarch-zEC12.d 2021-09-29 16:01:16.116332219 +0100
|
||||
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\)
|
||||
@ -495,9 +459,9 @@ diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.d binutils-2.30/gas/t
|
||||
+0000000000000136 <bar>:
|
||||
|
||||
.*: 07 07 [ ]*nopr %r7
|
||||
diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.s binutils-2.30/gas/testsuite/gas/s390/zarch-zEC12.s
|
||||
--- binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.s 2021-09-29 15:59:10.716209698 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/zarch-zEC12.s 2021-09-29 16:01:16.116332219 +0100
|
||||
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)
|
||||
|
||||
@ -508,81 +472,14 @@ diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.s binutils-2.30/gas/t
|
||||
cdzt %f6,4000(16,%r8),13
|
||||
cxzt %f4,4000(34,%r8),13
|
||||
czdt %f6,4000(16,%r8),13
|
||||
diff -rup binutils.orig/include/opcode/s390.h binutils-2.30/include/opcode/s390.h
|
||||
--- binutils.orig/include/opcode/s390.h 2021-09-29 15:59:10.908208355 +0100
|
||||
+++ binutils-2.30/include/opcode/s390.h 2021-09-29 16:01:42.245149388 +0100
|
||||
@@ -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/ld/ChangeLog.orig binutils-2.30/ld/ChangeLog.orig
|
||||
--- binutils.orig/ld/ChangeLog.orig 2021-09-29 15:59:10.935208166 +0100
|
||||
+++ binutils-2.30/ld/ChangeLog.orig 2021-09-29 16:00:26.053682517 +0100
|
||||
@@ -1,3 +1,27 @@
|
||||
+2018-01-27 Nick Clifton <nickc@redhat.com>
|
||||
+
|
||||
+ This is the 2.30 release:
|
||||
+
|
||||
+ * configure: Regenerate.
|
||||
+ * po/ld.pot: Regenerate.
|
||||
+
|
||||
+2018-01-27 Nick Clifton <nickc@redhat.com>
|
||||
+
|
||||
+ PR 22751
|
||||
+ Revert this change as a temporary solution for this PR:
|
||||
+
|
||||
+ 2017-09-02 Alan Modra <amodra@gmail.com>
|
||||
+
|
||||
+ * ldlang.h (lang_input_statement_type): Expand comments.
|
||||
+ (LANG_FOR_EACH_INPUT_STATEMENT): Rewrite without casts.
|
||||
+ * ldlang.c (lang_for_each_input_file): Likewise.
|
||||
+ (load_symbols): Set usrdata for archives.
|
||||
+ (find_rescan_insertion): New function.
|
||||
+ (lang_process): Trim off and reinsert entries added to file chain
|
||||
+ when rescanning archives for LTO.
|
||||
+ * ldmain.c (add_archive_element): Set my_archive input_statement
|
||||
+ next pointer to last element added.
|
||||
+
|
||||
2018-01-25 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library):
|
||||
diff -rup binutils.orig/ld/ChangeLog.rej binutils-2.30/ld/ChangeLog.rej
|
||||
--- binutils.orig/ld/ChangeLog.rej 2021-09-29 15:59:10.935208166 +0100
|
||||
+++ binutils-2.30/ld/ChangeLog.rej 2021-09-29 16:00:26.053682517 +0100
|
||||
@@ -1,18 +1,11 @@
|
||||
--- ld/ChangeLog
|
||||
+++ ld/ChangeLog
|
||||
-@@ -1,15 +1,3 @@
|
||||
--2017-09-02 Alan Modra <amodra@gmail.com>
|
||||
--
|
||||
-- * ldlang.h (lang_input_statement_type): Expand comments.
|
||||
-- (LANG_FOR_EACH_INPUT_STATEMENT): Rewrite without casts.
|
||||
-- * ldlang.c (lang_for_each_input_file): Likewise.
|
||||
-- (load_symbols): Set usrdata for archives.
|
||||
-- (find_rescan_insertion): New function.
|
||||
-- (lang_process): Trim off and reinsert entries added to file chain
|
||||
-- when rescanning archives for LTO.
|
||||
-- * ldmain.c (add_archive_element): Set my_archive input_statement
|
||||
-- next pointer to last element added.
|
||||
--
|
||||
- 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
|
||||
+@@ -1,3 +1,8 @@
|
||||
++2020-12-03 Andreas Krebbel <krebbel@linux.ibm.com>
|
||||
++
|
||||
++ * testsuite/ld-s390/tlsbin_64.dd: The newly added jgnop mnemonic
|
||||
++ replaces long relative branches with empty condition code masks.
|
||||
++
|
||||
+ 2020-12-03 Maciej W. Rozycki <macro@linux-mips.org>
|
||||
|
||||
- PR ld/22064
|
||||
+ * testsuite/ld-vax-elf/vax-elf.exp: Wrap excessively long lines
|
||||
diff -rup binutils.orig/ld/testsuite/ld-s390/tlsbin_64.dd binutils-2.30/ld/testsuite/ld-s390/tlsbin_64.dd
|
||||
--- binutils.orig/ld/testsuite/ld-s390/tlsbin_64.dd 2021-09-29 15:59:10.988207795 +0100
|
||||
+++ binutils-2.30/ld/testsuite/ld-s390/tlsbin_64.dd 2021-09-29 16:00:26.053682517 +0100
|
||||
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
|
||||
@ -615,21 +512,12 @@ diff -rup binutils.orig/ld/testsuite/ld-s390/tlsbin_64.dd binutils-2.30/ld/tests
|
||||
+[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\)
|
||||
diff -rup binutils.orig/opcodes/s390-mkopc.c binutils-2.30/opcodes/s390-mkopc.c
|
||||
--- binutils.orig/opcodes/s390-mkopc.c 2021-09-29 15:59:10.934208173 +0100
|
||||
+++ binutils-2.30/opcodes/s390-mkopc.c 2021-09-29 16:01:42.245149388 +0100
|
||||
@@ -379,6 +379,8 @@ main (void)
|
||||
min_cpu = S390_OPCODE_ARCH12;
|
||||
else if (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);
|
||||
diff -rup binutils.orig/opcodes/s390-opc.c binutils-2.30/opcodes/s390-opc.c
|
||||
--- binutils.orig/opcodes/s390-opc.c 2021-09-29 15:59:10.928208215 +0100
|
||||
+++ binutils-2.30/opcodes/s390-opc.c 2021-09-29 16:04:54.977800770 +0100
|
||||
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 */
|
||||
@ -685,15 +573,7 @@ diff -rup binutils.orig/opcodes/s390-opc.c binutils-2.30/opcodes/s390-opc.c
|
||||
#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 */
|
||||
@@ -439,6 +442,7 @@ const struct s390_operand s390_operands[
|
||||
#define INSTR_RX_URRD 4, { U4_8,D_20,X_12,B_16,0,0 } /* e.g. bc */
|
||||
#define INSTR_SI_RD 4, { D_20,B_16,0,0,0,0 } /* e.g. lpsw */
|
||||
#define INSTR_SI_URD 4, { D_20,B_16,U8_8,0,0,0 } /* e.g. cli */
|
||||
+#define INSTR_SIY_RD 6, { D20_20,B_16,0,0,0,0 } /* e.g. lpswey*/
|
||||
#define INSTR_SIY_URD 6, { D20_20,B_16,U8_8,0,0,0 } /* e.g. tmy */
|
||||
#define INSTR_SIY_IRD 6, { D20_20,B_16,I8_8,0,0,0 } /* e.g. asi */
|
||||
#define INSTR_SIL_RDI 6, { D_20,B_16,I16_32,0,0,0 } /* e.g. chhsi */
|
||||
@@ -534,6 +538,7 @@ const struct s390_operand s390_operands[
|
||||
@@ -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 }
|
||||
@ -701,17 +581,9 @@ diff -rup binutils.orig/opcodes/s390-opc.c binutils-2.30/opcodes/s390-opc.c
|
||||
#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 }
|
||||
@@ -660,6 +665,7 @@ const struct s390_operand s390_operands[
|
||||
#define MASK_RX_URRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
#define MASK_SI_RD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
#define MASK_SI_URD { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
+#define MASK_SIY_RD { 0xff, 0xff, 0x00, 0x00, 0x00, 0xff }
|
||||
#define MASK_SIY_URD { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
|
||||
#define MASK_SIY_IRD { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
|
||||
#define MASK_SIL_RDI { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }
|
||||
diff -rup binutils.orig/opcodes/s390-opc.txt binutils-2.30/opcodes/s390-opc.txt
|
||||
--- binutils.orig/opcodes/s390-opc.txt 2021-09-29 15:59:10.933208180 +0100
|
||||
+++ binutils-2.30/opcodes/s390-opc.txt 2021-09-29 16:05:08.818703921 +0100
|
||||
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
|
||||
@ -781,100 +653,5 @@ diff -rup binutils.orig/opcodes/s390-opc.txt binutils-2.30/opcodes/s390-opc.txt
|
||||
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
|
||||
@@ -2001,3 +2017,33 @@ 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_RD " " arch14 zarch
|
||||
+b200 lbear S_RD " " arch14 zarch
|
||||
+b201 stbear S_RD " " arch14 zarch
|
||||
+
|
||||
+b28f qpaci S_RD " " arch14 zarch
|
||||
--- /dev/null 2021-09-29 08:55:29.386811947 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/zarch-arch14.s 2021-09-29 16:05:08.817703928 +0100
|
||||
@@ -0,0 +1,25 @@
|
||||
+.text
|
||||
+foo:
|
||||
+ vschp %v15,%v17,%v20,13,12
|
||||
+ vschsp %v15,%v17,%v20,13
|
||||
+ vschdp %v15,%v17,%v20,13
|
||||
+ vschxp %v15,%v17,%v20,13
|
||||
+ vscshp %v15,%v17,%v20
|
||||
+ vcsph %v15,%v17,%v20,13
|
||||
+ vclzdp %v15,%v17,13
|
||||
+ vpkzr %v15,%v17,%v20,253,12
|
||||
+ vsrpr %v15,%v17,%v20,253,12
|
||||
+ vupkzh %v15,%v17,13
|
||||
+ vupkzl %v15,%v17,13
|
||||
+ nnpa
|
||||
+ vclfnh %v15,%v17,13,12
|
||||
+ vclfnl %v15,%v17,13,12
|
||||
+ vcrnf %v15,%v17,%v20,13,12
|
||||
+ vcfn %v15,%v17,13,12
|
||||
+ vcnf %v15,%v17,13,12
|
||||
+ rdp %r6,%r9,%r11
|
||||
+ rdp %r6,%r9,%r11,13
|
||||
+ lpswey -10000(%r6)
|
||||
+ lbear 4000(%r6)
|
||||
+ stbear 4000(%r6)
|
||||
+ qpaci 4095(%r5)
|
||||
--- /dev/null 2021-09-29 08:55:29.386811947 +0100
|
||||
+++ binutils-2.30/gas/testsuite/gas/s390/zarch-arch14.d 2021-09-29 16:05:08.817703928 +0100
|
||||
@@ -0,0 +1,32 @@
|
||||
+#name: s390x opcode
|
||||
+#objdump: -dr
|
||||
+
|
||||
+.*: +file format .*
|
||||
+
|
||||
+Disassembly of section .text:
|
||||
+
|
||||
+.* <foo>:
|
||||
+.*: e6 f1 40 c0 d6 74 [ ]*vschp %v15,%v17,%v20,13,12
|
||||
+.*: e6 f1 40 d0 26 74 [ ]*vschsp %v15,%v17,%v20,13
|
||||
+.*: e6 f1 40 d0 36 74 [ ]*vschdp %v15,%v17,%v20,13
|
||||
+.*: e6 f1 40 d0 46 74 [ ]*vschxp %v15,%v17,%v20,13
|
||||
+.*: e6 f1 40 00 06 7c [ ]*vscshp %v15,%v17,%v20
|
||||
+.*: e6 f1 40 d0 06 7d [ ]*vcsph %v15,%v17,%v20,13
|
||||
+.*: e6 f1 00 d0 04 51 [ ]*vclzdp %v15,%v17,13
|
||||
+.*: e6 f1 40 cf d6 70 [ ]*vpkzr %v15,%v17,%v20,253,12
|
||||
+.*: e6 f1 40 cf d6 72 [ ]*vsrpr %v15,%v17,%v20,253,12
|
||||
+.*: e6 f1 00 d0 04 54 [ ]*vupkzh %v15,%v17,13
|
||||
+.*: e6 f1 00 d0 04 5c [ ]*vupkzl %v15,%v17,13
|
||||
+.*: b9 3b 00 00 [ ]*nnpa
|
||||
+.*: e6 f1 00 0c d4 56 [ ]*vclfnh %v15,%v17,13,12
|
||||
+.*: e6 f1 00 0c d4 5e [ ]*vclfnl %v15,%v17,13,12
|
||||
+.*: e6 f1 40 0c d6 75 [ ]*vcrnf %v15,%v17,%v20,13,12
|
||||
+.*: e6 f1 00 0c d4 5d [ ]*vcfn %v15,%v17,13,12
|
||||
+.*: e6 f1 00 0c d4 55 [ ]*vcnf %v15,%v17,13,12
|
||||
+.*: b9 8b 90 6b [ ]*rdp %r6,%r9,%r11
|
||||
+.*: b9 8b 9d 6b [ ]*rdp %r6,%r9,%r11,13
|
||||
+.*: eb 00 68 f0 fd 71 [ ]*lpswey -10000\(%r6\)
|
||||
+.*: b2 00 6f a0 [ ]*lbear 4000\(%r6\)
|
||||
+.*: b2 01 6f a0 [ ]*stbear 4000\(%r6\)
|
||||
+.*: b2 8f 5f ff [ ]*qpaci 4095\(%r5\)
|
||||
+.*: 07 07 [ ]*nopr %r7
|
||||
Only in binutils-2.35.1/opcodes: s390-opc.txt.orig
|
||||
Only in binutils-2.35.1/opcodes: s390-opc.txt.rej
|
File diff suppressed because it is too large
Load Diff
292
SOURCES/binutils-gas-Use-the-directory-name-in-.file-0.patch
Normal file
292
SOURCES/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
|
||||
|
@ -1,555 +0,0 @@
|
||||
diff -rup binutils.orig/binutils/readelf.c binutils-2.30/binutils/readelf.c
|
||||
--- binutils.orig/binutils/readelf.c 2018-04-26 15:14:17.220464639 +0100
|
||||
+++ binutils-2.30/binutils/readelf.c 2018-04-26 15:14:31.927287474 +0100
|
||||
@@ -12294,7 +12294,8 @@ is_32bit_abs_reloc (Filedata * filedata,
|
||||
case EM_OR1K:
|
||||
return reloc_type == 1; /* R_OR1K_32. */
|
||||
case EM_PARISC:
|
||||
- return (reloc_type == 1 /* R_PARISC_DIR32. */
|
||||
+ return (reloc_type == 1 /* R_PARISC_DIR32. */
|
||||
+ || reloc_type == 2 /* R_PARISC_DIR21L. */
|
||||
|| reloc_type == 41); /* R_PARISC_SECREL32. */
|
||||
case EM_PJ:
|
||||
case EM_PJ_OLD:
|
||||
Only in binutils-2.30/binutils: readelf.c.orig
|
||||
diff -rup binutils.orig/binutils/testsuite/binutils-all/objcopy.exp binutils-2.30/binutils/testsuite/binutils-all/objcopy.exp
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2018-04-26 15:14:17.215464699 +0100
|
||||
+++ binutils-2.30/binutils/testsuite/binutils-all/objcopy.exp 2018-04-26 15:14:31.927287474 +0100
|
||||
@@ -1062,6 +1062,7 @@ if [is_elf_format] {
|
||||
run_dump_test "note-3-32"
|
||||
run_dump_test "note-4-32"
|
||||
}
|
||||
+ run_dump_test "note-5"
|
||||
}
|
||||
|
||||
run_dump_test "copy-2"
|
||||
Only in binutils-2.30/binutils/testsuite/binutils-all: objcopy.exp.orig
|
||||
diff -rup binutils.orig/gas/as.c binutils-2.30/gas/as.c
|
||||
--- binutils.orig/gas/as.c 2018-04-26 15:14:17.646459507 +0100
|
||||
+++ binutils-2.30/gas/as.c 2018-04-26 15:14:31.927287474 +0100
|
||||
@@ -97,6 +97,7 @@ int verbose = 0;
|
||||
|
||||
#if defined OBJ_ELF || defined OBJ_MAYBE_ELF
|
||||
int flag_use_elf_stt_common = DEFAULT_GENERATE_ELF_STT_COMMON;
|
||||
+bfd_boolean flag_generate_build_notes = DEFAULT_GENERATE_BUILD_NOTES;
|
||||
#endif
|
||||
|
||||
/* Keep the output file. */
|
||||
@@ -304,8 +305,19 @@ Options:\n\
|
||||
generate ELF common symbols with STT_COMMON type\n"));
|
||||
fprintf (stream, _("\
|
||||
--sectname-subst enable section name substitution sequences\n"));
|
||||
+
|
||||
+ fprintf (stream, _("\
|
||||
+ --generate-missing-build-notes=[no|yes] "));
|
||||
+#if DEFAULT_GENERATE_BUILD_NOTES
|
||||
+ fprintf (stream, _("(default: yes)\n"));
|
||||
+#else
|
||||
+ fprintf (stream, _("(default: no)\n"));
|
||||
#endif
|
||||
fprintf (stream, _("\
|
||||
+ generate GNU Build notes if none are present in the input\n"));
|
||||
+#endif /* OBJ_ELF */
|
||||
+
|
||||
+ fprintf (stream, _("\
|
||||
-f skip whitespace and comment preprocessing\n"));
|
||||
fprintf (stream, _("\
|
||||
-g --gen-debug generate debugging information\n"));
|
||||
@@ -470,6 +482,7 @@ parse_args (int * pargc, char *** pargv)
|
||||
OPTION_NOEXECSTACK,
|
||||
OPTION_SIZE_CHECK,
|
||||
OPTION_ELF_STT_COMMON,
|
||||
+ OPTION_ELF_BUILD_NOTES,
|
||||
OPTION_SECTNAME_SUBST,
|
||||
OPTION_ALTERNATE,
|
||||
OPTION_AL,
|
||||
@@ -508,6 +521,7 @@ parse_args (int * pargc, char *** pargv)
|
||||
,{"size-check", required_argument, NULL, OPTION_SIZE_CHECK}
|
||||
,{"elf-stt-common", required_argument, NULL, OPTION_ELF_STT_COMMON}
|
||||
,{"sectname-subst", no_argument, NULL, OPTION_SECTNAME_SUBST}
|
||||
+ ,{"generate-missing-build-notes", required_argument, NULL, OPTION_ELF_BUILD_NOTES}
|
||||
#endif
|
||||
,{"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}
|
||||
,{"gdwarf-2", no_argument, NULL, OPTION_GDWARF2}
|
||||
@@ -900,7 +914,19 @@ This program has absolutely no warranty.
|
||||
case OPTION_SECTNAME_SUBST:
|
||||
flag_sectname_subst = 1;
|
||||
break;
|
||||
-#endif
|
||||
+
|
||||
+ case OPTION_ELF_BUILD_NOTES:
|
||||
+ if (strcasecmp (optarg, "no") == 0)
|
||||
+ flag_generate_build_notes = FALSE;
|
||||
+ else if (strcasecmp (optarg, "yes") == 0)
|
||||
+ flag_generate_build_notes = TRUE;
|
||||
+ else
|
||||
+ as_fatal (_("Invalid --generate-missing-build-notes option: `%s'"),
|
||||
+ optarg);
|
||||
+ break;
|
||||
+
|
||||
+#endif /* OBJ_ELF */
|
||||
+
|
||||
case 'Z':
|
||||
flag_always_generate_output = 1;
|
||||
break;
|
||||
diff -rup binutils.orig/gas/as.h binutils-2.30/gas/as.h
|
||||
--- binutils.orig/gas/as.h 2018-04-26 15:14:17.654459410 +0100
|
||||
+++ binutils-2.30/gas/as.h 2018-04-26 15:14:31.927287474 +0100
|
||||
@@ -585,6 +585,10 @@ COMMON int flag_allow_nonconst_size;
|
||||
/* If we should generate ELF common symbols with the STT_COMMON type. */
|
||||
extern int flag_use_elf_stt_common;
|
||||
|
||||
+/* TRUE iff GNU Build attribute notes should
|
||||
+ be generated if none are in the input files. */
|
||||
+extern bfd_boolean flag_generate_build_notes;
|
||||
+
|
||||
/* If section name substitution sequences should be honored */
|
||||
COMMON int flag_sectname_subst;
|
||||
#endif
|
||||
Only in binutils-2.30/gas: as.h.orig
|
||||
diff -rup binutils.orig/gas/config.in binutils-2.30/gas/config.in
|
||||
--- binutils.orig/gas/config.in 2018-04-26 15:14:17.645459519 +0100
|
||||
+++ binutils-2.30/gas/config.in 2018-04-26 15:14:31.927287474 +0100
|
||||
@@ -39,6 +39,10 @@
|
||||
/* Define if you want compressed debug sections by default. */
|
||||
#undef DEFAULT_FLAG_COMPRESS_DEBUG
|
||||
|
||||
+/* Define to 1 if you want to generate GNU Build attribute notes by default,
|
||||
+ if none are contained in the input. */
|
||||
+#undef DEFAULT_GENERATE_BUILD_NOTES
|
||||
+
|
||||
/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON
|
||||
type by default. */
|
||||
#undef DEFAULT_GENERATE_ELF_STT_COMMON
|
||||
diff -rup binutils.orig/gas/configure binutils-2.30/gas/configure
|
||||
--- binutils.orig/gas/configure 2018-04-26 15:14:17.645459519 +0100
|
||||
+++ binutils-2.30/gas/configure 2018-04-26 15:14:31.928287462 +0100
|
||||
@@ -771,6 +771,7 @@ enable_checking
|
||||
enable_compressed_debug_sections
|
||||
enable_x86_relax_relocations
|
||||
enable_elf_stt_common
|
||||
+enable_generate_build_notes
|
||||
enable_werror
|
||||
enable_build_warnings
|
||||
with_cpu
|
||||
@@ -1426,6 +1427,9 @@ Optional Features:
|
||||
generate x86 relax relocations by default
|
||||
--enable-elf-stt-common generate ELF common symbols with STT_COMMON type by
|
||||
default
|
||||
+ --enable-generate-build-notes
|
||||
+ generate GNU Build notes if none are provided by the
|
||||
+ input
|
||||
--enable-werror treat compile warnings as errors
|
||||
--enable-build-warnings enable build-time compiler warnings
|
||||
--disable-nls do not use Native Language Support
|
||||
@@ -11011,7 +11015,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
-#line 10990 "configure"
|
||||
+#line 10994 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -11117,7 +11121,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
-#line 11096 "configure"
|
||||
+#line 11100 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -11771,6 +11775,20 @@ if test "${enable_elf_stt_common+set}" =
|
||||
esac
|
||||
fi
|
||||
|
||||
+
|
||||
+# Decide if the ELF assembler should default to generating
|
||||
+# GNU Build notes if none are provided by the input.
|
||||
+ac_default_generate_build_notes=0
|
||||
+# Provide a configuration option to override the default.
|
||||
+# Check whether --enable-generate_build_notes was given.
|
||||
+if test "${enable_generate_build_notes+set}" = set; then :
|
||||
+ enableval=$enable_generate_build_notes; case "${enableval}" in
|
||||
+ yes) ac_default_generate_build_notes=1 ;;
|
||||
+ no) ac_default_generate_build_notes=0 ;;
|
||||
+esac
|
||||
+fi
|
||||
+
|
||||
+
|
||||
using_cgen=no
|
||||
|
||||
|
||||
@@ -12713,6 +12731,12 @@ cat >>confdefs.h <<_ACEOF
|
||||
_ACEOF
|
||||
|
||||
|
||||
+
|
||||
+cat >>confdefs.h <<_ACEOF
|
||||
+#define DEFAULT_GENERATE_BUILD_NOTES $ac_default_generate_build_notes
|
||||
+_ACEOF
|
||||
+
|
||||
+
|
||||
if test x$ac_default_compressed_debug_sections = xyes ; then
|
||||
|
||||
$as_echo "#define DEFAULT_FLAG_COMPRESS_DEBUG 1" >>confdefs.h
|
||||
diff -rup binutils.orig/gas/configure.ac binutils-2.30/gas/configure.ac
|
||||
--- binutils.orig/gas/configure.ac 2018-04-26 15:14:17.645459519 +0100
|
||||
+++ binutils-2.30/gas/configure.ac 2018-04-26 15:14:31.928287462 +0100
|
||||
@@ -100,6 +100,20 @@ AC_ARG_ENABLE(elf_stt_common,
|
||||
yes) ac_default_elf_stt_common=1 ;;
|
||||
esac])dnl
|
||||
|
||||
+
|
||||
+# Decide if the ELF assembler should default to generating
|
||||
+# GNU Build notes if none are provided by the input.
|
||||
+ac_default_generate_build_notes=0
|
||||
+# Provide a configuration option to override the default.
|
||||
+AC_ARG_ENABLE(generate_build_notes,
|
||||
+ AS_HELP_STRING([--enable-generate-build-notes],
|
||||
+ [generate GNU Build notes if none are provided by the input]),
|
||||
+[case "${enableval}" in
|
||||
+ yes) ac_default_generate_build_notes=1 ;;
|
||||
+ no) ac_default_generate_build_notes=0 ;;
|
||||
+esac])dnl
|
||||
+
|
||||
+
|
||||
using_cgen=no
|
||||
|
||||
AM_BINUTILS_WARNINGS
|
||||
@@ -610,6 +624,11 @@ AC_DEFINE_UNQUOTED(DEFAULT_GENERATE_ELF_
|
||||
[Define to 1 if you want to generate ELF common symbols with the
|
||||
STT_COMMON type by default.])
|
||||
|
||||
+AC_DEFINE_UNQUOTED(DEFAULT_GENERATE_BUILD_NOTES,
|
||||
+ $ac_default_generate_build_notes,
|
||||
+ [Define to 1 if you want to generate GNU Build attribute notes
|
||||
+ by default, if none are contained in the input.])
|
||||
+
|
||||
if test x$ac_default_compressed_debug_sections = xyes ; then
|
||||
AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.])
|
||||
fi
|
||||
Only in binutils-2.30/gas: configure.ac.orig
|
||||
Only in binutils-2.30/gas: configure.orig
|
||||
diff -rup binutils.orig/gas/doc/as.texinfo binutils-2.30/gas/doc/as.texinfo
|
||||
--- binutils.orig/gas/doc/as.texinfo 2018-04-26 15:14:17.665459278 +0100
|
||||
+++ binutils-2.30/gas/doc/as.texinfo 2018-04-26 15:14:31.929287450 +0100
|
||||
@@ -244,6 +244,7 @@ gcc(1), ld(1), and the Info entries for
|
||||
[@b{-Z}] [@b{@@@var{FILE}}]
|
||||
[@b{--sectname-subst}] [@b{--size-check=[error|warning]}]
|
||||
[@b{--elf-stt-common=[no|yes]}]
|
||||
+ [@b{--generate-missing-build-notes=[no|yes]}]
|
||||
[@b{--target-help}] [@var{target-options}]
|
||||
[@b{--}|@var{files} @dots{}]
|
||||
@c
|
||||
@@ -754,6 +755,14 @@ Issue an error or warning for invalid EL
|
||||
These options control whether the ELF assembler should generate common
|
||||
symbols with the @code{STT_COMMON} type. The default can be controlled
|
||||
by a configure option @option{--enable-elf-stt-common}.
|
||||
+
|
||||
+@item --generate-missing-build-notes=yes
|
||||
+@itemx --generate-missing-build-notes=no
|
||||
+These options control whether the ELF assembler should generate GNU Build
|
||||
+attribute notes if none are present in the input sources.
|
||||
+The default can be controlled by the @option{--enable-generate-build-notes}
|
||||
+configure option.
|
||||
+
|
||||
@end ifset
|
||||
|
||||
@item --help
|
||||
Only in binutils-2.30/gas/doc: as.texinfo.orig
|
||||
diff -rup binutils.orig/gas/NEWS binutils-2.30/gas/NEWS
|
||||
--- binutils.orig/gas/NEWS 2018-04-26 15:14:17.646459507 +0100
|
||||
+++ binutils-2.30/gas/NEWS 2018-04-26 15:15:32.276560482 +0100
|
||||
@@ -1,5 +1,11 @@
|
||||
-*- text -*-
|
||||
|
||||
+* Add --generate-missing-build-notes=[yes|no] option to create (or not) GNU
|
||||
+ Build Attribute notes if none are present in the input sources. Add a
|
||||
+ --enable-generate-build-notes=[yes|no] configure time option to set the
|
||||
+ default behaviour. Set the default if the configure option is not used
|
||||
+ to "no".
|
||||
+
|
||||
Changes in 2.30:
|
||||
|
||||
* Add support for loaction views in DWARF debug line information.
|
||||
Only in binutils-2.30/gas: NEWS.orig
|
||||
Only in binutils-2.30/gas: NEWS.rej
|
||||
diff -rup binutils.orig/gas/symbols.c binutils-2.30/gas/symbols.c
|
||||
--- binutils.orig/gas/symbols.c 2018-04-26 15:14:17.667459254 +0100
|
||||
+++ binutils-2.30/gas/symbols.c 2018-04-26 15:14:31.929287450 +0100
|
||||
@@ -108,6 +108,7 @@ save_symbol_name (const char *name)
|
||||
size_t name_length;
|
||||
char *ret;
|
||||
|
||||
+ gas_assert (name != NULL);
|
||||
name_length = strlen (name) + 1; /* +1 for \0. */
|
||||
obstack_grow (¬es, name, name_length);
|
||||
ret = (char *) obstack_finish (¬es);
|
||||
diff -rup binutils.orig/gas/write.c binutils-2.30/gas/write.c
|
||||
--- binutils.orig/gas/write.c 2018-04-26 15:14:18.296451677 +0100
|
||||
+++ binutils-2.30/gas/write.c 2018-04-26 15:14:31.929287450 +0100
|
||||
@@ -1822,25 +1822,200 @@ create_obj_attrs_section (void)
|
||||
const char *name;
|
||||
|
||||
size = bfd_elf_obj_attr_size (stdoutput);
|
||||
- if (size)
|
||||
+ if (size == 0)
|
||||
+ return;
|
||||
+
|
||||
+ name = get_elf_backend_data (stdoutput)->obj_attrs_section;
|
||||
+ if (!name)
|
||||
+ name = ".gnu.attributes";
|
||||
+ s = subseg_new (name, 0);
|
||||
+ elf_section_type (s)
|
||||
+ = get_elf_backend_data (stdoutput)->obj_attrs_section_type;
|
||||
+ bfd_set_section_flags (stdoutput, s, SEC_READONLY | SEC_DATA);
|
||||
+ frag_now_fix ();
|
||||
+ p = frag_more (size);
|
||||
+ bfd_elf_set_obj_attr_contents (stdoutput, (bfd_byte *)p, size);
|
||||
+
|
||||
+ subsegs_finish_section (s);
|
||||
+ relax_segment (seg_info (s)->frchainP->frch_root, s, 0);
|
||||
+ size_seg (stdoutput, s, NULL);
|
||||
+}
|
||||
+
|
||||
+#include "struc-symbol.h"
|
||||
+
|
||||
+/* Create a relocation against an entry in a GNU Build attribute section. */
|
||||
+
|
||||
+static void
|
||||
+create_note_reloc (segT sec,
|
||||
+ symbolS * sym,
|
||||
+ bfd_size_type offset,
|
||||
+ int reloc_type,
|
||||
+ bfd_vma addend,
|
||||
+ char * note)
|
||||
+{
|
||||
+ struct reloc_list * reloc;
|
||||
+
|
||||
+ reloc = XNEW (struct reloc_list);
|
||||
+
|
||||
+ /* We create a .b type reloc as resolve_reloc_expr_symbols() has already been called. */
|
||||
+ reloc->u.b.sec = sec;
|
||||
+ reloc->u.b.s = sym->bsym;
|
||||
+ reloc->u.b.r.sym_ptr_ptr = & reloc->u.b.s;
|
||||
+ reloc->u.b.r.address = offset;
|
||||
+ reloc->u.b.r.addend = addend;
|
||||
+ reloc->u.b.r.howto = bfd_reloc_type_lookup (stdoutput, reloc_type);
|
||||
+
|
||||
+ if (reloc->u.b.r.howto == NULL)
|
||||
{
|
||||
- name = get_elf_backend_data (stdoutput)->obj_attrs_section;
|
||||
- if (!name)
|
||||
- name = ".gnu.attributes";
|
||||
- s = subseg_new (name, 0);
|
||||
- elf_section_type (s)
|
||||
- = get_elf_backend_data (stdoutput)->obj_attrs_section_type;
|
||||
- bfd_set_section_flags (stdoutput, s, SEC_READONLY | SEC_DATA);
|
||||
- frag_now_fix ();
|
||||
- p = frag_more (size);
|
||||
- bfd_elf_set_obj_attr_contents (stdoutput, (bfd_byte *)p, size);
|
||||
-
|
||||
- subsegs_finish_section (s);
|
||||
- relax_segment (seg_info (s)->frchainP->frch_root, s, 0);
|
||||
- size_seg (stdoutput, s, NULL);
|
||||
+ as_bad (_("unable to create reloc for build note"));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ reloc->file = N_("<gnu build note>");
|
||||
+ reloc->line = 0;
|
||||
+
|
||||
+ reloc->next = reloc_list;
|
||||
+ reloc_list = reloc;
|
||||
+
|
||||
+ /* For REL relocs, store the addend in the section. */
|
||||
+ if (! sec->use_rela_p
|
||||
+ /* The SH target is a special case that uses RELA relocs
|
||||
+ but still stores the addend in the word being relocated. */
|
||||
+ || strstr (bfd_get_target (stdoutput), "-sh") != NULL)
|
||||
+ {
|
||||
+ if (target_big_endian)
|
||||
+ {
|
||||
+ if (bfd_arch_bits_per_address (stdoutput) <= 32)
|
||||
+ note[offset + 3] = addend;
|
||||
+ else
|
||||
+ note[offset + 7] = addend;
|
||||
+ }
|
||||
+ else
|
||||
+ note[offset] = addend;
|
||||
}
|
||||
}
|
||||
-#endif
|
||||
+
|
||||
+static void
|
||||
+maybe_generate_build_notes (void)
|
||||
+{
|
||||
+ segT sec;
|
||||
+ char * note;
|
||||
+ offsetT note_size;
|
||||
+ offsetT desc_size;
|
||||
+ offsetT desc2_offset;
|
||||
+ int desc_reloc;
|
||||
+ symbolS * sym;
|
||||
+
|
||||
+ if (! flag_generate_build_notes
|
||||
+ || bfd_get_section_by_name (stdoutput,
|
||||
+ GNU_BUILD_ATTRS_SECTION_NAME) != NULL)
|
||||
+ return;
|
||||
+
|
||||
+ /* Create a GNU Build Attribute section. */
|
||||
+ sec = subseg_new (GNU_BUILD_ATTRS_SECTION_NAME, FALSE);
|
||||
+ elf_section_type (sec) = SHT_NOTE;
|
||||
+ bfd_set_section_flags (stdoutput, sec,
|
||||
+ SEC_READONLY | SEC_HAS_CONTENTS | SEC_DATA);
|
||||
+ bfd_set_section_alignment (stdoutput, sec, 2);
|
||||
+
|
||||
+ /* Create a version note. */
|
||||
+ if (bfd_arch_bits_per_address (stdoutput) <= 32)
|
||||
+ {
|
||||
+ note_size = 28;
|
||||
+ desc_size = 8; /* Two 4-byte offsets. */
|
||||
+ desc2_offset = 24;
|
||||
+
|
||||
+ /* FIXME: The BFD backend for the CRX target does not support the
|
||||
+ BFD_RELOC_32, even though it really should. Likewise for the
|
||||
+ CR16 target. So we have special case code here... */
|
||||
+ if (strstr (bfd_get_target (stdoutput), "-crx") != NULL)
|
||||
+ desc_reloc = BFD_RELOC_CRX_NUM32;
|
||||
+ else if (strstr (bfd_get_target (stdoutput), "-cr16") != NULL)
|
||||
+ desc_reloc = BFD_RELOC_CR16_NUM32;
|
||||
+ else
|
||||
+ desc_reloc = BFD_RELOC_32;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ note_size = 36;
|
||||
+ desc_size = 16; /* Two 8-byte offsets. */
|
||||
+ desc2_offset = 28;
|
||||
+ /* FIXME: The BFD backend for the IA64 target does not support the
|
||||
+ BFD_RELOC_64, even though it really should. The HPPA backend
|
||||
+ has a similar issue, although it does not support BFD_RELOCs at
|
||||
+ all! So we have special case code to handle these targets. */
|
||||
+ if (strstr (bfd_get_target (stdoutput), "-ia64") != NULL)
|
||||
+ desc_reloc = target_big_endian ? BFD_RELOC_IA64_DIR32MSB : BFD_RELOC_IA64_DIR32LSB;
|
||||
+ else if (strstr (bfd_get_target (stdoutput), "-hppa") != NULL)
|
||||
+ desc_reloc = 80; /* R_PARISC_DIR64. */
|
||||
+ else
|
||||
+ desc_reloc = BFD_RELOC_64;
|
||||
+ }
|
||||
+
|
||||
+ frag_now_fix ();
|
||||
+ note = frag_more (note_size);
|
||||
+ memset (note, 0, note_size);
|
||||
+
|
||||
+ if (target_big_endian)
|
||||
+ {
|
||||
+ note[3] = 8; /* strlen (name) + 1. */
|
||||
+ note[7] = desc_size; /* Two 8-byte offsets. */
|
||||
+ note[10] = NT_GNU_BUILD_ATTRIBUTE_OPEN >> 8;
|
||||
+ note[11] = NT_GNU_BUILD_ATTRIBUTE_OPEN & 0xff;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ note[0] = 8; /* strlen (name) + 1. */
|
||||
+ note[4] = desc_size; /* Two 8-byte offsets. */
|
||||
+ note[8] = NT_GNU_BUILD_ATTRIBUTE_OPEN & 0xff;
|
||||
+ note[9] = NT_GNU_BUILD_ATTRIBUTE_OPEN >> 8;
|
||||
+ }
|
||||
+
|
||||
+ /* The a1 version number indicates that this note was
|
||||
+ generated by the assembler and not the gcc annobin plugin. */
|
||||
+ memcpy (note + 12, "GA$3a1", 8);
|
||||
+
|
||||
+ /* Find the first code section symbol. */
|
||||
+ for (sym = symbol_rootP; sym != NULL; sym = sym->sy_next)
|
||||
+ if (sym->bsym != NULL
|
||||
+ && sym->bsym->flags & BSF_SECTION_SYM
|
||||
+ && sym->bsym->section != NULL
|
||||
+ && sym->bsym->section->flags & SEC_CODE)
|
||||
+ {
|
||||
+ /* Found one - now create a relocation against this symbol. */
|
||||
+ create_note_reloc (sec, sym, 20, desc_reloc, 0, note);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* Find the last code section symbol. */
|
||||
+ if (sym)
|
||||
+ {
|
||||
+ for (sym = symbol_lastP; sym != NULL; sym = sym->sy_previous)
|
||||
+ if (sym->bsym != NULL
|
||||
+ && sym->bsym->flags & BSF_SECTION_SYM
|
||||
+ && sym->bsym->section != NULL
|
||||
+ && sym->bsym->section->flags & SEC_CODE)
|
||||
+ {
|
||||
+ /* Create a relocation against the end of this symbol. */
|
||||
+ create_note_reloc (sec, sym, desc2_offset, desc_reloc,
|
||||
+ bfd_get_section_size (sym->bsym->section),
|
||||
+ note);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ /* else - if we were unable to find any code section symbols then
|
||||
+ probably there is no code in the output. So leaving the start
|
||||
+ and end values as zero in the note is OK. */
|
||||
+
|
||||
+ /* FIXME: Maybe add a note recording the assembler command line and version ? */
|
||||
+
|
||||
+ /* Install the note(s) into the section. */
|
||||
+ bfd_set_section_contents (stdoutput, sec, (bfd_byte *) note, 0, note_size);
|
||||
+ subsegs_finish_section (sec);
|
||||
+ relax_segment (seg_info (sec)->frchainP->frch_root, sec, 0);
|
||||
+ size_seg (stdoutput, sec, NULL);
|
||||
+}
|
||||
+#endif /* OBJ_ELF */
|
||||
|
||||
/* Write the object file. */
|
||||
|
||||
@@ -2052,6 +2227,11 @@ write_object_file (void)
|
||||
resolve_local_symbol_values ();
|
||||
resolve_reloc_expr_symbols ();
|
||||
|
||||
+#ifdef OBJ_ELF
|
||||
+ if (IS_ELF)
|
||||
+ maybe_generate_build_notes ();
|
||||
+#endif
|
||||
+
|
||||
PROGRESS (1);
|
||||
|
||||
#ifdef tc_frob_file_before_adjust
|
||||
Only in binutils-2.30/gas: write.c.orig
|
||||
Only in binutils-2.30: testsuite
|
||||
--- /dev/null 2018-04-26 08:07:19.307057583 +0100
|
||||
+++ binutils-2.30/binutils/testsuite/binutils-all/note-5.d 2018-04-26 15:17:06.318427614 +0100
|
||||
@@ -0,0 +1,11 @@
|
||||
+#PROG: objcopy
|
||||
+#as: --generate-missing-build-notes=yes
|
||||
+#readelf: --notes --wide
|
||||
+#name: assembler generated build notes
|
||||
+#source: note-5.s
|
||||
+
|
||||
+#...
|
||||
+Displaying notes found in: .gnu.build.attributes
|
||||
+[ ]+Owner[ ]+Data size[ ]+Description
|
||||
+[ ]+GA\$<version>3a1[ ]+0x000000(08|10)[ ]+OPEN[ ]+Applies to region from 0 to 0x.. \(note_5.s\)
|
||||
+#...
|
||||
--- /dev/null 2018-04-26 08:07:19.307057583 +0100
|
||||
+++ binutils-2.30/binutils/testsuite/binutils-all/note-5.s 2018-04-26 15:17:06.318427614 +0100
|
||||
@@ -0,0 +1,14 @@
|
||||
+ .text
|
||||
+ .global note_5.s
|
||||
+note_5.s:
|
||||
+ .dc.l 2
|
||||
+ .dc.l 4
|
||||
+ .dc.l 6
|
||||
+ .dc.l 8
|
||||
+ .dc.l 8
|
||||
+ .dc.l 8
|
||||
+ .dc.l 8
|
||||
+ .dc.l 8
|
||||
+ .dc.l 8
|
||||
+ .dc.l 8
|
||||
+
|
||||
\ No newline at end of file
|
180
SOURCES/binutils-gcc-10-fixes.patch
Normal file
180
SOURCES/binutils-gcc-10-fixes.patch
Normal file
@ -0,0 +1,180 @@
|
||||
diff -rup binutils.orig/gold/gdb-index.cc binutils-2.34.0/gold/gdb-index.cc
|
||||
--- binutils.orig/gold/gdb-index.cc 2020-07-24 09:12:29.241306445 +0100
|
||||
+++ binutils-2.34.0/gold/gdb-index.cc 2020-07-24 09:15:48.332095898 +0100
|
||||
@@ -817,7 +817,7 @@ Gdb_index_info_reader::get_qualified_nam
|
||||
void
|
||||
Gdb_index_info_reader::record_cu_ranges(Dwarf_die* die)
|
||||
{
|
||||
- unsigned int shndx;
|
||||
+ unsigned int shndx = 0;
|
||||
unsigned int shndx2;
|
||||
|
||||
off_t ranges_offset = die->ref_attribute(elfcpp::DW_AT_ranges, &shndx);
|
||||
diff -rup binutils.orig/gold/layout.cc binutils-2.34.0/gold/layout.cc
|
||||
--- binutils.orig/gold/layout.cc 2020-07-24 09:12:29.243306433 +0100
|
||||
+++ binutils-2.34.0/gold/layout.cc 2020-07-24 09:15:11.464320064 +0100
|
||||
@@ -1986,7 +1986,7 @@ Layout::attach_allocated_section_to_segm
|
||||
seg_flags |= os->extra_segment_flags();
|
||||
|
||||
// Check for --section-start.
|
||||
- uint64_t addr;
|
||||
+ uint64_t addr = 0;
|
||||
bool is_address_set = parameters->options().section_start(os->name(), &addr);
|
||||
|
||||
// In general the only thing we really care about for PT_LOAD
|
||||
diff -rup binutils.orig/binutils/dlltool.c binutils-2.34.0/binutils/dlltool.c
|
||||
--- binutils.orig/binutils/dlltool.c 2020-07-24 09:12:28.974308069 +0100
|
||||
+++ binutils-2.34.0/binutils/dlltool.c 2020-07-24 12:09:37.527121295 +0100
|
||||
@@ -1305,7 +1305,7 @@ run (const char *what, char *args)
|
||||
int pid, wait_status;
|
||||
int i;
|
||||
const char **argv;
|
||||
- char *errmsg_fmt, *errmsg_arg;
|
||||
+ char *errmsg_fmt = "", *errmsg_arg = "";
|
||||
char *temp_base = choose_temp_base ();
|
||||
|
||||
inform (_("run: %s %s"), what, args);
|
||||
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
|
||||
--- binutils.orig/gas/config/tc-arm.c 2020-07-24 09:12:32.368287432 +0100
|
||||
+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:14:19.842360634 +0100
|
||||
@@ -28416,9 +28416,12 @@ md_apply_fix (fixS * fixP,
|
||||
perform relaxation. */
|
||||
if (value == -2)
|
||||
{
|
||||
- newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
- newval = 0xbf00; /* NOP encoding T1 */
|
||||
- md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
+ if (fixP->fx_done || !seg->use_rela_p)
|
||||
+ {
|
||||
+ newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
+ newval = 0xbf00; /* NOP encoding T1 */
|
||||
+ md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -28631,17 +28634,14 @@ md_apply_fix (fixS * fixP,
|
||||
case BFD_RELOC_ARM_GOTFUNCDESC:
|
||||
case BFD_RELOC_ARM_GOTOFFFUNCDESC:
|
||||
case BFD_RELOC_ARM_FUNCDESC:
|
||||
- if (arm_fdpic)
|
||||
- {
|
||||
- if (fixP->fx_done || !seg->use_rela_p)
|
||||
- md_number_to_chars (buf, 0, 4);
|
||||
- }
|
||||
- else
|
||||
+ if (!arm_fdpic)
|
||||
{
|
||||
as_bad_where (fixP->fx_file, fixP->fx_line,
|
||||
_("Relocation supported only in FDPIC mode"));
|
||||
- }
|
||||
- break;
|
||||
+ break;
|
||||
+ }
|
||||
+ value = 0;
|
||||
+ /* Fall through. */
|
||||
#endif
|
||||
|
||||
case BFD_RELOC_RVA:
|
||||
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
|
||||
--- binutils.orig/gas/config/tc-arm.c 2020-07-24 12:16:02.099719884 +0100
|
||||
+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:34:17.690858328 +0100
|
||||
@@ -28641,7 +28641,7 @@ md_apply_fix (fixS * fixP,
|
||||
break;
|
||||
}
|
||||
value = 0;
|
||||
- /* Fall through. */
|
||||
+ goto fred;
|
||||
#endif
|
||||
|
||||
case BFD_RELOC_RVA:
|
||||
@@ -28653,6 +28653,7 @@ md_apply_fix (fixS * fixP,
|
||||
#ifdef TE_PE
|
||||
case BFD_RELOC_32_SECREL:
|
||||
#endif
|
||||
+ fred:
|
||||
if (fixP->fx_done || !seg->use_rela_p)
|
||||
#ifdef TE_WINCE
|
||||
/* For WinCE we only do this for pcrel fixups. */
|
||||
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
|
||||
--- binutils.orig/gas/config/tc-arm.c 2020-07-24 13:28:26.926553452 +0100
|
||||
+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 13:31:57.835215763 +0100
|
||||
@@ -28416,12 +28416,8 @@ md_apply_fix (fixS * fixP,
|
||||
perform relaxation. */
|
||||
if (value == -2)
|
||||
{
|
||||
- if (fixP->fx_done || !seg->use_rela_p)
|
||||
- {
|
||||
- newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
- newval = 0xbf00; /* NOP encoding T1 */
|
||||
- md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
- }
|
||||
+ newval = 0xbf00; /* NOP encoding T1 */
|
||||
+ goto jim;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -28432,6 +28428,7 @@ md_apply_fix (fixS * fixP,
|
||||
{
|
||||
newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3);
|
||||
+ jim:
|
||||
md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
}
|
||||
}
|
||||
diff -rup binutils.orig/binutils/mclex.c binutils-2.34.0/binutils/mclex.c
|
||||
--- binutils.orig/binutils/mclex.c 2020-07-24 13:28:26.297557441 +0100
|
||||
+++ binutils-2.34.0/binutils/mclex.c 2020-07-24 14:46:53.587940149 +0100
|
||||
@@ -207,7 +207,7 @@ enum_severity (int e)
|
||||
static void
|
||||
mc_add_keyword_ascii (const char *sz, int rid, const char *grp, rc_uint_type nv, const char *sv)
|
||||
{
|
||||
- unichar *usz, *usv = NULL;
|
||||
+ unichar *usz = NULL, *usv = NULL;
|
||||
rc_uint_type usz_len;
|
||||
|
||||
unicode_from_codepage (&usz_len, &usz, sz, CP_ACP);
|
||||
diff -rup binutils.orig/binutils/windmc.c binutils-2.34.0/binutils/windmc.c
|
||||
--- binutils.orig/binutils/windmc.c 2020-07-24 13:28:26.279557556 +0100
|
||||
+++ binutils-2.34.0/binutils/windmc.c 2020-07-24 14:48:05.460477478 +0100
|
||||
@@ -338,7 +338,7 @@ mc_add_node_lang (mc_node *root, const m
|
||||
static char *
|
||||
convert_unicode_to_ACP (const unichar *usz)
|
||||
{
|
||||
- char *s;
|
||||
+ char *s = NULL;
|
||||
rc_uint_type l;
|
||||
|
||||
if (! usz)
|
||||
@@ -607,10 +607,10 @@ mc_generate_bin_item (mc_node_lang *n, r
|
||||
else
|
||||
{
|
||||
rc_uint_type txt_len, l;
|
||||
- char *cvt_txt;
|
||||
+ char *cvt_txt = NULL;
|
||||
|
||||
codepage_from_unicode( &l, n->message, &cvt_txt, n->lang->lang_info.wincp);
|
||||
- if (! cvt_txt)
|
||||
+ if (cvt_txt == NULL)
|
||||
fatal ("Failed to convert message to language codepage.\n");
|
||||
txt_len = strlen (cvt_txt);
|
||||
if (mcset_automatic_null_termination && txt_len > 0)
|
||||
@@ -1107,7 +1107,7 @@ main (int argc, char **argv)
|
||||
|
||||
/* Load the input file and do code page transformations to UTF16. */
|
||||
{
|
||||
- unichar *u;
|
||||
+ unichar *u = NULL;
|
||||
rc_uint_type ul;
|
||||
char *buff;
|
||||
bfd_size_type flen;
|
||||
--- binutils.orig/binutils/srconv.c 2020-07-24 15:37:25.847459208 +0100
|
||||
+++ binutils-2.34.0/binutils/srconv.c 2020-07-24 15:39:12.853773423 +0100
|
||||
@@ -316,6 +316,7 @@ wr_hd (struct coff_ofile *p)
|
||||
struct IT_hd hd;
|
||||
|
||||
hd.spare1 = 0;
|
||||
+ hd.spare2 = 0;
|
||||
if (bfd_get_file_flags (abfd) & EXEC_P)
|
||||
hd.mt = MTYPE_ABS_LM;
|
||||
else
|
75
SOURCES/binutils-gnu.debuglto_.patch
Normal file
75
SOURCES/binutils-gnu.debuglto_.patch
Normal file
@ -0,0 +1,75 @@
|
||||
diff -rup binutils.orig/bfd/elf.c binutils-2.35.2/bfd/elf.c
|
||||
--- binutils.orig/bfd/elf.c 2024-06-20 16:18:11.685058701 +0100
|
||||
+++ binutils-2.35.2/bfd/elf.c 2024-06-20 16:19:59.040433524 +0100
|
||||
@@ -1090,6 +1090,7 @@ _bfd_elf_make_section_from_shdr (bfd *ab
|
||||
if (name [0] == '.')
|
||||
{
|
||||
if (strncmp (name, ".debug", 6) == 0
|
||||
+ || strncmp (name, ".gnu.debuglto_.debug_", 21) == 0
|
||||
|| strncmp (name, ".gnu.linkonce.wi.", 17) == 0
|
||||
|| strncmp (name, ".zdebug", 7) == 0)
|
||||
flags |= SEC_DEBUGGING | SEC_ELF_OCTETS;
|
||||
diff -rup binutils.orig/ld/ldlang.c binutils-2.35.2/ld/ldlang.c
|
||||
--- binutils.orig/ld/ldlang.c 2024-06-20 16:18:11.518058118 +0100
|
||||
+++ binutils-2.35.2/ld/ldlang.c 2024-06-20 16:21:50.407756115 +0100
|
||||
@@ -7471,7 +7471,7 @@ lang_gc_sections (void)
|
||||
lang_gc_sections_1 (statement_list.head);
|
||||
|
||||
/* SEC_EXCLUDE is ignored when doing a relocatable link, except in
|
||||
- the special case of debug info. (See bfd/stabs.c)
|
||||
+ the special case of .stabstr debug info. (See bfd/stabs.c)
|
||||
Twiddle the flag here, to simplify later linker code. */
|
||||
if (bfd_link_relocatable (&link_info))
|
||||
{
|
||||
@@ -7483,7 +7483,8 @@ lang_gc_sections (void)
|
||||
continue;
|
||||
#endif
|
||||
for (sec = f->the_bfd->sections; sec != NULL; sec = sec->next)
|
||||
- if ((sec->flags & SEC_DEBUGGING) == 0)
|
||||
+ if ((sec->flags & SEC_DEBUGGING) == 0
|
||||
+ || strcmp (sec->name, ".stabstr") != 0)
|
||||
sec->flags &= ~SEC_EXCLUDE;
|
||||
}
|
||||
}
|
||||
diff -rupN binutils.orig/ld/testsuite/ld-elf/pr27590.s binutils-2.35.2/ld/testsuite/ld-elf/pr27590.s
|
||||
--- binutils.orig/ld/testsuite/ld-elf/pr27590.s 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.35.2/ld/testsuite/ld-elf/pr27590.s 2024-06-20 16:51:39.108295959 +0100
|
||||
@@ -0,0 +1,6 @@
|
||||
+ .section .gnu.debuglto_.debug_macro,"",%progbits
|
||||
+.Ldebug_macro0:
|
||||
+ .dc.a .Ldebug_macro2
|
||||
+ .section .gnu.debuglto_.debug_macro,"G",%progbits,wm4,comdat
|
||||
+.Ldebug_macro2:
|
||||
+ .long 0x4
|
||||
diff -rupN binutils.orig/ld/testsuite/ld-elf/pr27590a.d binutils-2.35.2/ld/testsuite/ld-elf/pr27590a.d
|
||||
--- binutils.orig/ld/testsuite/ld-elf/pr27590a.d 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.35.2/ld/testsuite/ld-elf/pr27590a.d 2024-06-20 16:51:39.111295967 +0100
|
||||
@@ -0,0 +1,12 @@
|
||||
+#source: pr27590.s
|
||||
+#ld: -r tmpdir/pr27590.o
|
||||
+#readelf: -rW
|
||||
+#xfail: [is_generic]
|
||||
+
|
||||
+Relocation section '\.rel.*\.gnu\.debuglto_\.debug_macro' at offset 0x[0-9a-z]+ contains 2 entries:
|
||||
+[ \t]+Offset[ \t]+Info[ \t]+Type[ \t]+Sym.*
|
||||
+[0-9a-f]+[ \t]+[0-9a-f]+[ \t]+R_.*[ \t]+[0]+[ \t]+(\.gnu\.debuglto_\.debug_macro|\.Ldebug_macro2).*
|
||||
+#?.*R_MIPS_NONE.*
|
||||
+#?.*R_MIPS_NONE.*
|
||||
+[0-9a-f]+[ \t]+[0-9a-f]+[ \t]+R_.*[ \t]+[0]+[ \t]+(\.gnu\.debuglto_\.debug_macro|\.Ldebug_macro2).*
|
||||
+#pass
|
||||
diff -rupN binutils.orig/ld/testsuite/ld-elf/pr27590b.d binutils-2.35.2/ld/testsuite/ld-elf/pr27590b.d
|
||||
--- binutils.orig/ld/testsuite/ld-elf/pr27590b.d 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.35.2/ld/testsuite/ld-elf/pr27590b.d 2024-06-20 16:51:39.111295967 +0100
|
||||
@@ -0,0 +1,12 @@
|
||||
+#source: pr27590.s
|
||||
+#ld: -r tmpdir/pr27590.o --reduce-memory-overheads
|
||||
+#readelf: -rW
|
||||
+#xfail: [is_generic]
|
||||
+
|
||||
+Relocation section '\.rel.*\.gnu\.debuglto_\.debug_macro' at offset 0x[0-9a-z]+ contains 2 entries:
|
||||
+[ \t]+Offset[ \t]+Info[ \t]+Type[ \t]+Sym.*
|
||||
+[0-9a-f]+[ \t]+[0-9a-f]+[ \t]+R_.*[ \t]+[0]+[ \t]+(\.gnu\.debuglto_\.debug_macro|\.Ldebug_macro2).*
|
||||
+#?.*R_MIPS_NONE.*
|
||||
+#?.*R_MIPS_NONE.*
|
||||
+[0-9a-f]+[ \t]+[0-9a-f]+[ \t]+R_.*[ \t]+[0]+[ \t]+(\.gnu\.debuglto_\.debug_macro|\.Ldebug_macro2).*
|
||||
+#pass
|
@ -1,99 +0,0 @@
|
||||
diff -rup binutils.orig/gold/layout.cc binutils-2.30/gold/layout.cc
|
||||
--- binutils.orig/gold/layout.cc 2018-10-09 15:24:05.987282736 +0100
|
||||
+++ binutils-2.30/gold/layout.cc 2018-10-09 16:08:29.445946736 +0100
|
||||
@@ -2052,12 +2052,15 @@ Layout::attach_allocated_section_to_segm
|
||||
// segment.
|
||||
if (os->type() == elfcpp::SHT_NOTE)
|
||||
{
|
||||
+ uint64_t os_align = os->addralign();
|
||||
+
|
||||
// See if we already have an equivalent PT_NOTE segment.
|
||||
for (p = this->segment_list_.begin();
|
||||
p != segment_list_.end();
|
||||
++p)
|
||||
{
|
||||
if ((*p)->type() == elfcpp::PT_NOTE
|
||||
+ && (*p)->align() == os_align
|
||||
&& (((*p)->flags() & elfcpp::PF_W)
|
||||
== (seg_flags & elfcpp::PF_W)))
|
||||
{
|
||||
@@ -2071,6 +2074,7 @@ Layout::attach_allocated_section_to_segm
|
||||
Output_segment* oseg = this->make_output_segment(elfcpp::PT_NOTE,
|
||||
seg_flags);
|
||||
oseg->add_output_section_to_nonload(os, seg_flags);
|
||||
+ oseg->set_align(os_align);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3171,6 +3175,10 @@ Layout::create_note(const char* name, in
|
||||
#else
|
||||
const int size = 32;
|
||||
#endif
|
||||
+ // The NT_GNU_PROPERTY_TYPE_0 note conforms to gABI.
|
||||
+ const int addralign = ((note_type == elfcpp::NT_GNU_PROPERTY_TYPE_0
|
||||
+ ? parameters->target().get_size()
|
||||
+ : size) / 8);
|
||||
|
||||
// The contents of the .note section.
|
||||
size_t namesz = strlen(name) + 1;
|
||||
@@ -3234,7 +3242,7 @@ Layout::create_note(const char* name, in
|
||||
return NULL;
|
||||
|
||||
Output_section_data* posd = new Output_data_const_buffer(buffer, notehdrsz,
|
||||
- size / 8,
|
||||
+ addralign,
|
||||
"** note header");
|
||||
os->add_output_section_data(posd);
|
||||
|
||||
@@ -3692,6 +3700,11 @@ Layout::segment_precedes(const Output_se
|
||||
{
|
||||
if (type1 != type2)
|
||||
return type1 < type2;
|
||||
+ uint64_t align1 = seg1->align();
|
||||
+ uint64_t align2 = seg2->align();
|
||||
+ // Place segments with larger alignments first.
|
||||
+ if (align1 != align2)
|
||||
+ return align1 > align2;
|
||||
gold_assert(flags1 != flags2
|
||||
|| this->script_options_->saw_phdrs_clause());
|
||||
return flags1 < flags2;
|
||||
diff -rup binutils.orig/gold/output.cc binutils-2.30/gold/output.cc
|
||||
--- binutils.orig/gold/output.cc 2018-10-09 15:24:05.986282744 +0100
|
||||
+++ binutils-2.30/gold/output.cc 2018-10-09 16:09:03.749670846 +0100
|
||||
@@ -4107,6 +4107,7 @@ Output_segment::Output_segment(elfcpp::E
|
||||
: vaddr_(0),
|
||||
paddr_(0),
|
||||
memsz_(0),
|
||||
+ align_(0),
|
||||
max_align_(0),
|
||||
min_p_align_(0),
|
||||
offset_(0),
|
||||
diff -rup binutils.orig/gold/output.h binutils-2.30/gold/output.h
|
||||
--- binutils.orig/gold/output.h 2018-10-09 15:24:05.984282760 +0100
|
||||
+++ binutils-2.30/gold/output.h 2018-10-09 16:09:45.665333727 +0100
|
||||
@@ -4676,6 +4676,16 @@ class Output_segment
|
||||
offset() const
|
||||
{ return this->offset_; }
|
||||
|
||||
+ // Return the segment alignment.
|
||||
+ uint64_t
|
||||
+ align() const
|
||||
+ { return this->align_; }
|
||||
+
|
||||
+ // Set the segment alignment.
|
||||
+ void
|
||||
+ set_align(uint64_t align)
|
||||
+ { this->align_ = align; }
|
||||
+
|
||||
// Whether this is a segment created to hold large data sections.
|
||||
bool
|
||||
is_large_data_segment() const
|
||||
@@ -4898,6 +4908,8 @@ class Output_segment
|
||||
uint64_t paddr_;
|
||||
// The size of the segment in memory.
|
||||
uint64_t memsz_;
|
||||
+ // The segment alignment.
|
||||
+ uint64_t align_;
|
||||
// The maximum section alignment. The is_max_align_known_ field
|
||||
// indicates whether this has been finalized.
|
||||
uint64_t max_align_;
|
181
SOURCES/binutils-gold-gnu-properties.patch
Normal file
181
SOURCES/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
|
@ -191,165 +191,3 @@ index bf209fe9a86..31161ff091c 100644
|
||||
// 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.
|
||||
--- binutils.orig/elfcpp/elfcpp.h 2021-06-23 12:31:04.550738064 +0100
|
||||
+++ binutils-2.30/elfcpp/elfcpp.h 2021-06-23 12:33:18.068875079 +0100
|
||||
@@ -1008,9 +1008,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
|
||||
--- binutils.orig/gold/i386.cc 2021-07-07 14:15:34.369441519 +0100
|
||||
+++ binutils-2.30/gold/i386.cc 2021-07-07 14:36:11.932838272 +0100
|
||||
@@ -362,9 +362,8 @@ class Target_i386 : public Sized_target<
|
||||
rel_irelative_(NULL), copy_relocs_(elfcpp::R_386_COPY),
|
||||
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)
|
||||
+ feature_1_(0), object_feature_1_(0),
|
||||
+ seen_first_object_(false)
|
||||
{ }
|
||||
|
||||
// Process the relocations to determine unreferenced sections for
|
||||
@@ -866,7 +865,7 @@ class Target_i386 : public Sized_target<
|
||||
// Record a target-specific program property in the .note.gnu.property
|
||||
// section.
|
||||
void
|
||||
- record_gnu_property(unsigned int, unsigned int, size_t,
|
||||
+ record_gnu_property(int, int, size_t,
|
||||
const unsigned char*, const Object*);
|
||||
|
||||
// Merge the target-specific program properties from the current object.
|
||||
@@ -923,18 +922,10 @@ class Target_i386 : public Sized_target<
|
||||
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_;
|
||||
};
|
||||
@@ -1084,7 +1075,7 @@ Target_i386::rel_irelative_section(Layou
|
||||
// section.
|
||||
void
|
||||
Target_i386::record_gnu_property(
|
||||
- unsigned int, unsigned int pr_type,
|
||||
+ int, int pr_type,
|
||||
size_t pr_datasz, const unsigned char* pr_data,
|
||||
const Object* object)
|
||||
{
|
||||
@@ -1092,15 +1083,9 @@ Target_i386::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 "
|
||||
@@ -1120,7 +1105,7 @@ Target_i386::record_gnu_property(
|
||||
switch (pr_type)
|
||||
{
|
||||
case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
- this->object_isa_1_used_ |= val;
|
||||
+ this->isa_1_used_ |= val;
|
||||
break;
|
||||
case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED:
|
||||
this->isa_1_needed_ |= val;
|
||||
@@ -1129,12 +1114,6 @@ Target_i386::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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1143,31 +1122,13 @@ 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_;
|
||||
- }
|
||||
+ this->feature_1_ &= this->object_feature_1_;
|
||||
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
|
||||
@@ -1192,12 +1153,6 @@ Target_i386::do_finalize_gnu_properties(
|
||||
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.
|
||||
|
@ -1,10 +0,0 @@
|
||||
--- binutils.orig/gold/target-reloc.h 2018-07-25 08:29:41.347174442 +0100
|
||||
+++ binutils-2.30/gold/target-reloc.h 2018-07-25 08:30:47.390413706 +0100
|
||||
@@ -136,6 +136,7 @@ class Default_comdat_behavior
|
||||
if (Layout::is_debug_info_section(name))
|
||||
return CB_PRETEND;
|
||||
if (strcmp(name, ".eh_frame") == 0
|
||||
+ || strncmp(name, ".gnu.build.attributes", 21) == 0 // FIXME: We should really be checking the section type for SHT_NOTE.
|
||||
|| strcmp(name, ".gcc_except_table") == 0)
|
||||
return CB_IGNORE;
|
||||
return CB_WARNING;
|
@ -1,16 +0,0 @@
|
||||
--- binutils.orig/gold/resolve.cc 2018-03-22 16:52:11.746513638 +0000
|
||||
+++ binutils-2.30/gold/resolve.cc 2018-03-22 16:53:58.038192419 +0000
|
||||
@@ -265,10 +265,13 @@ Symbol_table::resolve(Sized_symbol<size>
|
||||
return;
|
||||
|
||||
// Likewise for an absolute symbol defined twice with the same value.
|
||||
+ // Plugin-symbols are always absolute with same value here, so ignore those.
|
||||
if (!is_ordinary
|
||||
&& st_shndx == elfcpp::SHN_ABS
|
||||
&& !to_is_ordinary
|
||||
&& to_shndx == elfcpp::SHN_ABS
|
||||
+ && object->pluginobj() == NULL
|
||||
+ && to->object()->pluginobj() == NULL
|
||||
&& to->value() == sym.get_st_value())
|
||||
return;
|
||||
|
@ -17,20 +17,3 @@ diff -rup binutils.orig/gold/layout.cc binutils-2.32/gold/layout.cc
|
||||
}
|
||||
|
||||
if (os == NULL)
|
||||
diff -rup binutils.orig/gold/object.cc binutils-2.32/gold/object.cc
|
||||
--- binutils.orig/gold/object.cc 2019-06-24 14:37:36.012086906 +0100
|
||||
+++ binutils-2.32/gold/object.cc 2019-06-24 14:39:59.287165501 +0100
|
||||
@@ -1644,6 +1644,13 @@ Sized_relobj_file<size, big_endian>::do_
|
||||
omit[i] = true;
|
||||
}
|
||||
|
||||
+ // Skip empty sections without flags.
|
||||
+ if (!(shdr.get_sh_flags() & ~elfcpp::SHF_GROUP)
|
||||
+ && !shdr.get_sh_size())
|
||||
+ {
|
||||
+ omit[i] = true;
|
||||
+ }
|
||||
+
|
||||
bool discard = omit[i];
|
||||
if (!discard)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
66
SOURCES/binutils-gold-warn-unsupported.patch
Normal file
66
SOURCES/binutils-gold-warn-unsupported.patch
Normal file
@ -0,0 +1,66 @@
|
||||
Only in binutils-2.34/gold: autom4te.cache
|
||||
diff -rup binutils.orig/gold/configure binutils-2.34/gold/configure
|
||||
--- binutils.orig/gold/configure 2020-04-20 12:35:13.048297305 +0100
|
||||
+++ binutils-2.34/gold/configure 2020-04-20 14:02:06.743725696 +0100
|
||||
@@ -5180,7 +5180,8 @@ for targ in $target $canon_targets; do
|
||||
. ${srcdir}/configure.tgt
|
||||
|
||||
if test "$targ_obj" = "UNKNOWN"; then
|
||||
- as_fn_error $? "\"unsupported target $targ\"" "$LINENO" 5
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"unsupported target $targ\"" >&5
|
||||
+$as_echo "$as_me: WARNING: \"unsupported target $targ\"" >&2;}
|
||||
else
|
||||
targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
|
||||
if test "$targ_extra_obj" != ""; then
|
||||
diff -rup binutils.orig/gold/configure.ac binutils-2.34/gold/configure.ac
|
||||
--- binutils.orig/gold/configure.ac 2020-04-20 12:35:13.050297291 +0100
|
||||
+++ binutils-2.34/gold/configure.ac 2020-04-20 14:01:46.435868770 +0100
|
||||
@@ -181,7 +181,7 @@ for targ in $target $canon_targets; do
|
||||
. ${srcdir}/configure.tgt
|
||||
|
||||
if test "$targ_obj" = "UNKNOWN"; then
|
||||
- AC_MSG_ERROR("unsupported target $targ")
|
||||
+ AC_MSG_WARN("unsupported target $targ")
|
||||
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
|
||||
;;
|
||||
|
||||
#ifdef BFD64
|
||||
- bpf-*-none)
|
||||
+ bpf-*-none | bpf-*)
|
||||
targ_defvec=bpf_elf64_le_vec
|
||||
targ_selvecs=bpf_elf64_be_vec
|
||||
targ_underscore=yes
|
||||
@@ -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
|
||||
;;
|
@ -1,296 +0,0 @@
|
||||
diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.30/bfd/elf32-i386.c
|
||||
--- binutils.orig/bfd/elf32-i386.c 2018-03-09 14:43:05.324208873 +0000
|
||||
+++ binutils-2.30/bfd/elf32-i386.c 2018-03-09 14:43:23.158000456 +0000
|
||||
@@ -2202,12 +2202,19 @@ elf_i386_relocate_section (bfd *output_b
|
||||
|
||||
if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
{
|
||||
+ /* If this is a SHT_NOTE section without SHF_ALLOC, treat
|
||||
+ STT_GNU_IFUNC symbol as STT_FUNC. */
|
||||
+ if (elf_section_type (input_section) == SHT_NOTE)
|
||||
+ goto skip_ifunc;
|
||||
/* Dynamic relocs are not propagated for SEC_DEBUGGING
|
||||
sections because such sections are not SEC_ALLOC and
|
||||
thus ld.so will not process them. */
|
||||
if ((input_section->flags & SEC_DEBUGGING) != 0)
|
||||
continue;
|
||||
- abort ();
|
||||
+ _bfd_error_handler (_("%B: error: relocation againt ifunc symbol in non-alloc section %A"),
|
||||
+ input_bfd, input_section);
|
||||
+ bfd_set_error (bfd_error_invalid_operation);
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
/* STT_GNU_IFUNC symbol must go through PLT. */
|
||||
@@ -2421,6 +2428,7 @@ do_ifunc_pointer:
|
||||
}
|
||||
}
|
||||
|
||||
+ skip_ifunc:
|
||||
resolved_to_zero = (eh != NULL
|
||||
&& UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh));
|
||||
|
||||
diff -rup binutils.orig/bfd/elf32-s390.c binutils-2.30/bfd/elf32-s390.c
|
||||
--- binutils.orig/bfd/elf32-s390.c 2018-03-09 14:43:05.325208861 +0000
|
||||
+++ binutils-2.30/bfd/elf32-s390.c 2018-03-09 14:43:31.353904647 +0000
|
||||
@@ -2601,6 +2601,9 @@ elf_s390_relocate_section (bfd *output_b
|
||||
case R_390_8:
|
||||
case R_390_16:
|
||||
case R_390_32:
|
||||
+ if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
+ break;
|
||||
+
|
||||
if (h != NULL
|
||||
&& s390_is_ifunc_symbol_p (h)
|
||||
&& h->def_regular)
|
||||
@@ -2662,9 +2665,6 @@ elf_s390_relocate_section (bfd *output_b
|
||||
}
|
||||
}
|
||||
|
||||
- if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
- break;
|
||||
-
|
||||
if ((bfd_link_pic (info)
|
||||
&& (h == NULL
|
||||
|| (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
Only in binutils-2.30/bfd: elf32-s390.c.orig
|
||||
diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.30/bfd/elf64-s390.c
|
||||
--- binutils.orig/bfd/elf64-s390.c 2018-03-09 14:43:05.341208674 +0000
|
||||
+++ binutils-2.30/bfd/elf64-s390.c 2018-03-09 14:43:31.354904635 +0000
|
||||
@@ -2559,6 +2559,9 @@ elf_s390_relocate_section (bfd *output_b
|
||||
case R_390_32:
|
||||
case R_390_64:
|
||||
|
||||
+ if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
+ break;
|
||||
+
|
||||
if (h != NULL
|
||||
&& s390_is_ifunc_symbol_p (h)
|
||||
&& h->def_regular)
|
||||
@@ -2621,9 +2624,6 @@ elf_s390_relocate_section (bfd *output_b
|
||||
}
|
||||
}
|
||||
|
||||
- if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
- break;
|
||||
-
|
||||
if ((bfd_link_pic (info)
|
||||
&& (h == NULL
|
||||
|| (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
Only in binutils-2.30/bfd: elf64-s390.c.orig
|
||||
diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.30/bfd/elf64-x86-64.c
|
||||
--- binutils.orig/bfd/elf64-x86-64.c 2018-03-09 14:43:05.344208639 +0000
|
||||
+++ binutils-2.30/bfd/elf64-x86-64.c 2018-03-09 14:43:23.161000420 +0000
|
||||
@@ -2499,12 +2499,19 @@ elf_x86_64_relocate_section (bfd *output
|
||||
|
||||
if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
{
|
||||
+ /* If this is a SHT_NOTE section without SHF_ALLOC, treat
|
||||
+ STT_GNU_IFUNC symbol as STT_FUNC. */
|
||||
+ if (elf_section_type (input_section) == SHT_NOTE)
|
||||
+ goto skip_ifunc;
|
||||
/* Dynamic relocs are not propagated for SEC_DEBUGGING
|
||||
sections because such sections are not SEC_ALLOC and
|
||||
thus ld.so will not process them. */
|
||||
if ((input_section->flags & SEC_DEBUGGING) != 0)
|
||||
continue;
|
||||
- abort ();
|
||||
+ _bfd_error_handler (_("%B: error: relocation againt ifunc symbol in non-alloc section %A"),
|
||||
+ input_bfd, input_section);
|
||||
+ bfd_set_error (bfd_error_invalid_operation);
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
switch (r_type)
|
||||
@@ -2722,6 +2729,7 @@ do_ifunc_pointer:
|
||||
}
|
||||
}
|
||||
|
||||
+ skip_ifunc:
|
||||
resolved_to_zero = (eh != NULL
|
||||
&& UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh));
|
||||
|
||||
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.30/bfd/elfnn-aarch64.c
|
||||
--- binutils.orig/bfd/elfnn-aarch64.c 2018-03-09 14:43:05.337208721 +0000
|
||||
+++ binutils-2.30/bfd/elfnn-aarch64.c 2018-03-09 14:43:31.355904624 +0000
|
||||
@@ -4987,6 +4987,11 @@ elfNN_aarch64_final_link_relocate (reloc
|
||||
|
||||
if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
{
|
||||
+ /* If this is a SHT_NOTE section without SHF_ALLOC, treat
|
||||
+ STT_GNU_IFUNC symbol as STT_FUNC. */
|
||||
+ if (elf_section_type (input_section) == SHT_NOTE)
|
||||
+ goto skip_ifunc;
|
||||
+
|
||||
/* Dynamic relocs are not propagated for SEC_DEBUGGING
|
||||
sections because such sections are not SEC_ALLOC and
|
||||
thus ld.so will not process them. */
|
||||
@@ -5180,6 +5185,7 @@ bad_ifunc_reloc:
|
||||
}
|
||||
}
|
||||
|
||||
+ skip_ifunc:
|
||||
resolved_to_zero = (h != NULL
|
||||
&& UNDEFWEAK_NO_DYNAMIC_RELOC (info, h));
|
||||
|
||||
Only in binutils-2.30/bfd: elfnn-aarch64.c.orig
|
||||
diff -rup binutils.orig/bfd/elfxx-sparc.c binutils-2.30/bfd/elfxx-sparc.c
|
||||
--- binutils.orig/bfd/elfxx-sparc.c 2018-03-09 14:43:05.333208768 +0000
|
||||
+++ binutils-2.30/bfd/elfxx-sparc.c 2018-03-09 14:43:31.355904624 +0000
|
||||
@@ -3026,7 +3026,13 @@ _bfd_sparc_elf_relocate_section (bfd *ou
|
||||
|
||||
if ((input_section->flags & SEC_ALLOC) == 0
|
||||
|| h->plt.offset == (bfd_vma) -1)
|
||||
- abort ();
|
||||
+ {
|
||||
+ /* If this is a SHT_NOTE section without SHF_ALLOC, treat
|
||||
+ STT_GNU_IFUNC symbol as STT_FUNC. */
|
||||
+ if (elf_section_type (input_section) == SHT_NOTE)
|
||||
+ goto skip_ifunc;
|
||||
+ abort ();
|
||||
+ }
|
||||
|
||||
plt_sec = htab->elf.splt;
|
||||
if (! plt_sec)
|
||||
@@ -3130,6 +3136,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
|
||||
}
|
||||
}
|
||||
|
||||
+ skip_ifunc:
|
||||
eh = (struct _bfd_sparc_elf_link_hash_entry *) h;
|
||||
resolved_to_zero = (eh != NULL
|
||||
&& UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh));
|
||||
Only in binutils-2.30/bfd: elfxx-sparc.c.orig
|
||||
diff -rup binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp binutils-2.30/ld/testsuite/ld-ifunc/ifunc.exp
|
||||
--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2018-03-09 14:43:04.844214486 +0000
|
||||
+++ binutils-2.30/ld/testsuite/ld-ifunc/ifunc.exp 2018-03-09 14:43:31.355904624 +0000
|
||||
@@ -47,6 +47,9 @@ if ![check_shared_lib_support] {
|
||||
return
|
||||
}
|
||||
|
||||
+# This test does not need a compiler...
|
||||
+run_dump_test "ifuncmod5"
|
||||
+
|
||||
# We need a working compiler. (Strictly speaking this is
|
||||
# not true, we could use target specific assembler files).
|
||||
if { [which $CC] == 0 } {
|
||||
Only in binutils-2.30: testsuite
|
||||
--- /dev/null 2018-03-09 07:59:09.608015200 +0000
|
||||
+++ binutils-2.30/ld/testsuite/ld-ifunc/ifuncmod5.s 2018-03-09 14:45:45.698334500 +0000
|
||||
@@ -0,0 +1,105 @@
|
||||
+ .file "ifuncmod5.c"
|
||||
+
|
||||
+ .text
|
||||
+ .type ifuncmod5.c, STT_NOTYPE
|
||||
+ifuncmod5.c:
|
||||
+ .size ifuncmod5.c, 0
|
||||
+
|
||||
+ .pushsection .gnu.build.attributes, "", %note
|
||||
+ .balign 4
|
||||
+ .dc.l 8
|
||||
+ .dc.l 16
|
||||
+ .dc.l 0x100
|
||||
+ .asciz "GA$3p4"
|
||||
+ .dc.a ifuncmod5.c
|
||||
+ .dc.a ifuncmod5.c_end
|
||||
+ .popsection
|
||||
+
|
||||
+.Ltext0:
|
||||
+#APP
|
||||
+ .protected global
|
||||
+ .type foo, %gnu_indirect_function
|
||||
+ .type foo_hidden, %gnu_indirect_function
|
||||
+ .type foo_protected, %gnu_indirect_function
|
||||
+ .hidden foo_hidden
|
||||
+ .protected foo_protected
|
||||
+#NO_APP
|
||||
+ .align 8
|
||||
+ .type one, %function
|
||||
+one:
|
||||
+ .dc.l 0
|
||||
+ .size one, .-one
|
||||
+ .align 8
|
||||
+
|
||||
+.globl foo
|
||||
+ .type foo, %function
|
||||
+foo:
|
||||
+ .dc.l 0
|
||||
+ .size foo, .-foo
|
||||
+
|
||||
+ .pushsection .gnu.build.attributes
|
||||
+ .dc.l 6
|
||||
+ .dc.l 16
|
||||
+ .dc.l 0x101
|
||||
+ .dc.b 0x47, 0x41, 0x2a, 0x2, 0, 0
|
||||
+ .dc.b 0, 0
|
||||
+ .dc.a foo
|
||||
+ .dc.a foo_end
|
||||
+ .popsection
|
||||
+
|
||||
+foo_end:
|
||||
+ .align 8
|
||||
+.globl foo_hidden
|
||||
+ .type foo_hidden, %function
|
||||
+foo_hidden:
|
||||
+ .dc.l 0
|
||||
+ .size foo_hidden, .-foo_hidden
|
||||
+
|
||||
+ .pushsection .gnu.build.attributes
|
||||
+ .dc.l 6
|
||||
+ .dc.l 16
|
||||
+ .dc.l 0x101
|
||||
+ .dc.b 0x47, 0x41, 0x2a, 0x2, 0, 0
|
||||
+ .dc.b 0, 0
|
||||
+ .dc.a foo_hidden
|
||||
+ .dc.a foo_hidden_end
|
||||
+ .popsection
|
||||
+
|
||||
+foo_hidden_end:
|
||||
+ .align 8
|
||||
+
|
||||
+ .globl foo_protected
|
||||
+ .type foo_protected, %function
|
||||
+foo_protected:
|
||||
+ .dc.l 0
|
||||
+
|
||||
+ .size foo_protected, .-foo_protected
|
||||
+
|
||||
+ .pushsection .gnu.build.attributes
|
||||
+ .dc.l 6
|
||||
+ .dc.l 16
|
||||
+ .dc.l 0x101
|
||||
+ .dc.b 0x47, 0x41, 0x2a, 0x2, 0, 0
|
||||
+ .dc.b 0, 0
|
||||
+ .dc.a foo_protected
|
||||
+ .dc.a foo_protected_end
|
||||
+ .popsection
|
||||
+
|
||||
+foo_protected_end:
|
||||
+ .globl global
|
||||
+
|
||||
+ .data
|
||||
+ .align 4
|
||||
+ .type global, %object
|
||||
+ .size global, 4
|
||||
+global:
|
||||
+ .long -1
|
||||
+
|
||||
+ .text
|
||||
+ .Letext0:
|
||||
+
|
||||
+ifuncmod5.c_end:
|
||||
+ .type ifuncmod5.c_end, STT_NOTYPE
|
||||
+ .size ifuncmod5.c_end, 0
|
||||
+
|
||||
+
|
||||
--- /dev/null 2018-03-09 07:59:09.608015200 +0000
|
||||
+++ binutils-2.30/ld/testsuite/ld-ifunc/ifuncmod5.d 2018-03-09 14:45:45.698334500 +0000
|
||||
@@ -0,0 +1,8 @@
|
||||
+# name: Reloc against IFUNC symbol in NOTE section
|
||||
+# ld: -shared
|
||||
+# nm: -p
|
||||
+
|
||||
+# We do not actually care about the notes at the moment.
|
||||
+# The purpose of this test is to make sure that the link completes successfully.
|
||||
+#pass
|
||||
+
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user