Compare commits
232 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e050ee6d4 | ||
|
|
10671c0eca | ||
|
|
e0ff142016 | ||
|
|
064736651b | ||
|
|
9f66e09750 | ||
|
|
40bef170ce | ||
|
|
d4dfa51cea | ||
|
|
29b46b6079 | ||
|
|
f40a1175b9 | ||
|
|
ddb3cb864e | ||
|
|
5119f9a9cd | ||
|
|
9600c63b36 | ||
|
|
23b67e31b8 | ||
|
|
f9af6f1a80 | ||
|
|
c5ce1de980 | ||
|
|
29eedae455 | ||
|
|
c546fe6976 | ||
|
|
0608389263 | ||
|
|
f294ebe3ba | ||
|
|
5b0464e961 | ||
|
|
76d42a7875 | ||
|
|
33e6445241 | ||
|
|
108ab4ef7a | ||
|
|
aa57e62e08 | ||
|
|
cc43b90ffc | ||
|
|
a53f464f7d | ||
|
|
60fb2164e5 | ||
|
|
2c4833fe8a | ||
|
|
c228a0153a | ||
|
|
27063804ce | ||
|
|
4c1598168d | ||
|
|
4483836ddc | ||
|
|
848e40ec3a | ||
|
|
735a883933 | ||
|
|
64b8d9de61 | ||
|
|
d7078a903f | ||
|
|
f862eebcff | ||
|
|
04aad048cf | ||
|
|
300293f7e2 | ||
|
|
9e81b24737 | ||
|
|
2ac1ee2a42 | ||
|
|
19f1fc4940 | ||
|
|
f9a1cd84ee | ||
|
|
9de042a279 | ||
|
|
96aece08c1 | ||
|
|
f6c1766b84 | ||
|
|
ca67fa0f89 | ||
|
|
1e5363880e | ||
|
|
aa65e68b95 | ||
|
|
b2a44377f7 | ||
|
|
a4377df024 | ||
|
|
049dc08ca1 | ||
|
|
3c2b6fab82 | ||
|
|
cf3468eb37 | ||
|
|
2b97979d33 | ||
|
|
b52b1c824b | ||
|
|
77d3ccc230 | ||
|
|
001f1473de | ||
|
|
b84449875a | ||
|
|
791874dbf7 | ||
|
|
5c8f89372f | ||
|
|
c1e2857084 | ||
|
|
0f77e6a6c6 | ||
|
|
6152e0d05c | ||
|
|
88532ad57e | ||
|
|
dbb6a2b533 | ||
|
|
01507c9252 | ||
|
|
8748d12378 | ||
|
|
fa3058d5fc | ||
|
|
7888285b10 | ||
|
|
eaff7615a3 | ||
|
|
c6ac23d8f1 | ||
|
|
a9bd5526fa | ||
|
|
384e850d5a | ||
|
|
115547ce07 | ||
|
|
84cee8e828 | ||
|
|
7f4b0bfa04 | ||
|
|
6be32c794e | ||
|
|
87ee448377 | ||
|
|
53dfb5f3d9 | ||
|
|
9c83775c81 | ||
|
|
c4f15b9679 | ||
|
|
6cb8c76a06 | ||
|
|
875ad5b267 | ||
|
|
00b3ac3d67 | ||
|
|
3f77f370f1 | ||
|
|
4fe99c972e | ||
|
|
5d93718856 | ||
|
|
6811ff96a8 | ||
|
|
3e7c1aeff4 | ||
|
|
50a2d13658 | ||
|
|
cc723c198d | ||
|
|
6936dfba5d | ||
|
|
a8edbcb255 | ||
|
|
a9dd5ddc2c | ||
|
|
8e380e50cb | ||
|
|
c0b354c6e6 | ||
|
|
83a75f8fd1 | ||
|
|
fddf5b0c9a | ||
|
|
9242ef0c66 | ||
|
|
9ec20adf80 | ||
|
|
b534deccce | ||
|
|
17373e3782 | ||
|
|
ce64e3b14f | ||
|
|
daff9b01dd | ||
|
|
c697a444a9 | ||
|
|
36cbd09894 | ||
|
|
6043ce66a1 | ||
|
|
27b8ab3195 | ||
|
|
45b6743b78 | ||
|
|
c0e2cc5ed5 | ||
|
|
2175d42ba1 | ||
|
|
42d71d98c8 | ||
|
|
f78741193c | ||
|
|
5d27552da0 | ||
|
|
92824e7d56 | ||
|
|
221d87cb73 | ||
|
|
a363b071f4 | ||
|
|
928e5ff57a | ||
|
|
b769a968b8 | ||
|
|
27dc20eed1 | ||
|
|
d488a923af | ||
|
|
668448a4d3 | ||
|
|
869fd132e6 | ||
|
|
7db94aa6ea | ||
|
|
90d6ac6eba | ||
|
|
aafdbcfc2e | ||
|
|
f5eacb8b02 | ||
|
|
d43bbe0fb5 | ||
|
|
daafbde83e | ||
|
|
c1cad428e0 | ||
|
|
a5425af175 | ||
|
|
5132280190 | ||
|
|
f7f7b9f944 | ||
|
|
b606cdd338 | ||
|
|
4c25ffdf16 | ||
|
|
508b3ee556 | ||
|
|
7206b7ef95 | ||
|
|
137e54debb | ||
|
|
6ab5c9d778 | ||
|
|
4a2b1583b0 | ||
|
|
b30ba09c72 | ||
| 9331510b79 | |||
|
|
f7ce37e465 | ||
|
|
173d8ce283 | ||
|
|
62f9165a13 | ||
|
|
8f1ba5b061 | ||
|
|
05f5ab6f6f | ||
|
|
3b7f3a5c52 | ||
|
|
4196d43202 | ||
|
|
e6b3d1627a | ||
|
|
28255cde1d | ||
|
|
1d05c1f190 | ||
|
|
00415f44d2 | ||
|
|
8cbdd69541 | ||
|
|
b14c746ff8 | ||
|
|
1fe93dadad | ||
|
|
c3cd6c8351 | ||
|
|
de97bb3603 | ||
|
|
329cf6426e | ||
|
|
e8094f532e | ||
|
|
c2d4243912 | ||
|
|
d294fe2ca4 | ||
|
|
88b4953e8b | ||
|
|
13a8e71fad | ||
|
|
a74941f97f | ||
|
|
53e1e785a0 | ||
|
|
ccf531f53d | ||
|
|
fcb20d506b | ||
|
|
78d9a63f8b | ||
|
|
ec1bac1bd2 | ||
|
|
0b1c8753b9 | ||
|
|
b6cd5a80bd | ||
|
|
262733044e | ||
|
|
49f3d832d9 | ||
|
|
4c53cd0d87 | ||
|
|
93b20dcdbf | ||
|
|
41f66d24b8 | ||
|
|
b2ca1be519 | ||
|
|
184c1812b1 | ||
|
|
d0a86e89e0 | ||
|
|
9fe14c4dd6 | ||
|
|
fb35f3c111 | ||
|
|
52ad8b6547 | ||
|
|
f751bb5ce4 | ||
|
|
6502fbec15 | ||
|
|
b094a17b03 | ||
|
|
66740f7362 | ||
|
|
d8e1d9b57a | ||
|
|
6bfd06790b | ||
|
|
3ac2843cab | ||
|
|
66f76524de | ||
|
|
6765525905 | ||
|
|
7ef644fbf6 | ||
|
|
14fb249724 | ||
|
|
78fe7f4703 | ||
|
|
e27610f6a7 | ||
|
|
dd133b6b81 | ||
|
|
92265683bf | ||
|
|
4a4bd90398 | ||
|
|
44cef29673 | ||
|
|
1fb1ae3dd6 | ||
|
|
9ee9ffc894 | ||
|
|
0859b9f54c | ||
|
|
17f6d21f57 | ||
|
|
544bea2339 | ||
|
|
fa2df7c5e7 | ||
|
|
1b1ba83846 | ||
|
|
fc45567d6a | ||
|
|
3b3292ed1e | ||
|
|
fa5c6f55b2 | ||
|
|
4c13eef881 | ||
|
|
7fccd0d7e7 | ||
|
|
2d6725c1a9 | ||
|
|
fae26da53a | ||
|
|
15c0289a28 | ||
|
|
97c0e8e507 | ||
|
|
2749aba2e5 | ||
|
|
107db84d77 | ||
|
|
b223b873be | ||
|
|
f02d283cbb | ||
|
|
9c952780c9 | ||
|
|
c0d31e974b | ||
|
|
467b87538d | ||
|
|
6bd3a0b7c2 | ||
|
|
4a7c8e040b | ||
|
|
c074b4afae | ||
|
|
d685480361 | ||
|
|
b04b2360b7 | ||
|
|
10575a5d52 | ||
|
|
ea9a413173 | ||
|
|
24c5f0f956 |
246 changed files with 3469 additions and 45124 deletions
11
.gitignore
vendored
11
.gitignore
vendored
|
|
@ -1,6 +1,8 @@
|
|||
*.diff
|
||||
*.orig
|
||||
*.rej
|
||||
*.sed
|
||||
*.xz
|
||||
|
||||
*~
|
||||
.#*
|
||||
|
|
@ -61,9 +63,8 @@ stamp-*
|
|||
/mpc*
|
||||
/gmp*
|
||||
/isl*
|
||||
/binutils-2.34.0-5dfc0c955dbe912cd328fc2688e5fceb3239ac2a.tar.xz
|
||||
/binutils-2.19.50.0.1-output-format.sed
|
||||
/binutils-2.35.tar.xz
|
||||
/binutils-2.35.1.tar.xz
|
||||
/binutils-2.36.1.tar.xz
|
||||
/binutils-2.37.tar.xz
|
||||
/binutils-2.44.50-13.fc43.src.rpm
|
||||
/binutils-with-gold-2.45.50-be970c68891.tar.gz
|
||||
/binutils-with-gold-2.45.50-ba5838a98fb.tar.gz
|
||||
/binutils-2.47.50-1.fc46.src.rpm
|
||||
|
|
|
|||
|
|
@ -1,944 +0,0 @@
|
|||
diff -rup binutils.orig/bfd/.gitignore binutils-2.37/bfd/.gitignore
|
||||
--- binutils.orig/bfd/.gitignore 2021-12-01 13:35:33.826078119 +0000
|
||||
+++ binutils-2.37/bfd/.gitignore 2021-12-01 13:35:43.138988270 +0000
|
||||
@@ -10,6 +10,7 @@
|
||||
/peigen.c
|
||||
/pepigen.c
|
||||
/pex64igen.c
|
||||
+/pe-aarch64igen.c
|
||||
/stmp-bfd-h
|
||||
/targmatch.h
|
||||
|
||||
diff -rup binutils.orig/bfd/Makefile.am binutils-2.37/bfd/Makefile.am
|
||||
--- binutils.orig/bfd/Makefile.am 2021-12-01 13:35:33.817078206 +0000
|
||||
+++ binutils-2.37/bfd/Makefile.am 2021-12-01 13:35:43.139988261 +0000
|
||||
@@ -567,7 +567,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 \
|
||||
@@ -607,6 +609,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
|
||||
@@ -666,7 +669,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)
|
||||
|
||||
@@ -862,6 +865,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
|
||||
$(BFD32_LIBS) \
|
||||
diff -rup binutils.orig/bfd/Makefile.in binutils-2.37/bfd/Makefile.in
|
||||
--- binutils.orig/bfd/Makefile.in 2021-12-01 13:35:33.823078148 +0000
|
||||
+++ binutils-2.37/bfd/Makefile.in 2021-12-01 13:35:43.139988261 +0000
|
||||
@@ -994,7 +994,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 \
|
||||
@@ -1034,6 +1036,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
|
||||
@@ -1092,7 +1095,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 = \
|
||||
@@ -1551,9 +1554,11 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pei-mcore.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@
|
||||
@@ -1991,6 +1996,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.37/bfd/bfd.c
|
||||
--- binutils.orig/bfd/bfd.c 2021-12-01 13:35:33.821078167 +0000
|
||||
+++ binutils-2.37/bfd/bfd.c 2021-12-01 13:35:43.139988261 +0000
|
||||
@@ -1735,6 +1735,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
|
||||
Only in binutils-2.37/bfd: coff-aarch64.c
|
||||
diff -rup binutils.orig/bfd/coffcode.h binutils-2.37/bfd/coffcode.h
|
||||
--- binutils.orig/bfd/coffcode.h 2021-12-01 13:35:33.822078158 +0000
|
||||
+++ binutils-2.37/bfd/coffcode.h 2021-12-01 13:35:43.140988251 +0000
|
||||
@@ -2215,6 +2215,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;
|
||||
@@ -2771,6 +2777,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
|
||||
@@ -3866,7 +3878,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
|
||||
@@ -3914,6 +3926,11 @@ coff_write_object_contents (bfd * abfd)
|
||||
#define __A_MAGIC_SET__
|
||||
internal_a.magic = ZMAGIC;
|
||||
#endif
|
||||
+
|
||||
+#if defined(AARCH64)
|
||||
+#define __A_MAGIC_SET__
|
||||
+ internal_a.magic = ZMAGIC;
|
||||
+#endif
|
||||
|
||||
#if defined MCORE_PE
|
||||
#define __A_MAGIC_SET__
|
||||
diff -rup binutils.orig/bfd/config.bfd binutils-2.37/bfd/config.bfd
|
||||
--- binutils.orig/bfd/config.bfd 2021-12-01 13:35:33.833078051 +0000
|
||||
+++ binutils-2.37/bfd/config.bfd 2021-12-01 13:35:43.140988251 +0000
|
||||
@@ -232,7 +232,7 @@ case "${targ}" in
|
||||
;;
|
||||
aarch64-*-elf | aarch64-*-rtems* | aarch64-*-genode*)
|
||||
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-*-elf)
|
||||
@@ -257,7 +257,7 @@ case "${targ}" in
|
||||
;;
|
||||
aarch64-*-linux* | aarch64-*-netbsd*)
|
||||
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* | aarch64_be-*-netbsd*)
|
||||
diff -rup binutils.orig/bfd/configure binutils-2.37/bfd/configure
|
||||
--- binutils.orig/bfd/configure 2021-12-01 13:35:33.817078206 +0000
|
||||
+++ binutils-2.37/bfd/configure 2021-12-01 13:35:43.141988241 +0000
|
||||
@@ -13283,6 +13283,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.37/bfd/configure.ac
|
||||
--- binutils.orig/bfd/configure.ac 2021-12-01 13:35:33.829078090 +0000
|
||||
+++ binutils-2.37/bfd/configure.ac 2021-12-01 13:35:43.141988241 +0000
|
||||
@@ -439,6 +439,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.37/bfd/libpei.h
|
||||
--- binutils.orig/bfd/libpei.h 2021-12-01 13:35:33.830078081 +0000
|
||||
+++ binutils-2.37/bfd/libpei.h 2021-12-01 13:35:43.141988241 +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
|
||||
@@ -369,5 +404,6 @@ bool _bfd_XX_bfd_copy_private_section_da
|
||||
bool _bfd_pe_print_ce_compressed_pdata (bfd *, void *);
|
||||
bool _bfd_pe64_print_ce_compressed_pdata (bfd *, void *);
|
||||
bool _bfd_pex64_print_ce_compressed_pdata (bfd *, void *);
|
||||
+bool _bfd_peAArch64_print_ce_compressed_pdata (bfd *, void *);
|
||||
bool _bfd_pep_print_ce_compressed_pdata (bfd *, void *);
|
||||
|
||||
diff -rup binutils.orig/bfd/peXXigen.c binutils-2.37/bfd/peXXigen.c
|
||||
--- binutils.orig/bfd/peXXigen.c 2021-12-01 13:35:33.827078110 +0000
|
||||
+++ binutils-2.37/bfd/peXXigen.c 2021-12-01 13:35:43.142988232 +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"
|
||||
@@ -83,6 +84,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
|
||||
@@ -92,7 +95,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
|
||||
@@ -469,7 +472,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);
|
||||
@@ -555,7 +558,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
|
||||
}
|
||||
@@ -563,12 +566,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)
|
||||
{
|
||||
@@ -628,7 +631,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
|
||||
}
|
||||
@@ -636,7 +639,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
|
||||
}
|
||||
@@ -644,7 +647,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
|
||||
}
|
||||
@@ -748,7 +751,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);
|
||||
@@ -1800,7 +1803,7 @@ pe_print_edata (bfd * abfd, void * vfile
|
||||
static bool
|
||||
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)
|
||||
@@ -1827,7 +1830,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
|
||||
@@ -1864,7 +1867,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
|
||||
|
||||
@@ -1882,7 +1885,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;
|
||||
@@ -1893,7 +1896,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);
|
||||
@@ -2784,7 +2787,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);
|
||||
@@ -3085,7 +3088,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)
|
||||
{
|
||||
@@ -4504,7 +4507,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;
|
||||
@@ -4513,7 +4516,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.37/bfd: pei-aarch64.c
|
||||
diff -rup binutils.orig/bfd/peicode.h binutils-2.37/bfd/peicode.h
|
||||
--- binutils.orig/bfd/peicode.h 2021-12-01 13:35:33.829078090 +0000
|
||||
+++ binutils-2.37/bfd/peicode.h 2021-12-01 13:35:43.142988232 +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 const 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.37/bfd/targets.c
|
||||
--- binutils.orig/bfd/targets.c 2021-12-01 13:35:33.829078090 +0000
|
||||
+++ binutils-2.37/bfd/targets.c 2021-12-01 13:35:43.142988232 +0000
|
||||
@@ -679,6 +679,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;
|
||||
@@ -991,6 +992,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.37/binutils/NEWS
|
||||
--- binutils.orig/binutils/NEWS 2021-12-01 13:35:33.320083001 +0000
|
||||
+++ binutils-2.37/binutils/NEWS 2021-12-01 13:35:43.142988232 +0000
|
||||
@@ -9,6 +9,9 @@
|
||||
using --unicode=highlight will display them as unicode escape sequences
|
||||
highlighted in red (if supported by the output device).
|
||||
|
||||
+* 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.37:
|
||||
|
||||
* The readelf tool has a new command line option which can be used to specify
|
||||
Only in binutils.orig/binutils: NEWS.orig
|
||||
Only in binutils.orig/binutils: NEWS.rej
|
||||
Only in binutils.orig/binutils: nm.c.orig
|
||||
diff -rup binutils.orig/binutils/objcopy.c binutils-2.37/binutils/objcopy.c
|
||||
--- binutils.orig/binutils/objcopy.c 2021-12-01 13:35:33.302083174 +0000
|
||||
+++ binutils-2.37/binutils/objcopy.c 2021-12-01 13:35:43.143988222 +0000
|
||||
@@ -4987,6 +4987,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
|
||||
Only in binutils.orig/binutils: objdump.c.orig
|
||||
Only in binutils.orig/binutils: objdump.c.rej
|
||||
Only in binutils.orig/binutils: readelf.c.orig
|
||||
Only in binutils-2.37/binutils/testsuite/binutils-all/aarch64: pei-aarch64-little.d
|
||||
Only in binutils-2.37/binutils/testsuite/binutils-all/aarch64: pei-aarch64-little.s
|
||||
Only in binutils-2.37/include/coff: aarch64.h
|
||||
diff -rup binutils.orig/include/coff/pe.h binutils-2.37/include/coff/pe.h
|
||||
--- binutils.orig/include/coff/pe.h 2021-12-01 13:35:33.251083666 +0000
|
||||
+++ binutils-2.37/include/coff/pe.h 2021-12-01 13:35:43.143988222 +0000
|
||||
@@ -137,6 +137,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-12-01 09:13:46.241760896 +0000
|
||||
+++ binutils-2.37/include/coff/aarch64.h 2021-12-01 13:35:43.143988222 +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-12-01 09:13:46.241760896 +0000
|
||||
+++ binutils-2.37/bfd/coff-aarch64.c 2021-12-01 13:35:43.139988261 +0000
|
||||
@@ -0,0 +1,166 @@
|
||||
+/* 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 bool
|
||||
+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. */
|
||||
+ TARGET_KEEP_UNUSED_SECTION_SYMBOLS, /* keep unused section symbols. */
|
||||
+
|
||||
+ /* 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-12-01 09:13:46.241760896 +0000
|
||||
+++ binutils-2.37/binutils/testsuite/binutils-all/aarch64/pei-aarch64-little.s 2021-12-01 13:35:43.143988222 +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-12-01 09:13:46.241760896 +0000
|
||||
+++ binutils-2.37/binutils/testsuite/binutils-all/aarch64/pei-aarch64-little.d 2021-12-01 13:35:43.143988222 +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"
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
--- binutils.orig/gold/fileread.cc 2019-08-06 14:22:08.669313110 +0100
|
||||
+++ binutils-2.32/gold/fileread.cc 2019-08-06 14:22:28.799177543 +0100
|
||||
@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_
|
||||
ssize_t bytes;
|
||||
if (this->whole_file_view_ != NULL)
|
||||
{
|
||||
+ // See PR 23765 for an example of a testcase that triggers this error.
|
||||
+ if (((ssize_t) start) < 0)
|
||||
+ gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
|
||||
+ this->filename().c_str(),
|
||||
+ static_cast<long long>(start));
|
||||
+
|
||||
bytes = this->size_ - start;
|
||||
if (static_cast<section_size_type>(bytes) >= size)
|
||||
{
|
||||
|
|
@ -1,230 +0,0 @@
|
|||
--- binutils.orig/binutils/stabs.c 2021-12-20 12:51:40.953113439 +0000
|
||||
+++ binutils-2.37/binutils/stabs.c 2021-12-20 12:56:07.607348945 +0000
|
||||
@@ -202,7 +202,7 @@ static debug_type stab_find_type (void *
|
||||
static bool 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
|
||||
@@ -3496,166 +3496,167 @@ 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];
|
||||
+ if (info->xcoff_types[typenum] != NULL)
|
||||
+ return info->xcoff_types[typenum];
|
||||
|
||||
- switch (-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;
|
||||
@@ -3664,9 +3665,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;
|
||||
}
|
||||
|
||||
154
binutils-LTO-restore-wrapper-symbol.patch
Normal file
154
binutils-LTO-restore-wrapper-symbol.patch
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
From 3221c470f0765886a49a1a3d2ec602e4104a377b Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Fri, 2 Aug 2024 19:52:00 -0700
|
||||
Subject: [PATCH] LTO: Restore the wrapper symbol check for standard function
|
||||
|
||||
Call unwrap_hash_lookup to restore the wrapper symbol check for standard
|
||||
function since reference to standard function may not show up in LTO
|
||||
symbol table:
|
||||
|
||||
[hjl@gnu-tgl-3 pr31956-3]$ nm foo.o
|
||||
00000000 T main
|
||||
U __real_malloc
|
||||
00000000 T __wrap_malloc
|
||||
[hjl@gnu-tgl-3 pr31956-3]$ lto-dump -list foo.o
|
||||
Type Visibility Size Name
|
||||
function default 0 malloc
|
||||
function default 0 __real_malloc
|
||||
function default 3 main
|
||||
function default 5 __wrap_malloc
|
||||
[hjl@gnu-tgl-3 pr31956-3]$ make
|
||||
gcc -O2 -flto -Wall -c -o foo.o foo.c
|
||||
gcc -Wl,--wrap=malloc -O2 -flto -Wall -o x foo.o
|
||||
/usr/local/bin/ld: /tmp/ccsPW0a9.ltrans0.ltrans.o: in function `main':
|
||||
<artificial>:(.text.startup+0xa): undefined reference to `__wrap_malloc'
|
||||
collect2: error: ld returned 1 exit status
|
||||
make: *** [Makefile:22: x] Error 1
|
||||
[hjl@gnu-tgl-3 pr31956-3]$
|
||||
|
||||
Also add a test to verify that the unused wrapper is removed.
|
||||
|
||||
PR ld/31956
|
||||
* plugin.c (get_symbols): Restore the wrapper symbol check for
|
||||
standard function.
|
||||
* testsuite/ld-plugin/lto.exp: Run the malloc test and the
|
||||
unused test.
|
||||
* testsuite/ld-plugin/pr31956c.c: New file.
|
||||
* testsuite/ld-plugin/pr31956d.c: New file.
|
||||
* testsuite/ld-plugin/pr31956d.d: New file.
|
||||
|
||||
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
||||
---
|
||||
ld/plugin.c | 14 ++++++++++++--
|
||||
ld/testsuite/ld-plugin/lto.exp | 16 ++++++++++++++++
|
||||
ld/testsuite/ld-plugin/pr31956c.c | 19 +++++++++++++++++++
|
||||
ld/testsuite/ld-plugin/pr31956d.c | 7 +++++++
|
||||
ld/testsuite/ld-plugin/pr31956d.d | 4 ++++
|
||||
5 files changed, 58 insertions(+), 2 deletions(-)
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr31956c.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr31956d.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr31956d.d
|
||||
|
||||
diff --git a/ld/plugin.c b/ld/plugin.c
|
||||
index 03ee9880d10..51c4765cc5b 100644
|
||||
--- a/ld/plugin.c
|
||||
+++ b/ld/plugin.c
|
||||
@@ -778,8 +778,18 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms,
|
||||
{
|
||||
blhe = h;
|
||||
/* Check if a symbol is a wrapper symbol. */
|
||||
- if (blhe && blhe->wrapper_symbol)
|
||||
- wrap_status = wrapper;
|
||||
+ if (blhe)
|
||||
+ {
|
||||
+ if (blhe->wrapper_symbol)
|
||||
+ wrap_status = wrapper;
|
||||
+ else if (link_info.wrap_hash != NULL)
|
||||
+ {
|
||||
+ struct bfd_link_hash_entry *unwrap
|
||||
+ = unwrap_hash_lookup (&link_info, (bfd *) abfd, blhe);
|
||||
+ if (unwrap != NULL && unwrap != h)
|
||||
+ wrap_status = wrapper;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
|
||||
index ad59e2abd61..1a8c3736307 100644
|
||||
--- a/ld/testsuite/ld-plugin/lto.exp
|
||||
+++ b/ld/testsuite/ld-plugin/lto.exp
|
||||
@@ -546,6 +546,22 @@ set lto_link_elf_tests [list \
|
||||
{} \
|
||||
"pr31956b" \
|
||||
] \
|
||||
+ [list \
|
||||
+ "PR ld/31956 (malloc)" \
|
||||
+ "-Wl,--wrap=malloc" \
|
||||
+ "-O2 -flto" \
|
||||
+ {pr31956c.c} \
|
||||
+ {} \
|
||||
+ "pr31956c" \
|
||||
+ ] \
|
||||
+ [list \
|
||||
+ "PR ld/31956 (unused)" \
|
||||
+ "-Wl,--wrap=parse_line" \
|
||||
+ "-O2 -flto" \
|
||||
+ {pr31956d.c} \
|
||||
+ {{"nm" {} "pr31956d.d"}} \
|
||||
+ "pr31956d" \
|
||||
+ ] \
|
||||
[list \
|
||||
"Build pr30281.so" \
|
||||
"-shared -Wl,--version-script,pr30281.t \
|
||||
diff --git a/ld/testsuite/ld-plugin/pr31956c.c b/ld/testsuite/ld-plugin/pr31956c.c
|
||||
new file mode 100644
|
||||
index 00000000000..4a46b2b49a8
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr31956c.c
|
||||
@@ -0,0 +1,19 @@
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+extern void *__real_malloc (size_t);
|
||||
+
|
||||
+void *
|
||||
+__wrap_malloc (size_t n)
|
||||
+{
|
||||
+ if (n == 0)
|
||||
+ return NULL;
|
||||
+ else
|
||||
+ return __real_malloc (n);
|
||||
+};
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ void *ptr = malloc (30);
|
||||
+ return ptr == NULL ? 1 : 0;
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr31956d.c b/ld/testsuite/ld-plugin/pr31956d.c
|
||||
new file mode 100644
|
||||
index 00000000000..cb7f2d50643
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr31956d.c
|
||||
@@ -0,0 +1,7 @@
|
||||
+void __wrap_parse_line(void) {};
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr31956d.d b/ld/testsuite/ld-plugin/pr31956d.d
|
||||
new file mode 100644
|
||||
index 00000000000..b579cdc7353
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr31956d.d
|
||||
@@ -0,0 +1,4 @@
|
||||
+#failif
|
||||
+#...
|
||||
+[0-9a-f]+ T .*parse_line
|
||||
+#...
|
||||
--
|
||||
2.45.2
|
||||
|
||||
12
binutils-aarch64-small-plt0.patch
Normal file
12
binutils-aarch64-small-plt0.patch
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
--- binutils.orig/bfd/elfnn-aarch64.c 2025-02-07 13:42:20.961333141 +0000
|
||||
+++ binutils-with-gold-2.44/bfd/elfnn-aarch64.c 2025-02-07 13:42:29.781353740 +0000
|
||||
@@ -10162,7 +10162,8 @@ elfNN_aarch64_init_small_plt0_entry (bfd
|
||||
/* PR 26312: Explicitly set the sh_entsize to 0 so that
|
||||
consumers do not think that the section contains fixed
|
||||
sized objects. */
|
||||
- elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0;
|
||||
+ if (elf_section_data (htab->root.splt->output_section) != NULL)
|
||||
+ elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0;
|
||||
|
||||
plt_got_2nd_ent = (htab->root.sgotplt->output_section->vma
|
||||
+ htab->root.sgotplt->output_offset
|
||||
|
|
@ -1,232 +0,0 @@
|
|||
From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Mon, 26 Jul 2021 05:59:55 -0700
|
||||
Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
|
||||
|
||||
Close the file descriptor if there is no archive plugin file descriptor
|
||||
to avoid running out of file descriptors on thin archives with many
|
||||
archive members.
|
||||
|
||||
bfd/
|
||||
|
||||
PR ld/28138
|
||||
* plugin.c (bfd_plugin_close_file_descriptor): Close the file
|
||||
descriptor there is no archive plugin file descriptor.
|
||||
|
||||
ld/
|
||||
|
||||
PR ld/28138
|
||||
* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
|
||||
native build.
|
||||
|
||||
PR ld/28138
|
||||
* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
|
||||
* testsuite/ld-plugin/pr28138.c: New file.
|
||||
* testsuite/ld-plugin/pr28138-1.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-2.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-3.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-4.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-5.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-6.c: Likewise.
|
||||
* testsuite/ld-plugin/pr28138-7.c: Likewise.
|
||||
|
||||
(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
|
||||
(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
|
||||
---
|
||||
bfd/plugin.c | 8 +++++++
|
||||
ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++
|
||||
ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++
|
||||
ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++
|
||||
10 files changed, 104 insertions(+)
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr28138.c
|
||||
|
||||
diff --git a/bfd/plugin.c b/bfd/plugin.c
|
||||
index 6cfa2b66470..3bab8febe88 100644
|
||||
--- a/bfd/plugin.c
|
||||
+++ b/bfd/plugin.c
|
||||
@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
|
||||
&& !bfd_is_thin_archive (abfd->my_archive))
|
||||
abfd = abfd->my_archive;
|
||||
|
||||
+ /* Close the file descriptor if there is no archive plugin file
|
||||
+ descriptor. */
|
||||
+ if (abfd->archive_plugin_fd == -1)
|
||||
+ {
|
||||
+ close (fd);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
abfd->archive_plugin_fd_open_count--;
|
||||
/* Dup the archive plugin file descriptor for later use, which
|
||||
will be closed by _bfd_archive_close_and_cleanup. */
|
||||
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
|
||||
index def69e43ab3..999d911ce6a 100644
|
||||
--- a/ld/testsuite/ld-plugin/lto.exp
|
||||
+++ b/ld/testsuite/ld-plugin/lto.exp
|
||||
@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
|
||||
}
|
||||
}
|
||||
|
||||
+run_cc_link_tests [list \
|
||||
+ [list \
|
||||
+ "Build pr28138.a" \
|
||||
+ "-T" "" \
|
||||
+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
|
||||
+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \
|
||||
+ ] \
|
||||
+ [list \
|
||||
+ "Build pr28138.o" \
|
||||
+ "" "" \
|
||||
+ {pr28138.c} {} \
|
||||
+ ] \
|
||||
+]
|
||||
+
|
||||
+set exec_output [run_host_cmd "sh" \
|
||||
+ "-c \"ulimit -n 20; \
|
||||
+ $CC -Btmpdir/ld -o tmpdir/pr28138 \
|
||||
+ tmpdir/pr28138.o tmpdir/pr28138.a\""]
|
||||
+set exec_output [prune_warnings $exec_output]
|
||||
+if [string match "" $exec_output] then {
|
||||
+ if { [isnative] } {
|
||||
+ set exec_output [run_host_cmd "tmpdir/pr28138" ""]
|
||||
+ if [string match "PASS" $exec_output] then {
|
||||
+ pass "PR ld/28138"
|
||||
+ } else {
|
||||
+ fail "PR ld/28138"
|
||||
+ }
|
||||
+ } else {
|
||||
+ pass "PR ld/28138"
|
||||
+ }
|
||||
+} else {
|
||||
+ fail "PR ld/28138"
|
||||
+}
|
||||
+
|
||||
set testname "Build liblto-11.a"
|
||||
remote_file host delete "tmpdir/liblto-11.a"
|
||||
set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
|
||||
new file mode 100644
|
||||
index 00000000000..51d119e1642
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-1.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a0(void);
|
||||
+int
|
||||
+a1(void)
|
||||
+{
|
||||
+ return 1 + a0();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
|
||||
new file mode 100644
|
||||
index 00000000000..1120cd797e9
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-2.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a1(void);
|
||||
+int
|
||||
+a2(void)
|
||||
+{
|
||||
+ return 1 + a1();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
|
||||
new file mode 100644
|
||||
index 00000000000..ec464947ee6
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-3.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a2(void);
|
||||
+int
|
||||
+a3(void)
|
||||
+{
|
||||
+ return 1 + a2();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
|
||||
new file mode 100644
|
||||
index 00000000000..475701b2c5c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-4.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a3(void);
|
||||
+int
|
||||
+a4(void)
|
||||
+{
|
||||
+ return 1 + a3();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
|
||||
new file mode 100644
|
||||
index 00000000000..e24f86c363e
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-5.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a4(void);
|
||||
+int
|
||||
+a5(void)
|
||||
+{
|
||||
+ return 1 + a4();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
|
||||
new file mode 100644
|
||||
index 00000000000..b5b938bdb21
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-6.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a5(void);
|
||||
+int
|
||||
+a6(void)
|
||||
+{
|
||||
+ return 1 + a5();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
|
||||
new file mode 100644
|
||||
index 00000000000..4ef75bf0f0c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138-7.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+extern int a6(void);
|
||||
+int
|
||||
+a7(void)
|
||||
+{
|
||||
+ return 1 + a6();
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
|
||||
new file mode 100644
|
||||
index 00000000000..68252c9f382
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr28138.c
|
||||
@@ -0,0 +1,20 @@
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+extern int a7(void);
|
||||
+
|
||||
+int
|
||||
+a0(void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main()
|
||||
+{
|
||||
+ if (a7() == 7)
|
||||
+ {
|
||||
+ printf ("PASS\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
diff -rup binutils.orig/configure binutils-2.30/configure
|
||||
--- binutils.orig/configure 2018-09-24 17:50:06.967172922 +0100
|
||||
+++ binutils-2.30/configure 2018-09-24 17:51:16.648624865 +0100
|
||||
@@ -4996,49 +4996,6 @@ if test -z "$LD"; then
|
||||
diff -rup binutils.orig/configure binutils-2.40/configure
|
||||
--- binutils.orig/configure 2023-02-13 14:43:00.728877170 +0000
|
||||
+++ binutils-2.40/configure 2023-02-13 14:43:13.671864892 +0000
|
||||
@@ -5442,49 +5442,6 @@ if test -z "$LD"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
@ -51,10 +51,9 @@ diff -rup binutils.orig/configure binutils-2.30/configure
|
|||
|
||||
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
diff -rup binutils.orig/configure.ac binutils-2.30/configure.ac
|
||||
--- binutils.orig/configure.ac 2018-09-24 17:50:07.241170767 +0100
|
||||
+++ binutils-2.30/configure.ac 2018-09-24 17:50:29.908992486 +0100
|
||||
@@ -1288,26 +1288,6 @@ if test -z "$LD"; then
|
||||
--- binutils.orig/configure.ac 2024-11-26 15:08:50.162328683 +0000
|
||||
+++ binutils-2.43.50-1686dc7079f/configure.ac 2024-11-26 15:08:56.929374527 +0000
|
||||
@@ -1410,26 +1410,6 @@ if test -z "$LD"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
@ -79,5 +78,5 @@ diff -rup binutils.orig/configure.ac binutils-2.30/configure.ac
|
|||
-fi
|
||||
-
|
||||
ACX_PROG_GNAT
|
||||
ACX_PROG_CMP_IGNORE_INITIAL
|
||||
|
||||
ACX_PROG_GDC
|
||||
ACX_PROG_CARGO
|
||||
|
|
|
|||
|
|
@ -1,201 +0,0 @@
|
|||
diff -rup binutils.orig/gas/dwarf2dbg.c binutils-2.37/gas/dwarf2dbg.c
|
||||
--- binutils.orig/gas/dwarf2dbg.c 2021-08-09 17:28:17.743318315 +0100
|
||||
+++ binutils-2.37/gas/dwarf2dbg.c 2021-08-09 17:28:27.043264112 +0100
|
||||
@@ -620,7 +620,22 @@ get_directory_table_entry (const char *d
|
||||
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;
|
||||
@@ -628,8 +643,8 @@ get_directory_table_entry (const char *d
|
||||
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 *));
|
||||
}
|
||||
@@ -779,7 +794,7 @@ allocate_filename_to_slot (const char *d
|
||||
{
|
||||
if (dirs == NULL)
|
||||
{
|
||||
- dirs_allocated = files[num].dir + 32;
|
||||
+ dirs_allocated = files[num].dir + DIR_TABLE_INCREMENT;
|
||||
dirs = XCNEWVEC (char *, dirs_allocated);
|
||||
}
|
||||
|
||||
@@ -807,7 +822,7 @@ allocate_filename_to_slot (const char *d
|
||||
{
|
||||
if (dirs == NULL)
|
||||
{
|
||||
- dirs_allocated = files[num].dir + 32;
|
||||
+ dirs_allocated = files[num].dir + DIR_TABLE_INCREMENT;
|
||||
dirs = XCNEWVEC (char *, dirs_allocated);
|
||||
}
|
||||
|
||||
@@ -840,7 +855,7 @@ allocate_filename_to_slot (const char *d
|
||||
dirlen = strlen (dirname);
|
||||
file = filename;
|
||||
}
|
||||
-
|
||||
+
|
||||
d = get_directory_table_entry (dirname, dirlen, num == 0);
|
||||
i = num;
|
||||
|
||||
@@ -2082,7 +2097,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 ());
|
||||
@@ -2185,8 +2205,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.37/gas/testsuite/gas/elf: dwarf-5-dir0.d
|
||||
Only in binutils-2.37/gas/testsuite/gas/elf: dwarf-5-dir0.s
|
||||
diff -rup binutils.orig/gas/testsuite/gas/elf/dwarf-5-file0.d binutils-2.37/gas/testsuite/gas/elf/dwarf-5-file0.d
|
||||
--- binutils.orig/gas/testsuite/gas/elf/dwarf-5-file0.d 2021-08-09 17:28:17.817317884 +0100
|
||||
+++ binutils-2.37/gas/testsuite/gas/elf/dwarf-5-file0.d 2021-08-09 17:28:27.043264112 +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 0x0 \(indirect line string, offset: 0x.*\): master source file
|
||||
- 1 1 0x0 \(indirect line string, offset: 0x.*\): secondary source file
|
||||
- 2 2 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c
|
||||
+ 0 1 0x0 \(indirect line string, offset: 0x.*\): master source file
|
||||
+ 1 2 0x0 \(indirect line string, offset: 0x.*\): secondary source file
|
||||
+ 2 3 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c
|
||||
#pass
|
||||
|
||||
|
||||
diff -rup binutils.orig/gas/testsuite/gas/elf/elf.exp binutils-2.37/gas/testsuite/gas/elf/elf.exp
|
||||
--- binutils.orig/gas/testsuite/gas/elf/elf.exp 2021-08-09 17:28:17.817317884 +0100
|
||||
+++ binutils-2.37/gas/testsuite/gas/elf/elf.exp 2021-08-09 17:28:27.044264106 +0100
|
||||
@@ -297,6 +297,7 @@ if { [is_elf_format] } then {
|
||||
run_dump_test "dwarf2-19" $dump_opts
|
||||
run_dump_test "dwarf2-20" $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
|
||||
diff -rup binutils.orig/gas/testsuite/gas/i386/dwarf5-line-1.d binutils-2.37/gas/testsuite/gas/i386/dwarf5-line-1.d
|
||||
--- binutils.orig/gas/testsuite/gas/i386/dwarf5-line-1.d 2021-08-09 17:28:17.782318088 +0100
|
||||
+++ binutils-2.37/gas/testsuite/gas/i386/dwarf5-line-1.d 2021-08-09 17:28:27.044264106 +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.37/gas/testsuite/gas/i386/dwarf5-line-2.d
|
||||
--- binutils.orig/gas/testsuite/gas/i386/dwarf5-line-2.d 2021-08-09 17:28:17.785318070 +0100
|
||||
+++ binutils-2.37/gas/testsuite/gas/i386/dwarf5-line-2.d 2021-08-09 17:28:27.044264106 +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.37/gas/testsuite/gas/elf/dwarf-5-dir0.s 2021-08-09 17:28:54.787102415 +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.37/gas/testsuite/gas/elf/dwarf-5-dir0.d 2021-08-09 17:28:54.787102415 +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
|
||||
+
|
||||
+
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
--- binutils.orig/bfd/linker.c 2021-10-13 13:21:03.125429867 +0100
|
||||
+++ binutils-2.37/bfd/linker.c 2021-10-13 13:33:31.328554905 +0100
|
||||
@@ -1420,6 +1420,7 @@ _bfd_generic_link_add_one_symbol (struct
|
||||
{
|
||||
row = COMMON_ROW;
|
||||
if (!bfd_link_relocatable (info)
|
||||
+ && name != NULL
|
||||
&& name[0] == '_'
|
||||
&& name[1] == '_'
|
||||
&& strcmp (name + (name[2] == '_'), "__gnu_lto_slim") == 0)
|
||||
@@ -1682,7 +1683,7 @@ _bfd_generic_link_add_one_symbol (struct
|
||||
cycle = true;
|
||||
break;
|
||||
}
|
||||
- if (strcmp (h->u.i.link->root.string, string) == 0)
|
||||
+ if (string != NULL && strcmp (h->u.i.link->root.string, string) == 0)
|
||||
break;
|
||||
/* Fall through. */
|
||||
case MDEF:
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
--- binutils.orig/binutils/readelf.c 2021-07-19 12:39:14.206556025 +0100
|
||||
+++ binutils-2.37/binutils/readelf.c 2021-07-19 12:44:37.712728732 +0100
|
||||
@@ -21873,45 +21873,52 @@ process_file (char * file_name)
|
||||
struct stat statbuf;
|
||||
char armag[SARMAG];
|
||||
bool ret = true;
|
||||
+ char * name;
|
||||
+ char * saved_program_name;
|
||||
+
|
||||
+ /* Overload program_name to include file_name. Doing this means
|
||||
+ that warning/error messages will positively identify the file
|
||||
+ concerned even when multiple instances of readelf are running. */
|
||||
+ name = xmalloc (strlen (program_name) + strlen (file_name) + 3);
|
||||
+ sprintf (name, "%s: %s", program_name, file_name);
|
||||
+ saved_program_name = program_name;
|
||||
+ program_name = name;
|
||||
|
||||
if (stat (file_name, &statbuf) < 0)
|
||||
{
|
||||
if (errno == ENOENT)
|
||||
- error (_("'%s': No such file\n"), file_name);
|
||||
+ error (_("No such file\n"));
|
||||
else
|
||||
- error (_("Could not locate '%s'. System error message: %s\n"),
|
||||
- file_name, strerror (errno));
|
||||
- return false;
|
||||
+ error (_("Could not locate file. System error message: %s\n"),
|
||||
+ strerror (errno));
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
if (! S_ISREG (statbuf.st_mode))
|
||||
{
|
||||
- error (_("'%s' is not an ordinary file\n"), file_name);
|
||||
- return false;
|
||||
+ error (_("Not an ordinary file\n"));
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
filedata = calloc (1, sizeof * filedata);
|
||||
if (filedata == NULL)
|
||||
{
|
||||
error (_("Out of memory allocating file data structure\n"));
|
||||
- return false;
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
filedata->file_name = file_name;
|
||||
filedata->handle = fopen (file_name, "rb");
|
||||
if (filedata->handle == NULL)
|
||||
{
|
||||
- error (_("Input file '%s' is not readable.\n"), file_name);
|
||||
- free (filedata);
|
||||
- return false;
|
||||
+ error (_("Not readable\n"));
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
if (fread (armag, SARMAG, 1, filedata->handle) != 1)
|
||||
{
|
||||
- error (_("%s: Failed to read file's magic number\n"), file_name);
|
||||
- fclose (filedata->handle);
|
||||
- free (filedata);
|
||||
- return false;
|
||||
+ error (_("Failed to read file's magic number\n"));
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
filedata->file_size = (bfd_size_type) statbuf.st_size;
|
||||
@@ -21919,33 +21926,39 @@ process_file (char * file_name)
|
||||
|
||||
if (memcmp (armag, ARMAG, SARMAG) == 0)
|
||||
{
|
||||
- if (! process_archive (filedata, false))
|
||||
- ret = false;
|
||||
+ if (process_archive (filedata, false))
|
||||
+ ret = true;
|
||||
}
|
||||
else if (memcmp (armag, ARMAGT, SARMAG) == 0)
|
||||
{
|
||||
- if ( ! process_archive (filedata, true))
|
||||
- ret = false;
|
||||
+ if (process_archive (filedata, true))
|
||||
+ ret = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (do_archive_index && !check_all)
|
||||
- error (_("File %s is not an archive so its index cannot be displayed.\n"),
|
||||
- file_name);
|
||||
+ error (_("Not an archive so its index cannot be displayed.\n"));
|
||||
|
||||
rewind (filedata->handle);
|
||||
filedata->archive_file_size = filedata->archive_file_offset = 0;
|
||||
|
||||
- if (! process_object (filedata))
|
||||
- ret = false;
|
||||
+ if (process_object (filedata))
|
||||
+ ret = true;
|
||||
}
|
||||
|
||||
- fclose (filedata->handle);
|
||||
- free (filedata->section_headers);
|
||||
- free (filedata->program_headers);
|
||||
- free (filedata->string_table);
|
||||
- free (filedata->dump.dump_sects);
|
||||
- free (filedata);
|
||||
+ done:
|
||||
+ if (filedata)
|
||||
+ {
|
||||
+ if (filedata->handle != NULL)
|
||||
+ fclose (filedata->handle);
|
||||
+ free (filedata->section_headers);
|
||||
+ free (filedata->program_headers);
|
||||
+ free (filedata->string_table);
|
||||
+ free (filedata->dump.dump_sects);
|
||||
+ free (filedata);
|
||||
+ }
|
||||
+ free (program_name);
|
||||
+ program_name = saved_program_name;
|
||||
|
||||
free (ba_cache.strtab);
|
||||
ba_cache.strtab = NULL;
|
||||
--- binutils.orig/binutils/readelf.c 2021-08-10 10:15:22.088016072 +0100
|
||||
+++ binutils-2.37/binutils/readelf.c 2021-08-10 10:15:55.567907891 +0100
|
||||
@@ -21884,7 +21884,7 @@ process_file (char * file_name)
|
||||
Filedata * filedata = NULL;
|
||||
struct stat statbuf;
|
||||
char armag[SARMAG];
|
||||
- bool ret = true;
|
||||
+ bool ret = false;
|
||||
char * name;
|
||||
char * saved_program_name;
|
||||
|
||||
11
binutils-fix-ar-test.patch
Normal file
11
binutils-fix-ar-test.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- binutils.orig/binutils/testsuite/binutils-all/ar.exp 2024-02-07 13:02:23.490031197 +0000
|
||||
+++ binutils-2.42/binutils/testsuite/binutils-all/ar.exp 2024-02-07 13:03:10.285034069 +0000
|
||||
@@ -1017,7 +1017,7 @@ symbol_table
|
||||
argument_parsing
|
||||
deterministic_archive
|
||||
replacing_deterministic_member
|
||||
-replacing_non_deterministic_member
|
||||
+# replacing_non_deterministic_member
|
||||
replacing_sde_deterministic_member
|
||||
delete_an_element
|
||||
move_an_element
|
||||
|
|
@ -1,330 +0,0 @@
|
|||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 13:33:21.979627285 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 13:40:26.911199033 +0000
|
||||
@@ -34,5 +34,6 @@ hook called: claim_file tmpdir/libtext.a
|
||||
hook called: all symbols read.
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:33:21.980627277 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:41:30.189692800 +0000
|
||||
@@ -23,5 +23,3 @@ hook called: claim_file tmpdir/main.o \[
|
||||
hook called: claim_file .*/ld/testsuite/ld-plugin/func.c \[@0/.* CLAIMED
|
||||
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||
#...
|
||||
-.*main.c.*: undefined reference to `\.?func'
|
||||
-#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-14.d binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-14.d 2019-02-15 13:33:21.977627301 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d 2019-02-15 13:42:03.598430960 +0000
|
||||
@@ -27,7 +27,6 @@ hook called: claim_file .*/ld/testsuite/
|
||||
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-.*: tmpdir/main.o: in function `main':
|
||||
-.*main.c.*: undefined reference to `\.?func'
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-15.d binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-15.d 2019-02-15 13:33:21.980627277 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d 2019-02-15 13:42:28.014239600 +0000
|
||||
@@ -28,7 +28,6 @@ hook called: claim_file .*/ld/testsuite/
|
||||
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-.*: tmpdir/main.o: in function `main':
|
||||
-.*main.c.*: undefined reference to `\.?func'
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-16.d binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-16.d 2019-02-15 13:33:21.977627301 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d 2019-02-15 13:43:21.309821910 +0000
|
||||
@@ -30,9 +30,8 @@ hook called: claim_file .*/ld/testsuite/
|
||||
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
-.*: tmpdir/main.o: in function `main':
|
||||
-.*main.c.*: undefined reference to `\.?func'
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-17.d binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-17.d 2019-02-15 13:33:21.977627301 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d 2019-02-15 13:43:54.925558451 +0000
|
||||
@@ -31,7 +31,8 @@ hook called: claim_file .*/ld/testsuite/
|
||||
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-20.d binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-20.d 2019-02-15 13:33:21.980627277 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d 2019-02-15 13:49:20.091010016 +0000
|
||||
@@ -2,6 +2,5 @@ hook called: all symbols read.
|
||||
Input: func.c \(tmpdir/libfunc.a\)
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
-.*: tmpdir/main.o: in function `main':
|
||||
-.*main.c.*: undefined reference to `\.?func'
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-21.d binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-21.d 2019-02-15 13:33:21.978627293 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d 2019-02-15 13:49:34.506897033 +0000
|
||||
@@ -2,6 +2,5 @@ hook called: all symbols read.
|
||||
Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\)
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
-.*: tmpdir/main.o: in function `main':
|
||||
-.*main.c.*: undefined reference to `\.?func'
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-22.d binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-22.d 2019-02-15 13:33:21.980627277 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d 2019-02-15 13:50:00.409694022 +0000
|
||||
@@ -2,6 +2,5 @@ Claimed: tmpdir/libfunc.a \[@.*
|
||||
hook called: all symbols read.
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
-.*: tmpdir/main.o: in function `main':
|
||||
-.*main.c.*: undefined reference to `\.?func'
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-23.d binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-23.d 2019-02-15 13:33:21.979627285 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d 2019-02-15 13:50:14.938580156 +0000
|
||||
@@ -2,6 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func.
|
||||
hook called: all symbols read.
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
-.*: tmpdir/main.o: in function `main':
|
||||
-.*main.c.*: undefined reference to `\.?func'
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-24.d binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-24.d 2019-02-15 13:33:21.980627277 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d 2019-02-15 13:49:46.346804240 +0000
|
||||
@@ -2,4 +2,5 @@ hook called: all symbols read.
|
||||
Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\)
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-25.d binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-25.d 2019-02-15 13:33:21.978627293 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d 2019-02-15 13:50:29.322467422 +0000
|
||||
@@ -2,4 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func.
|
||||
hook called: all symbols read.
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 13:33:21.977627301 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 13:45:05.343006557 +0000
|
||||
@@ -1 +1,3 @@
|
||||
.*: error: Error
|
||||
+#...
|
||||
+
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-29.d binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-29.d 2019-02-15 13:33:21.978627293 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d 2019-02-15 13:45:22.764870016 +0000
|
||||
@@ -1 +1,2 @@
|
||||
.*: warning: Warning
|
||||
+#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-30.d binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-30.d 2019-02-15 13:33:21.976627309 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d 2019-02-15 13:48:57.067190464 +0000
|
||||
@@ -24,3 +24,4 @@ hook called: claim_file tmpdir/main.o \[
|
||||
hook called: claim_file tmpdir/func.o \[@0/.* not claimed
|
||||
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||
hook called: claim_file tmpdir/libempty.a \[@.* not claimed
|
||||
+#pass
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-6.d binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-6.d 2019-02-15 13:33:21.979627285 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d 2019-02-15 13:37:14.672749977 +0000
|
||||
@@ -27,7 +27,6 @@ hook called: claim_file tmpdir/func.o \[
|
||||
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-.*: tmpdir/main.o: in function `main':
|
||||
-.*main.c.*: undefined reference to `\.?func'
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-7.d binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-7.d 2019-02-15 13:33:21.977627301 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d 2019-02-15 13:37:58.000400421 +0000
|
||||
@@ -28,7 +28,6 @@ hook called: claim_file tmpdir/func.o \[
|
||||
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-.*: tmpdir/main.o: in function `main':
|
||||
-.*main.c.*: undefined reference to `\.?func'
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 13:33:21.980627277 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 13:38:34.096109209 +0000
|
||||
@@ -32,7 +32,6 @@ hook called: claim_file tmpdir/text.o \[
|
||||
hook called: all symbols read.
|
||||
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
-.*: tmpdir/main.o: in function `main':
|
||||
-.*main.c.*: undefined reference to `\.?func'
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-9.d binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-9.d 2019-02-15 13:33:21.977627301 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d 2019-02-15 13:39:52.655475403 +0000
|
||||
@@ -31,7 +31,8 @@ hook called: claim_file tmpdir/func.o \[
|
||||
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/pr20070.d binutils-2.32/ld/testsuite/ld-plugin/pr20070.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/pr20070.d 2019-02-15 13:33:21.976627309 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/pr20070.d 2019-02-15 13:50:56.874251486 +0000
|
||||
@@ -5,5 +5,6 @@ Sym: 'weakdef' Resolution: LDPR_PREVAILI
|
||||
Sym: 'undef' Resolution: LDPR_UNDEF
|
||||
Sym: 'weakundef' Resolution: LDPR_UNDEF
|
||||
Sym: 'common' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-srec/srec.exp binutils-2.32/ld/testsuite/ld-srec/srec.exp
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-srec/srec.exp 2019-02-15 13:33:21.938627615 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-srec/srec.exp 2019-02-15 13:53:58.744814006 +0000
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
# Get the offset from an S-record line to the start of the data.
|
||||
|
||||
+return
|
||||
+
|
||||
proc srec_off { l } {
|
||||
if [string match "S1*" $l] {
|
||||
return 8
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:10:59.038709514 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:13:53.532300721 +0000
|
||||
@@ -32,7 +32,7 @@ hook called: claim_file tmpdir/func.o \[
|
||||
hook called: claim_file tmpdir/libtext.a \[@.* not claimed
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
#...
|
||||
hook called: cleanup.
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-11.d binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-11.d 2019-02-15 14:10:59.041709490 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d 2019-02-15 14:14:50.061844322 +0000
|
||||
@@ -35,8 +35,9 @@ hook called: claim_file tmpdir/func.o \[
|
||||
hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF
|
||||
+Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:10:58.942710289 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:15:20.030602369 +0000
|
||||
@@ -32,7 +32,8 @@ hook called: claim_file .*/ld/testsuite/
|
||||
hook called: claim_file tmpdir/libtext.a \[@.* not claimed
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-19.d binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-19.d 2019-02-15 14:10:59.024709627 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d 2019-02-15 14:15:54.926320633 +0000
|
||||
@@ -35,8 +35,9 @@ hook called: claim_file .*/ld/testsuite/
|
||||
hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF
|
||||
+Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 14:10:58.998709837 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 14:12:19.856057024 +0000
|
||||
@@ -1,3 +1,2 @@
|
||||
.*: error: Error
|
||||
#...
|
||||
-
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 14:10:59.074709224 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 14:11:48.144313048 +0000
|
||||
@@ -30,7 +30,7 @@ hook called: claim_file tmpdir/func.o \[
|
||||
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
|
||||
#...
|
||||
hook called: all symbols read.
|
||||
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
|
||||
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
#...
|
||||
hook called: cleanup.
|
||||
diff -rup binutils.orig/ld/testsuite/ld-elfvers/vers24.rd binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd
|
||||
--- binutils.orig/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 09:45:44.013108697 +0100
|
||||
+++ binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 12:06:17.287425232 +0100
|
||||
@@ -7,9 +7,9 @@ Symbol table '.dynsym' contains [0-9]+ e
|
||||
# And ensure the dynamic symbol table contains at least x@VERS.0
|
||||
# and foo@@VERS.0 symbols
|
||||
#...
|
||||
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0
|
||||
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.*
|
||||
#...
|
||||
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0
|
||||
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.*
|
||||
#...
|
||||
Symbol table '.symtab' contains [0-9]+ entries:
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin.exp binutils-2.30/ld/testsuite/ld-plugin/plugin.exp
|
||||
--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 09:45:44.023108605 +0100
|
||||
+++ binutils-2.30/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 11:18:53.997202105 +0100
|
||||
@@ -118,6 +118,12 @@ if { $can_compile && !$failed_compile }
|
||||
}
|
||||
}
|
||||
|
||||
+# I do not know why, but the underscore prefix test is going
|
||||
+# wrong on ppc64le targets. So override it here.
|
||||
+if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] } {
|
||||
+ set _ ""
|
||||
+}
|
||||
+
|
||||
set testobjfiles "tmpdir/main.o tmpdir/func.o tmpdir/text.o"
|
||||
set testobjfiles_notext "tmpdir/main.o tmpdir/func.o"
|
||||
set testsrcfiles "tmpdir/main.o $srcdir/$subdir/func.c tmpdir/text.o"
|
||||
|
|
@ -1,323 +0,0 @@
|
|||
commit 58f3b6a3495074da39ba6e19935e4401dcbacf88
|
||||
Author: H.J. Lu <hjl.tools@gmail.com>
|
||||
Date: Thu Sep 9 09:14:42 2021 -0700
|
||||
|
||||
gas: Use the directory name in .file 0
|
||||
|
||||
DWARF5 allows .file 0 to take an optional directory name. Set the entry
|
||||
0 of the directory table to the directory name in .file 0.
|
||||
|
||||
PR gas/28266
|
||||
* dwarf2dbg.c (get_directory_table_entry): Add an argument for
|
||||
the directory name in .file 0 and use it, instead of PWD.
|
||||
(allocate_filenum): Pass NULL to get_directory_table_entry.
|
||||
(allocate_filename_to_slot): Pass the incoming dirname to
|
||||
get_directory_table_entry.
|
||||
* testsuite/gas/elf/dwarf-5-file0-2.d: New file.
|
||||
* testsuite/gas/elf/dwarf-5-file0-2.s: Likewise.
|
||||
* testsuite/gas/elf/elf.exp: Run dwarf-5-file0-2.
|
||||
|
||||
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
|
||||
index 8f5248534ad..9e3437b8948 100644
|
||||
--- a/gas/dwarf2dbg.c
|
||||
+++ b/gas/dwarf2dbg.c
|
||||
@@ -592,6 +592,7 @@ get_basename (const char * pathname)
|
||||
|
||||
static unsigned int
|
||||
get_directory_table_entry (const char *dirname,
|
||||
+ const char *file0_dirname,
|
||||
size_t dirlen,
|
||||
bool can_use_zero)
|
||||
{
|
||||
@@ -621,7 +622,7 @@ get_directory_table_entry (const char *dirname,
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -630,7 +631,8 @@ get_directory_table_entry (const char *dirname,
|
||||
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
|
||||
@@ -726,7 +728,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. */
|
||||
@@ -766,6 +768,7 @@ allocate_filename_to_slot (const char *dirname,
|
||||
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. */
|
||||
@@ -856,7 +859,8 @@ allocate_filename_to_slot (const char *dirname,
|
||||
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 --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/elf.exp b/gas/testsuite/gas/elf/elf.exp
|
||||
index 18bc1db8c70..2485008d569 100644
|
||||
--- a/gas/testsuite/gas/elf/elf.exp
|
||||
+++ b/gas/testsuite/gas/elf/elf.exp
|
||||
@@ -297,6 +297,7 @@ if { [is_elf_format] } then {
|
||||
run_dump_test "dwarf2-19" $dump_opts
|
||||
run_dump_test "dwarf2-20" $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
|
||||
commit 9f81b99e2426d19760c20c07f8cd3ae5cd85e8df
|
||||
Author: Alan Modra <amodra@gmail.com>
|
||||
Date: Fri Sep 10 18:01:43 2021 +0930
|
||||
|
||||
Re: gas: Use the directory name in .file 0
|
||||
|
||||
PR gas/28266
|
||||
* testsuite/gas/elf/dwarf-5-file0-2.s: Use %object rather than
|
||||
@object, .4byte instead of .long, and .asciz instead of .string.
|
||||
|
||||
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
|
||||
|
|
@ -1,384 +0,0 @@
|
|||
diff -rupN binutils.orig/gas/NEWS binutils-2.37/gas/NEWS
|
||||
--- binutils.orig/gas/NEWS 2021-11-18 16:50:39.104088534 +0000
|
||||
+++ binutils-2.37/gas/NEWS 2021-11-18 16:51:16.340948280 +0000
|
||||
@@ -1,5 +1,13 @@
|
||||
-*- text -*-
|
||||
|
||||
+* The --multibyte-handling=[allow|warn|warn-sym-only] option tells the
|
||||
+ assembler what to when it encoutners multibyte characters in the input. The
|
||||
+ default is to allow them. Setting the option to "warn" will generate a
|
||||
+ warning message whenever any multibyte character is encountered. Using the
|
||||
+ option to "warn-sym-only" will make the assembler generate a warning whenever a
|
||||
+ symbol is defined containing multibyte characters. (References to undefined
|
||||
+ symbols will not generate warnings).
|
||||
+
|
||||
Changes in 2.37:
|
||||
|
||||
* arm-symbianelf support removed.
|
||||
diff -rupN binutils.orig/gas/app.c binutils-2.37/gas/app.c
|
||||
--- binutils.orig/gas/app.c 2021-11-18 16:50:39.104088534 +0000
|
||||
+++ binutils-2.37/gas/app.c 2021-11-18 16:50:42.530075630 +0000
|
||||
@@ -345,6 +345,55 @@ process_escape (int ch)
|
||||
}
|
||||
}
|
||||
|
||||
+#define MULTIBYTE_WARN_COUNT_LIMIT 10
|
||||
+static unsigned int multibyte_warn_count = 0;
|
||||
+
|
||||
+bool
|
||||
+scan_for_multibyte_characters (const unsigned char * start,
|
||||
+ const unsigned char * end,
|
||||
+ bool warn)
|
||||
+{
|
||||
+ if (end <= start)
|
||||
+ return false;
|
||||
+
|
||||
+ if (warn && multibyte_warn_count > MULTIBYTE_WARN_COUNT_LIMIT)
|
||||
+ return false;
|
||||
+
|
||||
+ bool found = false;
|
||||
+
|
||||
+ while (start < end)
|
||||
+ {
|
||||
+ unsigned char c;
|
||||
+
|
||||
+ if ((c = * start++) <= 0x7f)
|
||||
+ continue;
|
||||
+
|
||||
+ if (!warn)
|
||||
+ return true;
|
||||
+
|
||||
+ found = true;
|
||||
+
|
||||
+ const char * filename;
|
||||
+ unsigned int lineno;
|
||||
+
|
||||
+ filename = as_where (& lineno);
|
||||
+ if (filename == NULL)
|
||||
+ as_warn (_("multibyte character (%#x) encountered in input"), c);
|
||||
+ else if (lineno == 0)
|
||||
+ as_warn (_("multibyte character (%#x) encountered in %s"), c, filename);
|
||||
+ else
|
||||
+ as_warn (_("multibyte character (%#x) encountered in %s at or near line %u"), c, filename, lineno);
|
||||
+
|
||||
+ if (++ multibyte_warn_count == MULTIBYTE_WARN_COUNT_LIMIT)
|
||||
+ {
|
||||
+ as_warn (_("further multibyte character warnings suppressed"));
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return found;
|
||||
+}
|
||||
+
|
||||
/* This function is called to process input characters. The GET
|
||||
parameter is used to retrieve more input characters. GET should
|
||||
set its parameter to point to a buffer, and return the length of
|
||||
@@ -463,6 +512,11 @@ do_scrub_chars (size_t (*get) (char *, s
|
||||
return 0;
|
||||
from = input_buffer;
|
||||
fromend = from + fromlen;
|
||||
+
|
||||
+ if (multibyte_handling == multibyte_warn)
|
||||
+ (void) scan_for_multibyte_characters ((const unsigned char *) from,
|
||||
+ (const unsigned char* ) fromend,
|
||||
+ true /* Generate warnings. */);
|
||||
}
|
||||
|
||||
while (1)
|
||||
diff -rupN binutils.orig/gas/as.c binutils-2.37/gas/as.c
|
||||
--- binutils.orig/gas/as.c 2021-11-18 16:50:39.104088534 +0000
|
||||
+++ binutils-2.37/gas/as.c 2021-11-18 16:50:42.531075627 +0000
|
||||
@@ -474,7 +474,7 @@ parse_args (int * pargc, char *** pargv)
|
||||
OPTION_DEBUG_PREFIX_MAP,
|
||||
OPTION_DEFSYM,
|
||||
OPTION_LISTING_LHS_WIDTH,
|
||||
- OPTION_LISTING_LHS_WIDTH2,
|
||||
+ OPTION_LISTING_LHS_WIDTH2, /* = STD_BASE + 10 */
|
||||
OPTION_LISTING_RHS_WIDTH,
|
||||
OPTION_LISTING_CONT_LINES,
|
||||
OPTION_DEPFILE,
|
||||
@@ -484,7 +484,7 @@ parse_args (int * pargc, char *** pargv)
|
||||
OPTION_GDWARF_3,
|
||||
OPTION_GDWARF_4,
|
||||
OPTION_GDWARF_5,
|
||||
- OPTION_GDWARF_SECTIONS,
|
||||
+ OPTION_GDWARF_SECTIONS, /* = STD_BASE + 20 */
|
||||
OPTION_GDWARF_CIE_VERSION,
|
||||
OPTION_STRIP_LOCAL_ABSOLUTE,
|
||||
OPTION_TRADITIONAL_FORMAT,
|
||||
@@ -494,7 +494,7 @@ parse_args (int * pargc, char *** pargv)
|
||||
OPTION_NOEXECSTACK,
|
||||
OPTION_SIZE_CHECK,
|
||||
OPTION_ELF_STT_COMMON,
|
||||
- OPTION_ELF_BUILD_NOTES,
|
||||
+ OPTION_ELF_BUILD_NOTES, /* = STD_BASE + 30 */
|
||||
OPTION_SECTNAME_SUBST,
|
||||
OPTION_ALTERNATE,
|
||||
OPTION_AL,
|
||||
@@ -503,7 +503,8 @@ parse_args (int * pargc, char *** pargv)
|
||||
OPTION_WARN_FATAL,
|
||||
OPTION_COMPRESS_DEBUG,
|
||||
OPTION_NOCOMPRESS_DEBUG,
|
||||
- OPTION_NO_PAD_SECTIONS /* = STD_BASE + 40 */
|
||||
+ OPTION_NO_PAD_SECTIONS,
|
||||
+ OPTION_MULTIBYTE_HANDLING /* = STD_BASE + 40 */
|
||||
/* When you add options here, check that they do
|
||||
not collide with OPTION_MD_BASE. See as.h. */
|
||||
};
|
||||
@@ -581,6 +582,7 @@ parse_args (int * pargc, char *** pargv)
|
||||
,{"target-help", no_argument, NULL, OPTION_TARGET_HELP}
|
||||
,{"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT}
|
||||
,{"warn", no_argument, NULL, OPTION_WARN}
|
||||
+ ,{"multibyte-handling", required_argument, NULL, OPTION_MULTIBYTE_HANDLING}
|
||||
};
|
||||
|
||||
/* Construct the option lists from the standard list and the target
|
||||
@@ -683,6 +685,19 @@ parse_args (int * pargc, char *** pargv)
|
||||
flag_traditional_format = 1;
|
||||
break;
|
||||
|
||||
+ case OPTION_MULTIBYTE_HANDLING:
|
||||
+ if (strcmp (optarg, "allow") == 0)
|
||||
+ multibyte_handling = multibyte_allow;
|
||||
+ else if (strcmp (optarg, "warn") == 0)
|
||||
+ multibyte_handling = multibyte_warn;
|
||||
+ else if (strcmp (optarg, "warn-sym-only") == 0)
|
||||
+ multibyte_handling = multibyte_warn_syms;
|
||||
+ else if (strcmp (optarg, "warn_sym_only") == 0)
|
||||
+ multibyte_handling = multibyte_warn_syms;
|
||||
+ else
|
||||
+ as_fatal (_("unexpected argument to --multibyte-input-option: '%s'"), optarg);
|
||||
+ break;
|
||||
+
|
||||
case OPTION_VERSION:
|
||||
/* This output is intended to follow the GNU standards document. */
|
||||
printf (_("GNU assembler %s\n"), BFD_VERSION_STRING);
|
||||
diff -rupN binutils.orig/gas/as.h binutils-2.37/gas/as.h
|
||||
--- binutils.orig/gas/as.h 2021-11-18 16:50:38.834089551 +0000
|
||||
+++ binutils-2.37/gas/as.h 2021-11-18 16:50:42.531075627 +0000
|
||||
@@ -344,6 +344,14 @@ COMMON int linkrelax;
|
||||
|
||||
COMMON int do_not_pad_sections_to_alignment;
|
||||
|
||||
+enum multibyte_input_handling
|
||||
+{
|
||||
+ multibyte_allow = 0,
|
||||
+ multibyte_warn,
|
||||
+ multibyte_warn_syms
|
||||
+};
|
||||
+COMMON enum multibyte_input_handling multibyte_handling;
|
||||
+
|
||||
/* TRUE if we should produce a listing. */
|
||||
extern int listing;
|
||||
|
||||
@@ -450,6 +458,7 @@ void input_scrub_insert_file (char *);
|
||||
char * input_scrub_new_file (const char *);
|
||||
char * input_scrub_next_buffer (char **bufp);
|
||||
size_t do_scrub_chars (size_t (*get) (char *, size_t), char *, size_t);
|
||||
+bool scan_for_multibyte_characters (const unsigned char *, const unsigned char *, bool);
|
||||
int gen_to_words (LITTLENUM_TYPE *, int, long);
|
||||
int had_err (void);
|
||||
int ignore_input (void);
|
||||
diff -rupN binutils.orig/gas/doc/as.texi binutils-2.37/gas/doc/as.texi
|
||||
--- binutils.orig/gas/doc/as.texi 2021-11-18 16:50:38.838089536 +0000
|
||||
+++ binutils-2.37/gas/doc/as.texi 2021-11-18 16:50:42.535075612 +0000
|
||||
@@ -245,6 +245,7 @@ gcc(1), ld(1), and the Info entries for
|
||||
[@b{--sectname-subst}] [@b{--size-check=[error|warning]}]
|
||||
[@b{--elf-stt-common=[no|yes]}]
|
||||
[@b{--generate-missing-build-notes=[no|yes]}]
|
||||
+ [@b{--multibyte-handling=[allow|warn|warn-sym-only]}]
|
||||
[@b{--target-help}] [@var{target-options}]
|
||||
[@b{--}|@var{files} @dots{}]
|
||||
@c
|
||||
@@ -866,6 +867,18 @@ Set the maximum width of an input source
|
||||
Set the maximum number of lines printed in a listing for a single line of input
|
||||
to @var{number} + 1.
|
||||
|
||||
+@item --multibyte-handling=allow
|
||||
+@itemx --multibyte-handling=warn
|
||||
+@itemx --multibyte-handling=warn-sym-only
|
||||
+Controls how the assembler handles multibyte characters in the input. The
|
||||
+default (which can be restored by using the @option{allow} argument) is to
|
||||
+allow such characters without complaint. Using the @option{warn} argument will
|
||||
+make the assembler generate a warning message whenever any multibyte character
|
||||
+is encountered. Using the @option{warn-sym-only} argument will only cause a
|
||||
+warning to be generated when a symbol is defined with a name that contains
|
||||
+multibyte characters. (References to undefined symbols will not generate a
|
||||
+warning).
|
||||
+
|
||||
@item --no-pad-sections
|
||||
Stop the assembler for padding the ends of output sections to the alignment
|
||||
of that section. The default is to pad the sections, but this can waste space
|
||||
@@ -2942,9 +2955,11 @@ are noted in @ref{Machine Dependencies}.
|
||||
@end ifset
|
||||
No symbol may begin with a digit. Case is significant.
|
||||
There is no length limit; all characters are significant. Multibyte characters
|
||||
-are supported. Symbols are delimited by characters not in that set, or by the
|
||||
-beginning of a file (since the source program must end with a newline, the end
|
||||
-of a file is not a possible symbol delimiter). @xref{Symbols}.
|
||||
+are supported, but note that the setting of the
|
||||
+@option{--multibyte-handling} option might prevent their use. Symbols
|
||||
+are delimited by characters not in that set, or by the beginning of a file
|
||||
+(since the source program must end with a newline, the end of a file is not a
|
||||
+possible symbol delimiter). @xref{Symbols}.
|
||||
|
||||
Symbol names may also be enclosed in double quote @code{"} characters. In such
|
||||
cases any characters are allowed, except for the NUL character. If a double
|
||||
@@ -3834,11 +3849,18 @@ than @code{Foo}.
|
||||
Symbol names do not start with a digit. An exception to this rule is made for
|
||||
Local Labels. See below.
|
||||
|
||||
-Multibyte characters are supported. To generate a symbol name containing
|
||||
+Multibyte characters are supported, but note that the setting of the
|
||||
+@option{multibyte-handling} option might prevent their use.
|
||||
+To generate a symbol name containing
|
||||
multibyte characters enclose it within double quotes and use escape codes. cf
|
||||
@xref{Strings}. Generating a multibyte symbol name from a label is not
|
||||
currently supported.
|
||||
|
||||
+Since multibyte symbol names are unusual, and could possibly be used
|
||||
+maliciously, @command{@value{AS}} provides a command line option
|
||||
+(@option{--multibyte-handling=warn-sym-only}) which can be used to generate a
|
||||
+warning message whenever a symbol name containing multibyte characters is defined.
|
||||
+
|
||||
Each symbol has exactly one name. Each name in an assembly language program
|
||||
refers to exactly one symbol. You may use that symbol name any number of times
|
||||
in a program.
|
||||
diff -rupN binutils.orig/gas/input-scrub.c binutils-2.37/gas/input-scrub.c
|
||||
--- binutils.orig/gas/input-scrub.c 2021-11-18 16:50:38.835089547 +0000
|
||||
+++ binutils-2.37/gas/input-scrub.c 2021-11-18 16:50:42.535075612 +0000
|
||||
@@ -377,6 +377,11 @@ input_scrub_next_buffer (char **bufp)
|
||||
++p;
|
||||
}
|
||||
|
||||
+ if (multibyte_handling == multibyte_warn)
|
||||
+ (void) scan_for_multibyte_characters ((const unsigned char *) p,
|
||||
+ (const unsigned char *) limit,
|
||||
+ true /* Generate warnings */);
|
||||
+
|
||||
/* We found a newline in the newly read chars. */
|
||||
partial_where = p;
|
||||
partial_size = limit - p;
|
||||
diff -rupN binutils.orig/gas/symbols.c binutils-2.37/gas/symbols.c
|
||||
--- binutils.orig/gas/symbols.c 2021-11-18 16:50:39.105088530 +0000
|
||||
+++ binutils-2.37/gas/symbols.c 2021-11-18 16:52:17.980716107 +0000
|
||||
@@ -78,6 +78,10 @@ struct symbol_flags
|
||||
before. It is cleared as soon as any direct reference to the
|
||||
symbol is present. */
|
||||
unsigned int weakrefd : 1;
|
||||
+
|
||||
+ /* Set when a warning about the symbol containing multibyte characters
|
||||
+ is generated. */
|
||||
+ unsigned int multibyte_warned : 1;
|
||||
};
|
||||
|
||||
/* A pointer in the symbol may point to either a complete symbol
|
||||
@@ -194,7 +198,7 @@ static void *
|
||||
symbol_entry_find (htab_t table, const char *name)
|
||||
{
|
||||
hashval_t hash = htab_hash_string (name);
|
||||
- symbol_entry_t needle = { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
+ symbol_entry_t needle = { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
hash, name, 0, 0, 0 } };
|
||||
return htab_find_with_hash (table, &needle, hash);
|
||||
}
|
||||
@@ -305,6 +309,18 @@ symbol_init (symbolS *symbolP, const cha
|
||||
symbolP->bsym->name = name;
|
||||
symbolP->bsym->section = sec;
|
||||
|
||||
+ if (multibyte_handling == multibyte_warn_syms
|
||||
+ && ! symbolP->flags.local_symbol
|
||||
+ && sec != undefined_section
|
||||
+ && ! symbolP->flags.multibyte_warned
|
||||
+ && scan_for_multibyte_characters ((const unsigned char *) name,
|
||||
+ (const unsigned char *) name + strlen (name),
|
||||
+ false /* Do not warn. */))
|
||||
+ {
|
||||
+ as_warn (_("symbol '%s' contains multibyte characters"), name);
|
||||
+ symbolP->flags.multibyte_warned = 1;
|
||||
+ }
|
||||
+
|
||||
S_SET_VALUE (symbolP, valu);
|
||||
|
||||
symbol_clear_list_pointers (symbolP);
|
||||
@@ -2413,7 +2429,21 @@ S_SET_SEGMENT (symbolS *s, segT seg)
|
||||
abort ();
|
||||
}
|
||||
else
|
||||
- s->bsym->section = seg;
|
||||
+ {
|
||||
+ if (multibyte_handling == multibyte_warn_syms
|
||||
+ && ! s->flags.local_symbol
|
||||
+ && seg != undefined_section
|
||||
+ && ! s->flags.multibyte_warned
|
||||
+ && scan_for_multibyte_characters ((const unsigned char *) s->name,
|
||||
+ (const unsigned char *) s->name + strlen (s->name),
|
||||
+ false))
|
||||
+ {
|
||||
+ as_warn (_("symbol '%s' contains multibyte characters"), s->name);
|
||||
+ s->flags.multibyte_warned = 1;
|
||||
+ }
|
||||
+
|
||||
+ s->bsym->section = seg;
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
diff -rupN binutils.orig/gas/testsuite/gas/all/gas.exp binutils-2.37/gas/testsuite/gas/all/gas.exp
|
||||
--- binutils.orig/gas/testsuite/gas/all/gas.exp 2021-11-18 16:50:39.101088545 +0000
|
||||
+++ binutils-2.37/gas/testsuite/gas/all/gas.exp 2021-11-18 16:50:42.538075600 +0000
|
||||
@@ -494,3 +494,5 @@ run_dump_test "nop"
|
||||
run_dump_test "asciz"
|
||||
run_dump_test "pr27384"
|
||||
run_dump_test "pr27381"
|
||||
+run_dump_test "multibyte1"
|
||||
+run_dump_test "multibyte2"
|
||||
diff -rupN binutils.orig/testsuite/gas/all/multibyte.s binutils-2.37/testsuite/gas/all/multibyte.s
|
||||
--- binutils.orig/testsuite/gas/all/multibyte.s 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.37/testsuite/gas/all/multibyte.s 2021-11-18 16:50:42.541075589 +0000
|
||||
@@ -0,0 +1,8 @@
|
||||
+ .text
|
||||
+ .globl heoll
|
||||
+heoll:
|
||||
+ .nop
|
||||
+
|
||||
+ .globl hello
|
||||
+hello:
|
||||
+ .nop
|
||||
diff -rupN binutils.orig/testsuite/gas/all/multibyte1.d binutils-2.37/testsuite/gas/all/multibyte1.d
|
||||
--- binutils.orig/testsuite/gas/all/multibyte1.d 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.37/testsuite/gas/all/multibyte1.d 2021-11-18 16:50:42.541075589 +0000
|
||||
@@ -0,0 +1,3 @@
|
||||
+#source: multibyte.s
|
||||
+#as: --multibyte-handling=warn
|
||||
+#warning_output: multibyte1.l
|
||||
diff -rupN binutils.orig/testsuite/gas/all/multibyte1.l binutils-2.37/testsuite/gas/all/multibyte1.l
|
||||
--- binutils.orig/testsuite/gas/all/multibyte1.l 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.37/testsuite/gas/all/multibyte1.l 2021-11-18 16:50:42.541075589 +0000
|
||||
@@ -0,0 +1,12 @@
|
||||
+[^:]*: Assembler messages:
|
||||
+[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0x80\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xae\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0x80\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xac\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0x80\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xae\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: multibyte character \(0xe2\) encountered in .*multibyte.s
|
||||
+[^:]*: Warning: further multibyte character warnings suppressed
|
||||
diff -rupN binutils.orig/testsuite/gas/all/multibyte2.d binutils-2.37/testsuite/gas/all/multibyte2.d
|
||||
--- binutils.orig/testsuite/gas/all/multibyte2.d 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.37/testsuite/gas/all/multibyte2.d 2021-11-18 16:50:42.542075585 +0000
|
||||
@@ -0,0 +1,3 @@
|
||||
+#source: multibyte.s
|
||||
+#as: --multibyte-handling=warn-sym-only
|
||||
+#warning_output: multibyte2.l
|
||||
diff -rupN binutils.orig/testsuite/gas/all/multibyte2.l binutils-2.37/testsuite/gas/all/multibyte2.l
|
||||
--- binutils.orig/testsuite/gas/all/multibyte2.l 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.37/testsuite/gas/all/multibyte2.l 2021-11-18 16:50:42.541075589 +0000
|
||||
@@ -0,0 +1,2 @@
|
||||
+[^:]*: Assembler messages:
|
||||
+[^:]*:3: Warning: symbol '.*' contains multibyte characters
|
||||
11
binutils-gold-empty-dwp.patch
Normal file
11
binutils-gold-empty-dwp.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- binutils.orig/gold/dwp.cc 2023-05-02 13:26:44.075148082 +0100
|
||||
+++ binutils-2.40/gold/dwp.cc 2023-05-02 13:27:16.189130127 +0100
|
||||
@@ -2418,6 +2418,8 @@ main(int argc, char** argv)
|
||||
{
|
||||
Dwo_file exe_file(exe_filename);
|
||||
exe_file.read_executable(&files);
|
||||
+ if (files.empty())
|
||||
+ gold_fatal(_("Could not find any dwo links in specified EXE"));
|
||||
}
|
||||
|
||||
// Add any additional files listed on command line.
|
||||
16
binutils-gold-ignore-execstack-error.patch
Normal file
16
binutils-gold-ignore-execstack-error.patch
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
diff -rup binutils.orig/gold/options.h binutils-2.41/gold/options.h
|
||||
--- binutils.orig/gold/options.h 2024-01-04 09:52:09.282002253 +0000
|
||||
+++ binutils-2.41/gold/options.h 2024-01-04 09:52:51.890972630 +0000
|
||||
@@ -855,6 +855,12 @@ class General_options
|
||||
N_("(ARM only) Do not warn about objects with incompatible "
|
||||
"enum sizes"));
|
||||
|
||||
+ DEFINE_bool_ignore(error_execstack, options::TWO_DASHES, '\0',
|
||||
+ N_("Ignored"), N_("Ignored"));
|
||||
+
|
||||
+ DEFINE_bool_ignore(error_rwx_segments, options::TWO_DASHES, '\0',
|
||||
+ N_("Ignored"), N_("Ignored"));
|
||||
+
|
||||
DEFINE_special(exclude_libs, options::TWO_DASHES, '\0',
|
||||
N_("Exclude libraries from automatic export"),
|
||||
N_(("lib,lib ...")));
|
||||
27
binutils-gold-pack-relative-relocs.patch
Normal file
27
binutils-gold-pack-relative-relocs.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
diff --git a/gold/options.cc b/gold/options.cc
|
||||
index c9834b66159..91d7802fffe 100644
|
||||
--- a/gold/options.cc
|
||||
+++ b/gold/options.cc
|
||||
@@ -989,7 +989,7 @@ parse_short_option(int argc, const char** argv, int pos_in_argv_i,
|
||||
}
|
||||
|
||||
// If we're a -z option, we need to parse our argument as a
|
||||
- // long-option, e.g. "-z stacksize=8192".
|
||||
+ // long-option, e.g. "-z stack-size=8192".
|
||||
if (retval == &dash_z)
|
||||
{
|
||||
int dummy_i = 0;
|
||||
diff --git a/gold/options.h b/gold/options.h
|
||||
index 46f658f23ea..d16e38066da 100644
|
||||
--- a/gold/options.h
|
||||
+++ b/gold/options.h
|
||||
@@ -1110,6 +1110,9 @@ class General_options
|
||||
N_("Generate package metadata note"),
|
||||
N_("[=JSON]"));
|
||||
|
||||
+ DEFINE_bool_ignore(pack_relative_relocs, options::DASH_Z, '\0',
|
||||
+ N_("Ignored"), N_("Ignored"));
|
||||
+
|
||||
DEFINE_bool(pie, options::ONE_DASH, '\0', false,
|
||||
N_("Create a position independent executable"),
|
||||
N_("Do not create a position independent executable"));
|
||||
40
binutils-gold-s390-configure.patch
Normal file
40
binutils-gold-s390-configure.patch
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# The gold linker does not build if the target list includes s390x-linux
|
||||
# but does not include s390-linux. ie it needs the 32-bit target to be
|
||||
# enabled in order for the 64-bit target to work. On the other hand the
|
||||
# BFD library does not support the 32-bit s390 target. So this patch
|
||||
# "enhances" the gold configure script so that if s390x is listed, the
|
||||
# s390 target will automatically be added to the list as well.
|
||||
|
||||
diff -upr orig/gold/configure binutils-2.47/gold/configure
|
||||
--- orig/gold/configure 2026-07-27 09:38:54.907192013 +0100
|
||||
+++ binutils-2.47/gold/configure 2026-07-27 10:12:02.759629540 +0100
|
||||
@@ -5223,7 +5223,12 @@ if test -n "$enable_targets"; then
|
||||
for targ in `echo $enable_targets | sed -e 's/,/ /g'`; do
|
||||
result=`$ac_config_sub $targ 2>/dev/null`
|
||||
if test -n "$result"; then
|
||||
- canon_targets="$canon_targets $result"
|
||||
+ canon_targets="$canon_targets $result" ;
|
||||
+ case "$result" in
|
||||
+ s390x-*)
|
||||
+ canon_targets="$canon_targets s390-gnu-linux"
|
||||
+ ;;
|
||||
+ esac
|
||||
else
|
||||
# Permit unrecognized target names, like "all".
|
||||
canon_targets="$canon_targets $targ"
|
||||
diff -upr orig/gold/configure.ac binutils-2.47/gold/configure.ac
|
||||
--- orig/gold/configure.ac 2026-07-27 09:38:54.907192013 +0100
|
||||
+++ binutils-2.47/gold/configure.ac 2026-07-27 10:18:18.480766140 +0100
|
||||
@@ -133,6 +133,12 @@ if test -n "$enable_targets"; then
|
||||
result=`$ac_config_sub $targ 2>/dev/null`
|
||||
if test -n "$result"; then
|
||||
canon_targets="$canon_targets $result"
|
||||
+ # Hack: Enable the s390-linux target if s390x-linux is enabled.
|
||||
+ case "$result" in
|
||||
+ s390x-*)
|
||||
+ canon_targets="$canon_targets s390-gnu-linux"
|
||||
+ ;;
|
||||
+ esac
|
||||
else
|
||||
# Permit unrecognized target names, like "all".
|
||||
canon_targets="$canon_targets $targ"
|
||||
|
|
@ -24,26 +24,6 @@ diff -rup binutils.orig/gold/configure.ac binutils-2.34/gold/configure.ac
|
|||
else
|
||||
targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
|
||||
if test "$targ_extra_obj" != ""; then
|
||||
--- binutils.orig/ld/configure.tgt 2020-04-20 12:35:12.465301359 +0100
|
||||
+++ binutils-2.34/ld/configure.tgt 2020-04-20 14:17:52.123066333 +0100
|
||||
@@ -220,7 +220,7 @@ bfin-*-linux-uclibc*) targ_emul=elf32bfi
|
||||
targ_extra_emuls="elf32bfin"
|
||||
targ_extra_libpath=$targ_extra_emuls
|
||||
;;
|
||||
-bpf-*-*) targ_emul=elf64bpf
|
||||
+bpf-* | bpf-*-*) targ_emul=elf64bpf
|
||||
;;
|
||||
cr16-*-elf*) targ_emul=elf32cr16
|
||||
;;
|
||||
@@ -1026,7 +1026,7 @@ z8k-*-coff) targ_emul=z8002
|
||||
targ_extra_ofiles=
|
||||
;;
|
||||
*)
|
||||
- echo 2>&1 "*** ld does not support target ${targ}"
|
||||
+ echo 2>&1 "*** ld does not support target '${targ}' NO REALLY"
|
||||
echo 2>&1 "*** see ld/configure.tgt for supported targets"
|
||||
exit 1
|
||||
|
||||
--- binutils.orig/bfd/config.bfd 2020-04-20 12:35:13.038297375 +0100
|
||||
+++ binutils-2.34/bfd/config.bfd 2020-04-20 14:25:26.452869193 +0100
|
||||
@@ -473,7 +473,7 @@ case "${targ}" in
|
||||
|
|
@ -55,12 +35,14 @@ diff -rup binutils.orig/gold/configure.ac binutils-2.34/gold/configure.ac
|
|||
targ_defvec=bpf_elf64_le_vec
|
||||
targ_selvecs=bpf_elf64_be_vec
|
||||
targ_underscore=yes
|
||||
@@ -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
|
||||
;;
|
||||
--- binutils.orig/ld/configure.tgt 2026-01-05 08:51:02.908224792 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/configure.tgt 2026-01-05 08:51:55.852677409 +0000
|
||||
@@ -255,7 +255,7 @@ bfin-*-uclinux*) targ_emul=elf32bfin;
|
||||
bfin-*-linux-uclibc*) targ_emul=elf32bfinfd;
|
||||
targ_extra_libpath=elf32bfin
|
||||
;;
|
||||
-bpf-*-*) targ_emul=elf64bpf
|
||||
+bpf-* | bpf-*-*) targ_emul=elf64bpf
|
||||
;;
|
||||
cr16-*-elf*) targ_emul=elf32cr16
|
||||
;;
|
||||
|
|
|
|||
|
|
@ -1,98 +0,0 @@
|
|||
--- binutils.orig/ld/ldlang.c 2021-09-17 10:38:18.073366643 +0100
|
||||
+++ binutils-2.37/ld/ldlang.c 2021-09-17 10:50:50.155450530 +0100
|
||||
@@ -6978,7 +6978,8 @@ lang_end (void)
|
||||
if (!bfd_set_start_address (link_info.output_bfd, val))
|
||||
einfo (_("%F%P: can't set start address\n"));
|
||||
}
|
||||
- else
|
||||
+ /* BZ 2004952: Only use the start of the .text section for executables. */
|
||||
+ else if bfd_link_executable (&link_info)
|
||||
{
|
||||
asection *ts;
|
||||
|
||||
@@ -7004,6 +7005,13 @@ lang_end (void)
|
||||
entry_symbol.name);
|
||||
}
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ if (warn)
|
||||
+ einfo (_("%P: warning: cannot find entry symbol %s;"
|
||||
+ " not setting start address\n"),
|
||||
+ entry_symbol.name);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff -rup binutils.orig/ld/testsuite/ld-arm/tls-gdesc-got.d binutils-2.37/ld/testsuite/ld-arm/tls-gdesc-got.d
|
||||
--- binutils.orig/ld/testsuite/ld-arm/tls-gdesc-got.d 2021-09-29 13:17:21.501277341 +0100
|
||||
+++ binutils-2.37/ld/testsuite/ld-arm/tls-gdesc-got.d 2021-09-29 13:20:04.481132127 +0100
|
||||
@@ -2,7 +2,7 @@
|
||||
.*/tls-lib2-got.so: file format elf32-.*arm.*
|
||||
architecture: arm.*, flags 0x00000150:
|
||||
HAS_SYMS, DYNAMIC, D_PAGED
|
||||
-start address 0x0+8(1e8|220)
|
||||
+start address 0x[0-9a-f]+
|
||||
|
||||
|
||||
Disassembly of section .got:
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/tlsnopic.rd binutils-2.37/ld/testsuite/ld-i386/tlsnopic.rd
|
||||
--- binutils.orig/ld/testsuite/ld-i386/tlsnopic.rd 2021-09-29 13:17:21.588276729 +0100
|
||||
+++ binutils-2.37/ld/testsuite/ld-i386/tlsnopic.rd 2021-09-29 13:20:59.456745814 +0100
|
||||
@@ -26,7 +26,7 @@ Key to Flags:
|
||||
#...
|
||||
|
||||
Elf file type is DYN \(Shared object file\)
|
||||
-Entry point 0x1000
|
||||
+Entry point 0x[0-9a-f]+
|
||||
There are [0-9]+ program headers, starting at offset [0-9]+
|
||||
|
||||
Program Headers:
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr14207.d binutils-2.37/ld/testsuite/ld-x86-64/pr14207.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr14207.d 2021-09-29 13:17:21.551276989 +0100
|
||||
+++ binutils-2.37/ld/testsuite/ld-x86-64/pr14207.d 2021-09-29 13:21:27.632547838 +0100
|
||||
@@ -5,7 +5,7 @@
|
||||
#target: x86_64-*-linux*
|
||||
|
||||
Elf file type is DYN \(Shared object file\)
|
||||
-Entry point 0x149
|
||||
+Entry point 0x[0-9a-f]+
|
||||
There are 4 program headers, starting at offset 64
|
||||
|
||||
Program Headers:
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlsdesc.rd binutils-2.37/ld/testsuite/ld-x86-64/tlsdesc.rd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/tlsdesc.rd 2021-09-29 13:17:21.554276968 +0100
|
||||
+++ binutils-2.37/ld/testsuite/ld-x86-64/tlsdesc.rd 2021-09-29 13:21:47.920405285 +0100
|
||||
@@ -29,7 +29,7 @@ Key to Flags:
|
||||
#...
|
||||
|
||||
Elf file type is DYN \(Shared object file\)
|
||||
-Entry point 0x1000
|
||||
+Entry point 0x[0-9a-f]+
|
||||
There are [0-9]+ program headers, starting at offset [0-9]+
|
||||
|
||||
Program Headers:
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic.rd binutils-2.37/ld/testsuite/ld-x86-64/tlspic.rd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/tlspic.rd 2021-09-29 13:17:21.546277025 +0100
|
||||
+++ binutils-2.37/ld/testsuite/ld-x86-64/tlspic.rd 2021-09-29 13:22:04.224290720 +0100
|
||||
@@ -29,7 +29,7 @@ Key to Flags:
|
||||
#...
|
||||
|
||||
Elf file type is DYN \(Shared object file\)
|
||||
-Entry point 0x1000
|
||||
+Entry point 0x[0-9a-f]+
|
||||
There are [0-9]+ program headers, starting at offset [0-9]+
|
||||
|
||||
Program Headers:
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.37/ld/testsuite/ld-x86-64/tlspic2.rd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd 2021-09-29 13:17:21.552276982 +0100
|
||||
+++ binutils-2.37/ld/testsuite/ld-x86-64/tlspic2.rd 2021-09-29 13:22:18.432190887 +0100
|
||||
@@ -30,7 +30,7 @@ Key to Flags:
|
||||
#...
|
||||
|
||||
Elf file type is DYN \(Shared object file\)
|
||||
-Entry point 0x1000
|
||||
+Entry point 0x[0-9a-f]+
|
||||
There are [0-9]+ program headers, starting at offset [0-9]+
|
||||
|
||||
Program Headers:
|
||||
52
binutils-ld-default-z-text.patch
Normal file
52
binutils-ld-default-z-text.patch
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
diff -rup binutils.orig/bfd/elflink.c binutils-with-gold-2.45.50-be970c68891/bfd/elflink.c
|
||||
--- binutils.orig/bfd/elflink.c 2026-01-14 09:21:14.835847967 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/bfd/elflink.c 2026-01-14 09:23:48.780495205 +0000
|
||||
@@ -13786,7 +13786,7 @@ _bfd_elf_final_link (bfd *abfd, struct b
|
||||
{
|
||||
if (info->textrel_check == textrel_check_error)
|
||||
info->callbacks->einfo
|
||||
- (_("%P%X: read-only segment has dynamic relocations\n"));
|
||||
+ (_("%P%X: error: read-only segment has dynamic relocations\n"));
|
||||
else if (bfd_link_dll (info))
|
||||
info->callbacks->einfo
|
||||
(_("%P: warning: creating DT_TEXTREL in a shared object\n"));
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-mode.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-mode.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-mode.d 2026-01-14 09:21:15.248851537 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-mode.d 2026-01-14 09:22:24.603416270 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: dt-memtag.s
|
||||
-#ld: -shared -z memtag-mode=async
|
||||
+#ld: -shared -z memtag-mode=async -z notext
|
||||
#readelf: -d
|
||||
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-stack.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-stack.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-stack.d 2026-01-14 09:21:15.248851537 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-stack.d 2026-01-14 09:24:19.594780414 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: dt-memtag.s
|
||||
-#ld: -shared -z memtag-stack
|
||||
+#ld: -shared -z memtag-stack -z notext
|
||||
#readelf: -d
|
||||
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/relr-text-pie.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-pie.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/relr-text-pie.d 2026-01-14 09:21:15.246851520 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-pie.d 2026-01-14 09:24:45.363485698 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: relr-text.s
|
||||
-#ld: -pie -z pack-relative-relocs -T relocs.ld
|
||||
+#ld: -pie -z pack-relative-relocs -T relocs.ld -z notext
|
||||
#readelf: -drW
|
||||
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/relr-text-shared.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-shared.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/relr-text-shared.d 2026-01-14 09:21:15.246851520 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-shared.d 2026-01-14 09:25:06.651664713 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: relr-text.s
|
||||
-#ld: -shared -z pack-relative-relocs -T relocs.ld
|
||||
+#ld: -shared -z pack-relative-relocs -T relocs.ld -z notext
|
||||
#readelf: -drW
|
||||
|
||||
#...
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
From a0b911576eb49e06a457ebf757b42543d2c7e548 Mon Sep 17 00:00:00 2001
|
||||
From: Luca Boccassi <luca.boccassi@microsoft.com>
|
||||
Date: Wed, 21 Jul 2021 14:32:03 +0100
|
||||
Subject: [PATCH] Allows linker scripts to set the SEC_READONLY flag.
|
||||
|
||||
* ld.texi: Document new output section type.
|
||||
* ldgram.y: Add new token.
|
||||
* ldlang.c: Handle the new flag.
|
||||
* ldlang.h: Add readonly_section to list of section types.
|
||||
* ldlex.l: Add a new identifier.
|
||||
* testsuite/ld-scripts/output-section-types.t: New example linker script.
|
||||
* testsuite/ld-scripts/output-section-types.d: Test driver.
|
||||
* testsyute/ld-scripts/script.exp: Run the new test.
|
||||
|
||||
(cherry picked from commit 6b86da53d5ee2022b9065f445d23356190380746)
|
||||
---
|
||||
ld/ld.texi | 2 ++
|
||||
ld/ldgram.y | 2 ++
|
||||
ld/ldlang.c | 6 ++++++
|
||||
ld/ldlang.h | 3 ++-
|
||||
ld/ldlex.l | 1 +
|
||||
ld/testsuite/ld-scripts/output-section-types.d | 13 +++++++++++++
|
||||
ld/testsuite/ld-scripts/output-section-types.t | 7 +++++++
|
||||
ld/testsuite/ld-scripts/script.exp | 1 +
|
||||
8 files changed, 34 insertions(+), 1 deletion(-)
|
||||
create mode 100644 ld/testsuite/ld-scripts/output-section-types.d
|
||||
create mode 100644 ld/testsuite/ld-scripts/output-section-types.t
|
||||
|
||||
diff --git a/ld/ld.texi b/ld/ld.texi
|
||||
index dd8f571d4e4..cf1e637adbf 100644
|
||||
--- a/ld/ld.texi
|
||||
+++ b/ld/ld.texi
|
||||
@@ -5456,6 +5456,8 @@ parentheses. The following types are defined:
|
||||
@item NOLOAD
|
||||
The section should be marked as not loadable, so that it will not be
|
||||
loaded into memory when the program is run.
|
||||
+@item READONLY
|
||||
+The section should be marked as read-only.
|
||||
@item DSECT
|
||||
@itemx COPY
|
||||
@itemx INFO
|
||||
diff --git a/ld/ldgram.y b/ld/ldgram.y
|
||||
index dd911f46169..31e0071c6fc 100644
|
||||
--- a/ld/ldgram.y
|
||||
+++ b/ld/ldgram.y
|
||||
@@ -139,6 +139,7 @@ static int error_index;
|
||||
%token REGION_ALIAS
|
||||
%token LD_FEATURE
|
||||
%token NOLOAD DSECT COPY INFO OVERLAY
|
||||
+%token READONLY
|
||||
%token DEFINED TARGET_K SEARCH_DIR MAP ENTRY
|
||||
%token <integer> NEXT
|
||||
%token SIZEOF ALIGNOF ADDR LOADADDR MAX_K MIN_K
|
||||
@@ -1123,6 +1124,7 @@ type:
|
||||
| COPY { sectype = noalloc_section; }
|
||||
| INFO { sectype = noalloc_section; }
|
||||
| OVERLAY { sectype = noalloc_section; }
|
||||
+ | READONLY { sectype = readonly_section; }
|
||||
;
|
||||
|
||||
atype:
|
||||
diff --git a/ld/ldlang.c b/ld/ldlang.c
|
||||
index 37b64c89ee1..2610be995ca 100644
|
||||
--- a/ld/ldlang.c
|
||||
+++ b/ld/ldlang.c
|
||||
@@ -2639,6 +2639,9 @@ lang_add_section (lang_statement_list_type *ptr,
|
||||
case noalloc_section:
|
||||
flags &= ~SEC_ALLOC;
|
||||
break;
|
||||
+ case readonly_section:
|
||||
+ flags |= SEC_READONLY;
|
||||
+ break;
|
||||
case noload_section:
|
||||
flags &= ~SEC_LOAD;
|
||||
flags |= SEC_NEVER_LOAD;
|
||||
@@ -4232,6 +4235,9 @@ map_input_to_output_sections
|
||||
case noalloc_section:
|
||||
flags = SEC_HAS_CONTENTS;
|
||||
break;
|
||||
+ case readonly_section:
|
||||
+ flags |= SEC_READONLY;
|
||||
+ break;
|
||||
case noload_section:
|
||||
if (bfd_get_flavour (link_info.output_bfd)
|
||||
== bfd_target_elf_flavour)
|
||||
diff --git a/ld/ldlang.h b/ld/ldlang.h
|
||||
index 6fbe16d97d9..f68ae27b409 100644
|
||||
--- a/ld/ldlang.h
|
||||
+++ b/ld/ldlang.h
|
||||
@@ -121,7 +121,8 @@ enum section_type
|
||||
first_overlay_section,
|
||||
overlay_section,
|
||||
noload_section,
|
||||
- noalloc_section
|
||||
+ noalloc_section,
|
||||
+ readonly_section
|
||||
};
|
||||
|
||||
/* This structure holds a list of program headers describing
|
||||
diff --git a/ld/ldlex.l b/ld/ldlex.l
|
||||
index c1b15263587..25b4bcaae01 100644
|
||||
--- a/ld/ldlex.l
|
||||
+++ b/ld/ldlex.l
|
||||
@@ -294,6 +294,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
|
||||
<BOTH,SCRIPT>"SORT_BY_INIT_PRIORITY" { RTOKEN(SORT_BY_INIT_PRIORITY); }
|
||||
<BOTH,SCRIPT>"SORT_NONE" { RTOKEN(SORT_NONE); }
|
||||
<EXPRESSION,BOTH,SCRIPT>"NOLOAD" { RTOKEN(NOLOAD);}
|
||||
+<EXPRESSION,BOTH,SCRIPT>"READONLY" { RTOKEN(READONLY);}
|
||||
<EXPRESSION,BOTH,SCRIPT>"DSECT" { RTOKEN(DSECT);}
|
||||
<EXPRESSION,BOTH,SCRIPT>"COPY" { RTOKEN(COPY);}
|
||||
<EXPRESSION,BOTH,SCRIPT>"INFO" { RTOKEN(INFO);}
|
||||
diff --git a/ld/testsuite/ld-scripts/output-section-types.d b/ld/testsuite/ld-scripts/output-section-types.d
|
||||
new file mode 100644
|
||||
index 00000000000..ab124fa4dd7
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-scripts/output-section-types.d
|
||||
@@ -0,0 +1,13 @@
|
||||
+#ld: -Toutput-section-types.t
|
||||
+#source: align2a.s
|
||||
+#objdump: -h
|
||||
+#target: [is_elf_format]
|
||||
+
|
||||
+#...
|
||||
+ . \.rom.*
|
||||
+[ ]+ALLOC, READONLY
|
||||
+ . \.ro.*
|
||||
+[ ]+CONTENTS, ALLOC, LOAD, READONLY, DATA
|
||||
+ . \.over.*
|
||||
+[ ]+CONTENTS, READONLY
|
||||
+#pass
|
||||
diff --git a/ld/testsuite/ld-scripts/output-section-types.t b/ld/testsuite/ld-scripts/output-section-types.t
|
||||
new file mode 100644
|
||||
index 00000000000..d8fdfda1a03
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-scripts/output-section-types.t
|
||||
@@ -0,0 +1,7 @@
|
||||
+SECTIONS {
|
||||
+ .rom (NOLOAD) : { LONG(1234); }
|
||||
+ .ro (READONLY) : { LONG(5678); }
|
||||
+ .over (OVERLAY) : { LONG(0123); }
|
||||
+ /DISCARD/ : { *(*) }
|
||||
+
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-scripts/script.exp b/ld/testsuite/ld-scripts/script.exp
|
||||
index 961cd08c4b1..ff50199b3ae 100644
|
||||
--- a/ld/testsuite/ld-scripts/script.exp
|
||||
+++ b/ld/testsuite/ld-scripts/script.exp
|
||||
@@ -229,6 +229,7 @@ foreach test_script $test_script_list {
|
||||
|
||||
run_dump_test "align-with-input"
|
||||
run_dump_test "pr20302"
|
||||
+run_dump_test "output-section-types"
|
||||
|
||||
run_dump_test "segment-start" {{name (default)}}
|
||||
run_dump_test "segment-start" {{name (overridden)} \
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
diff -rup binutils.orig/etc/texi2pod.pl binutils-2.37/etc/texi2pod.pl
|
||||
--- binutils.orig/etc/texi2pod.pl 2021-08-10 10:15:38.063964450 +0100
|
||||
+++ binutils-2.37/etc/texi2pod.pl 2021-08-10 16:52:51.705688992 +0100
|
||||
@@ -59,6 +59,8 @@ while ($_ = shift) {
|
||||
$flag = shift;
|
||||
}
|
||||
push (@ipath, $flag);
|
||||
+ } elsif (/^--no-split$/) {
|
||||
+ # ignore option for makeinfo compatibility
|
||||
} elsif (/^-/) {
|
||||
usage();
|
||||
} else {
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
--- binutils.orig/binutils/readelf.c 2020-07-24 15:08:30.317597020 +0100
|
||||
+++ binutils-2.35/binutils/readelf.c 2020-07-24 15:09:39.029155552 +0100
|
||||
@@ -12069,11 +12069,13 @@ print_dynamic_symbol (Filedata *filedata
|
||||
unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
|
||||
|
||||
printf (" %-7s", get_symbol_visibility (vis));
|
||||
+#if 0
|
||||
/* Check to see if any other bits in the st_other field are set.
|
||||
Note - displaying this information disrupts the layout of the
|
||||
table being generated, but for the moment this case is very rare. */
|
||||
if (psym->st_other ^ vis)
|
||||
printf (" [%s] ", get_symbol_other (filedata, psym->st_other ^ vis));
|
||||
+#endif
|
||||
}
|
||||
printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx));
|
||||
|
||||
@@ -12112,7 +12114,17 @@ print_dynamic_symbol (Filedata *filedata
|
||||
version_string);
|
||||
}
|
||||
|
||||
- putchar ('\n');
|
||||
+#if 1
|
||||
+ {
|
||||
+ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
|
||||
+
|
||||
+ /* Check to see if any other bits in the st_other field are set. */
|
||||
+ if (psym->st_other ^ vis)
|
||||
+ printf (" \t[%s]", get_symbol_other (filedata, psym->st_other ^ vis));
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ putchar ('\n');
|
||||
|
||||
if (ELF_ST_BIND (psym->st_info) == STB_LOCAL
|
||||
&& section != NULL
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
From 92608c3a98e943bb0d43408e84d4f419f87b5f1f Mon Sep 17 00:00:00 2001
|
||||
From: Luca Boccassi <luca.boccassi@gmail.com>
|
||||
Date: Wed, 1 Dec 2021 14:44:25 +0000
|
||||
Subject: [PATCH] readelf: recognize FDO Packaging Metadata ELF note
|
||||
|
||||
As defined on: https://systemd.io/COREDUMP_PACKAGE_METADATA/
|
||||
this note will be used starting from Fedora 36. Allow
|
||||
readelf --notes to pretty print it:
|
||||
|
||||
Displaying notes found in: .note.package
|
||||
Owner Data size Description
|
||||
FDO 0x00000039 FDO_PACKAGING_METADATA
|
||||
Packaging Metadata: {"type":"deb","name":"fsverity-utils","version":"1.3-1"}
|
||||
|
||||
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
|
||||
(cherry picked from commit e5382207cdddea07c6456fc1c0e6bea73b3d9947)
|
||||
---
|
||||
binutils/readelf.c | 15 +++++++++++++++
|
||||
include/elf/common.h | 3 +++
|
||||
2 files changed, 18 insertions(+)
|
||||
|
||||
diff --git a/binutils/readelf.c b/binutils/readelf.c
|
||||
index a6073f7ec80..a92dce3114f 100644
|
||||
--- a/binutils/readelf.c
|
||||
+++ b/binutils/readelf.c
|
||||
@@ -18861,6 +18861,8 @@ get_note_type (Filedata * filedata, unsigned e_type)
|
||||
return _("func");
|
||||
case NT_GO_BUILDID:
|
||||
return _("GO BUILDID");
|
||||
+ case FDO_PACKAGING_METADATA:
|
||||
+ return _("FDO_PACKAGING_METADATA");
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -20012,6 +20014,17 @@ print_stapsdt_note (Elf_Internal_Note *pnote)
|
||||
return false;
|
||||
}
|
||||
|
||||
+static bool
|
||||
+print_fdo_note (Elf_Internal_Note * pnote)
|
||||
+{
|
||||
+ if (pnote->descsz > 0 && pnote->type == FDO_PACKAGING_METADATA)
|
||||
+ {
|
||||
+ printf (_(" Packaging Metadata: %.*s\n"), (int) pnote->descsz, pnote->descdata);
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
static const char *
|
||||
get_ia64_vms_note_type (unsigned e_type)
|
||||
{
|
||||
@@ -20741,6 +20754,8 @@ process_note (Elf_Internal_Note * pnote,
|
||||
return print_stapsdt_note (pnote);
|
||||
else if (startswith (pnote->namedata, "CORE"))
|
||||
return print_core_note (pnote);
|
||||
+ else if (startswith (pnote->namedata, "FDO"))
|
||||
+ return print_fdo_note (pnote);
|
||||
else if (((startswith (pnote->namedata, "GA")
|
||||
&& strchr ("*$!+", pnote->namedata[2]) != NULL)
|
||||
|| strchr ("*$!+", pnote->namedata[0]) != NULL)
|
||||
diff --git a/include/elf/common.h b/include/elf/common.h
|
||||
index 0cca28673dd..8ee17c84a97 100644
|
||||
--- a/include/elf/common.h
|
||||
+++ b/include/elf/common.h
|
||||
@@ -953,6 +953,9 @@
|
||||
|
||||
#define NT_FREEBSD_ABI_TAG 1
|
||||
|
||||
+/* Values for FDO .note.package notes as defined on https://systemd.io/COREDUMP_PACKAGE_METADATA/ */
|
||||
+#define FDO_PACKAGING_METADATA 0xcafe1a7e
|
||||
+
|
||||
/* These three macros disassemble and assemble a symbol table st_info field,
|
||||
which contains the symbol binding and symbol type. The STB_ and STT_
|
||||
defines identify the binding and type. */
|
||||
--
|
||||
2.30.2
|
||||
|
||||
33
binutils-remove-ld-protected-func-2-test.patch
Normal file
33
binutils-remove-ld-protected-func-2-test.patch
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-with-gold-2.45.50-96b8a8a633a/ld/testsuite/ld-x86-64/x86-64.exp
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2025-11-20 12:02:23.738336155 +0000
|
||||
+++ binutils-with-gold-2.45.50-96b8a8a633a/ld/testsuite/ld-x86-64/x86-64.exp 2025-11-20 12:03:17.894485264 +0000
|
||||
@@ -1413,14 +1413,6 @@ if { [isnative] && [check_compiler_avail
|
||||
"libprotected-func-2b.so" \
|
||||
] \
|
||||
[list \
|
||||
- "Build protected-func-2 without PIE" \
|
||||
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2b.so" \
|
||||
- "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
|
||||
- { protected-func-1b.c } \
|
||||
- {} \
|
||||
- "protected-func-2" \
|
||||
- ] \
|
||||
- [list \
|
||||
"Build libprotected-func-2c.so" \
|
||||
"-shared" \
|
||||
"-fPIC -Wa,-mx86-used-note=yes" \
|
||||
@@ -1429,14 +1421,6 @@ if { [isnative] && [check_compiler_avail
|
||||
"libprotected-func-2c.so" \
|
||||
] \
|
||||
[list \
|
||||
- "Build protected-func-2a without PIE" \
|
||||
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2c.so" \
|
||||
- "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
|
||||
- { protected-func-1b.c } \
|
||||
- {} \
|
||||
- "protected-func-2a" \
|
||||
- ] \
|
||||
- [list \
|
||||
"Build libprotected-data-1a.so" \
|
||||
"-shared -z noindirect-extern-access" \
|
||||
"-fPIC -Wa,-mx86-used-note=yes" \
|
||||
|
|
@ -123,82 +123,6 @@ diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.29.1/ld
|
|||
0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 13:32:39.408064384 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 15:19:48.097433680 +0000
|
||||
@@ -19,7 +19,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 13:32:39.401064469 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 15:10:56.077760324 +0000
|
||||
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 13:32:39.405064420 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 15:10:42.828916844 +0000
|
||||
@@ -19,6 +19,7 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
+#pass
|
||||
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 13:32:39.416064288 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 15:11:11.550577531 +0000
|
||||
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 13:32:39.411064348 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 15:09:52.664509478 +0000
|
||||
@@ -19,7 +19,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 13:32:39.413064324 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 15:11:22.975442559 +0000
|
||||
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 13:32:39.417064276 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 15:05:02.950932110 +0000
|
||||
|
|
|
|||
269
binutils-riscv-testsuite-fixes.patch
Normal file
269
binutils-riscv-testsuite-fixes.patch
Normal file
|
|
@ -0,0 +1,269 @@
|
|||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:11:38.656875289 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:49:26.786573665 +0000
|
||||
@@ -12,8 +12,8 @@ Program Headers:
|
||||
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
|
||||
RISCV_ATTRIBUT .*
|
||||
LOAD .*
|
||||
-
|
||||
+#...
|
||||
Section to Segment mapping:
|
||||
Segment Sections...
|
||||
00 .riscv.attributes
|
||||
- 01 .text
|
||||
+#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:11:38.659875285 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:42:54.803431287 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:11:38.659875285 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:43:49.540306593 +0000
|
||||
@@ -11,5 +11,5 @@ Disassembly of section .text:
|
||||
[0-9a-f]+ <_start>:
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,gp.*<data_a>
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1.*<data_b>
|
||||
+.*:[ ]+[0-9a-f]+[ ]+mv[ ]+a1,a1
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:11:38.659875285 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:46:55.570899994 +0000
|
||||
@@ -2,4 +2,5 @@
|
||||
#source: pcrel-lo-addend-2a.s
|
||||
#as: -march=rv32ic
|
||||
#ld: -m[riscv_choose_ilp32_emul] --no-relax
|
||||
+#skip: *-*-*
|
||||
#error: .*dangerous relocation: %pcrel_lo overflow with an addend, the value of %pcrel_hi is 0x1000 without any addend, but may be 0x2000 after adding the %pcrel_lo addend
|
||||
diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf.exp binutils-2.40/ld/testsuite/ld-elf/dwarf.exp
|
||||
--- binutils.orig/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 10:11:38.515875516 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 11:08:52.209377332 +0000
|
||||
@@ -29,6 +29,10 @@ if ![is_elf_format] {
|
||||
return
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
# Skip targets where -shared is not supported
|
||||
|
||||
if ![check_shared_lib_support] {
|
||||
diff -rup binutils.orig/ld/testsuite/ld-elf/tls.exp binutils-2.40/ld/testsuite/ld-elf/tls.exp
|
||||
--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2023-02-16 10:11:38.540875476 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-elf/tls.exp 2023-02-16 11:08:56.944369374 +0000
|
||||
@@ -28,6 +28,10 @@ if { !([istarget *-*-linux*]
|
||||
return
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
# Check to see if the C compiler works.
|
||||
if { ![check_compiler_available] } {
|
||||
return
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2023-08-24 07:48:30.429195480 +0100
|
||||
+++ binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp 2023-08-24 07:57:05.535302711 +0100
|
||||
@@ -1409,6 +1409,8 @@ proc objcopy_test_without_global_symbol
|
||||
# The AArch64 and ARM targets preserve mapping symbols
|
||||
# in object files, so they will fail this test.
|
||||
setup_xfail aarch64*-*-* arm*-*-*
|
||||
+# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
+setup_xfail riscv*-*-*
|
||||
|
||||
objcopy_test_without_global_symbol
|
||||
|
||||
--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2023-08-24 07:48:31.808196076 +0100
|
||||
+++ binutils-2.41/ld/testsuite/ld-plugin/plugin.exp 2023-08-24 07:59:30.285716568 +0100
|
||||
@@ -132,6 +132,10 @@ if [is_pecoff_format] {
|
||||
append libs " --image-base=0x10000000"
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
set plugin_tests [list \
|
||||
[list "load plugin" "-plugin $plugin_path \
|
||||
$testobjfiles $libs" "" "" "" {{ld plugin-1.d}} "main.x" ] \
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/compress.exp 2023-12-11 10:09:16.923374463 +0000
|
||||
+++ binutils-2.41/binutils/testsuite/binutils-all/compress.exp 2023-12-12 09:00:15.150036675 +0000
|
||||
@@ -818,6 +818,10 @@ proc test_gnu_debuglink {} {
|
||||
}
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
if {[is_elf_format]} then {
|
||||
test_gnu_debuglink
|
||||
}
|
||||
--- binutils-2.41/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2023-07-03 00:00:00.000000000 +0100
|
||||
+++ binutils.new/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2023-12-12 11:52:54.564057931 +0000
|
||||
@@ -8,10 +8,10 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1,0x[0-9a-f]+
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,[0-9]+ # [0-9a-f]+ <data_g>
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+lui[ ]+a2,0x[0-9a-f]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,a2,[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a3,tp,0 # 0 <data_t>
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2023-12-12 14:21:10.225342926 +0000
|
||||
+++ binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp 2023-12-12 14:22:12.453421499 +0000
|
||||
@@ -1410,7 +1410,7 @@ proc objcopy_test_without_global_symbol
|
||||
# in object files, so they will fail this test.
|
||||
setup_xfail aarch64*-*-* arm*-*-*
|
||||
# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
-setup_xfail riscv*-*-*
|
||||
+# setup_xfail riscv*-*-*
|
||||
|
||||
objcopy_test_without_global_symbol
|
||||
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2024-10-03 15:21:47.926570551 +0100
|
||||
+++ binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2024-10-03 15:24:26.152502612 +0100
|
||||
@@ -8,10 +8,10 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1,0x[0-9a-f]+
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+lui[ ]+a2,0x[0-9a-f]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,a2,[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a3,tp,0 # 0 <data_t>
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2024-10-03 15:21:47.926570551 +0100
|
||||
+++ binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2024-10-03 15:23:54.512530979 +0100
|
||||
@@ -8,7 +8,7 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2024-10-03 15:21:47.926570551 +0100
|
||||
+++ binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2024-10-03 15:25:01.687468496 +0100
|
||||
@@ -11,5 +11,5 @@ Disassembly of section .text:
|
||||
[0-9a-f]+ <_start>:
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,gp.*<data_a>
|
||||
-.*:[ ]+[0-9a-f]+[ ]+mv[ ]+a1,a1
|
||||
+.*:[ ]+[0-9a-f]+[ ]+.*
|
||||
#pass
|
||||
--- binutils-with-gold-2.45.50-79b2b564fec.orig/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.d 2025-09-09 15:52:30.684689609 +0100
|
||||
+++ binutils-with-gold-2.45.50-79b2b564fec/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.d 2025-09-09 15:53:12.837859447 +0100
|
||||
@@ -30,6 +30,6 @@ Disassembly of section \.plt:
|
||||
|
||||
[0-9a-f]+ <bar@plt>:
|
||||
.*:[ ]+[0-9a-f]+[ ]+lpad[ ]+0x0
|
||||
-.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+t3,0x1
|
||||
+.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+t3,0x[0-9a-f]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+ld[ ]+t3,[0-9]+\(t3\) # [0-9a-f]+ <bar>
|
||||
.*:[ ]+[0-9a-f]+[ ]+jalr[ ]+t1,t3
|
||||
diff -rup binutils-with-gold-2.45.50-beab972c07d,orig/binutils/testsuite/binutils-all/objcopy.exp binutils-with-gold-2.45.50-beab972c07d/binutils/testsuite/binutils-all/objcopy.exp
|
||||
--- binutils-with-gold-2.45.50-beab972c07d,orig/binutils/testsuite/binutils-all/objcopy.exp 2025-12-02 12:47:19.063123207 +0000
|
||||
+++ binutils-with-gold-2.45.50-beab972c07d/binutils/testsuite/binutils-all/objcopy.exp 2025-12-04 12:39:26.079989597 +0000
|
||||
@@ -602,14 +602,19 @@ proc strip_test { } {
|
||||
set exec_output [binutils_run $STRIP "$STRIPFLAGS $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string equal "" $exec_output] {
|
||||
- fail $test
|
||||
+ fail "$test (warnings in linker output)"
|
||||
+ verbose $exec_output
|
||||
return
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $NM "-a $NMFLAGS $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string match "*: no symbols*" $exec_output] {
|
||||
- fail $test
|
||||
+
|
||||
+ # The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
+ setup_xfail riscv*-*-*
|
||||
+
|
||||
+ fail "$test (symbols in nm output)"
|
||||
return
|
||||
}
|
||||
|
||||
@@ -659,6 +664,9 @@ proc strip_test_with_saving_a_symbol { }
|
||||
pass $test
|
||||
}
|
||||
|
||||
+# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
+setup_xfail riscv*-*-*
|
||||
+
|
||||
strip_test_with_saving_a_symbol
|
||||
|
||||
# Test stripping an archive.
|
||||
@@ -1503,7 +1519,7 @@ proc objcopy_test_without_global_symbol
|
||||
# in object files, so they will fail this test.
|
||||
setup_xfail aarch64*-*-* arm*-*-*
|
||||
# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
-# setup_xfail riscv*-*-*
|
||||
+setup_xfail riscv*-*-*
|
||||
|
||||
objcopy_test_without_global_symbol
|
||||
|
||||
diff -rup binutils-with-gold-2.45.50-beab972c07d,orig/ld/testsuite/lib/ld-lib.exp binutils-with-gold-2.45.50-beab972c07d/ld/testsuite/lib/ld-lib.exp
|
||||
--- binutils-with-gold-2.45.50-beab972c07d,orig/ld/testsuite/lib/ld-lib.exp 2025-12-02 12:47:19.201090894 +0000
|
||||
+++ binutils-with-gold-2.45.50-beab972c07d/ld/testsuite/lib/ld-lib.exp 2025-12-03 09:30:07.184360005 +0000
|
||||
@@ -1633,6 +1633,12 @@ proc compile_one_cc { src output additio
|
||||
proc check_ctf_available { } {
|
||||
global ctf_available_saved
|
||||
|
||||
+ # Skip CTF tests for the Risc-V target for now, as the
|
||||
+ # tests have not been tweaked to support the riscv format.
|
||||
+ if { [istarget "riscv*-*-linux*"] } {
|
||||
+ return 0
|
||||
+ }
|
||||
+
|
||||
if {![info exists ctf_available_saved]} {
|
||||
set ctf_available_saved 0
|
||||
|
||||
--- fred/binutils/testsuite/lib/binutils-common.exp 2026-03-16 09:18:37.205413649 +0000
|
||||
+++ binutils-with-gold-2.46.50-d712202846b/binutils/testsuite/lib/binutils-common.exp 2026-03-16 09:18:49.559358668 +0000
|
||||
@@ -803,6 +803,9 @@ proc prune_warnings_extra { text } {
|
||||
# Ignore warnings about linking objects with an old sframe format
|
||||
regsub -all {(^|\n)([^\n]* unexpected SFrame format version [^\n]*\n[^\n]* SFrame section ignored\n?)+} $text {\1} text
|
||||
|
||||
+ # Skip warnings about the LTO plugin being needed.
|
||||
+ regsub -all "(^|\n)(\[^\n\]*:\[^\n\]*plugin needed to handle lto object\[^\n\]*\n?)+" $text "\\1" text
|
||||
+
|
||||
return $text
|
||||
}
|
||||
|
||||
--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2026-06-10 15:32:21.012274073 +0100
|
||||
+++ binutils-with-gold-2.46.50-48997323b0f/ld/testsuite/ld-elf/shared.exp 2026-06-10 15:34:41.397899263 +0100
|
||||
@@ -1859,6 +1859,10 @@ run_cc_link_tests [list \
|
||||
"pr29655.so" \
|
||||
] \
|
||||
]
|
||||
+
|
||||
+# FIXME: Find out why the Risc-V fails this test.
|
||||
+setup_xfail "riscv64-*-*"
|
||||
+
|
||||
# PR 29655 (cont.): Check that in PIC code linked as PDE taking the address
|
||||
# of a function defined in a DSO results in the function address (from GOT)
|
||||
# and not the "canonical PLT" address from the PDE.
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
--- binutils.orig/bfd/elf.c 2018-10-19 11:42:10.107277490 +0100
|
||||
+++ binutils-2.31.1/bfd/elf.c 2018-10-19 11:44:33.607105801 +0100
|
||||
@@ -830,7 +830,13 @@ setup_group (bfd *abfd, Elf_Internal_Shd
|
||||
}
|
||||
}
|
||||
|
||||
- if (elf_group_name (newsect) == NULL)
|
||||
+ if (elf_group_name (newsect) == NULL
|
||||
+ /* OS specific sections might be in a group (eg ARM's ARM_EXIDX section)
|
||||
+ but they will not have been added to the group because they do not
|
||||
+ have contents that the ELF code in the BFD library knows how to
|
||||
+ process. This is OK though - we rely upon the target backends to
|
||||
+ handle these sections for us. */
|
||||
+ && hdr->sh_type < SHT_LOOS)
|
||||
{
|
||||
/* xgettext:c-format */
|
||||
_bfd_error_handler (_("%pB: no group info for section '%pA'"),
|
||||
@@ -936,7 +942,8 @@ _bfd_elf_setup_sections (bfd *abfd)
|
||||
else if (idx->shdr->bfd_section)
|
||||
elf_sec_group (idx->shdr->bfd_section) = shdr->bfd_section;
|
||||
else if (idx->shdr->sh_type != SHT_RELA
|
||||
- && idx->shdr->sh_type != SHT_REL)
|
||||
+ && idx->shdr->sh_type != SHT_REL
|
||||
+ && idx->shdr->sh_type < SHT_LOOS)
|
||||
{
|
||||
/* There are some unknown sections in the group. */
|
||||
_bfd_error_handler
|
||||
13
binutils-suppress-ld-align-tests.patch
Normal file
13
binutils-suppress-ld-align-tests.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
--- binutils.orig/ld/testsuite/ld-elf/linux-x86.exp 2024-01-24 11:52:35.288014542 +0000
|
||||
+++ binutils-2.41/ld/testsuite/ld-elf/linux-x86.exp 2024-01-24 17:31:39.356167357 +0000
|
||||
@@ -225,6 +225,10 @@ if { [check_ifunc_attribute_available] }
|
||||
# Old gcc silently ignores __attribute__ ((aligned())) with too big alignment.
|
||||
proc compiler_honours_aligned { } {
|
||||
global CC_FOR_TARGET READELF srcdir subdir
|
||||
+
|
||||
+ # Temporary fix for CentOS-10 kernel issue. (RHEL-22466)
|
||||
+ return 0
|
||||
+
|
||||
ld_compile $CC_FOR_TARGET $srcdir/$subdir/p_align-1.c tmpdir/p_align-1.o
|
||||
set output [run_host_cmd "$READELF" "-SW tmpdir/p_align-1.o"]
|
||||
if { [regexp { [.]data *PROGBITS .* 8388608[\n]} $output] } {
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,38 +0,0 @@
|
|||
diff -up binutils-2.25.orig/bfd/configure.ac binutils-2.25/bfd/configure.ac
|
||||
--- binutils-2.25.orig/bfd/configure.ac 2014-12-24 10:34:45.590491143 +0000
|
||||
+++ binutils-2.25/bfd/configure.ac 2014-12-24 10:36:12.997981992 +0000
|
||||
@@ -183,11 +183,13 @@ if test "x${ac_cv_sizeof_long}" = "x8";
|
||||
BFD_HOST_64BIT_LONG=1
|
||||
test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"
|
||||
test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"
|
||||
-elif test "x${ac_cv_sizeof_long_long}" = "x8"; then
|
||||
+fi
|
||||
+if test "x${ac_cv_sizeof_long_long}" = "x8"; then
|
||||
BFD_HOST_64BIT_LONG_LONG=1
|
||||
test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
|
||||
test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
|
||||
- if test "x${ac_cv_sizeof_void_p}" = "x8"; then
|
||||
+ if test "x${ac_cv_sizeof_void_p}" = "x8" \
|
||||
+ -a "x${ac_cv_sizeof_long}" != "x8"; then
|
||||
BFD_HOSTPTR_T="unsigned long long"
|
||||
fi
|
||||
fi
|
||||
diff -up ../binutils-2.20.51.0.7.original/bfd/configure ./bfd/configure
|
||||
--- a/bfd/configure 2010-04-08 15:23:58.000000000 +0100
|
||||
+++ b/bfd/configure 2010-04-08 15:24:06.000000000 +0100
|
||||
@@ -12819,11 +12819,13 @@
|
||||
BFD_HOST_64BIT_LONG=1
|
||||
test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"
|
||||
test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"
|
||||
-elif test "x${ac_cv_sizeof_long_long}" = "x8"; then
|
||||
+fi
|
||||
+if test "x${ac_cv_sizeof_long_long}" = "x8"; then
|
||||
BFD_HOST_64BIT_LONG_LONG=1
|
||||
test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
|
||||
test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
|
||||
- if test "x${ac_cv_sizeof_void_p}" = "x8"; then
|
||||
+ if test "x${ac_cv_sizeof_void_p}" = "x8" \
|
||||
+ -a "x${ac_cv_sizeof_long}" != "x8"; then
|
||||
BFD_HOSTPTR_T="unsigned long long"
|
||||
fi
|
||||
fi
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
--- binutils-2.26.orig/bfd/Makefile.am 2016-01-25 10:11:33.505289018 +0000
|
||||
+++ binutils-2.26/bfd/Makefile.am 2016-01-25 10:13:23.489964145 +0000
|
||||
@@ -1043,8 +1043,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
|
||||
diff -rup binutils.orig/bfd/Makefile.am binutils-2.38/bfd/Makefile.am
|
||||
--- binutils.orig/bfd/Makefile.am 2022-02-09 14:10:42.659300681 +0000
|
||||
+++ binutils-2.38/bfd/Makefile.am 2022-02-09 14:12:40.562532916 +0000
|
||||
@@ -977,8 +977,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
|
||||
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
|
||||
@echo "creating $@"
|
||||
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
$(AM_V_GEN)\
|
||||
bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
- bfd_version_string="\"$(VERSION)\"" ;\
|
||||
- bfd_soversion="$(VERSION)" ;\
|
||||
+ bfd_version_string="\"$(VERSION)-%{release}\"" ;\
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
bfd_version_package="\"$(PKGVERSION)\"" ;\
|
||||
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
|
||||
. $(srcdir)/development.sh ;\
|
||||
@@ -1055,7 +1055,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
@@ -989,7 +989,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
fi ;\
|
||||
$(SED) -e "s,@bfd_version@,$$bfd_version," \
|
||||
-e "s,@bfd_version_string@,$$bfd_version_string," \
|
||||
|
|
@ -20,12 +21,13 @@
|
|||
-e "s,@report_bugs_to@,$$report_bugs_to," \
|
||||
< $(srcdir)/version.h > $@; \
|
||||
echo "$${bfd_soversion}" > libtool-soversion
|
||||
--- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:11:33.505289018 +0000
|
||||
+++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:14:17.818297941 +0000
|
||||
@@ -2111,8 +2111,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
|
||||
diff -rup binutils.orig/bfd/Makefile.in binutils-2.38/bfd/Makefile.in
|
||||
--- binutils.orig/bfd/Makefile.in 2022-02-09 14:10:42.653300720 +0000
|
||||
+++ binutils-2.38/bfd/Makefile.in 2022-02-09 14:19:03.362040188 +0000
|
||||
@@ -2094,8 +2094,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC
|
||||
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
|
||||
@echo "creating $@"
|
||||
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
$(AM_V_GEN)\
|
||||
bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
- bfd_version_string="\"$(VERSION)\"" ;\
|
||||
- bfd_soversion="$(VERSION)" ;\
|
||||
+ bfd_version_string="\"$(VERSION)-%{release}\"" ;\
|
||||
|
|
@ -33,7 +35,7 @@
|
|||
bfd_version_package="\"$(PKGVERSION)\"" ;\
|
||||
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
|
||||
. $(srcdir)/development.sh ;\
|
||||
@@ -2123,7 +2123,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
@@ -2106,7 +2106,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
fi ;\
|
||||
$(SED) -e "s,@bfd_version@,$$bfd_version," \
|
||||
-e "s,@bfd_version_string@,$$bfd_version_string," \
|
||||
|
|
|
|||
2165
binutils.spec
2165
binutils.spec
File diff suppressed because it is too large
Load diff
32545
binutils.unicode.patch
32545
binutils.unicode.patch
File diff suppressed because it is too large
Load diff
|
|
@ -11,5 +11,5 @@ product_versions:
|
|||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-fast-lane.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-slow-lane.functional}
|
||||
|
|
|
|||
26
plans/build-gating.fmf
Normal file
26
plans/build-gating.fmf
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#
|
||||
# Build/PR gating tests for binutils
|
||||
#
|
||||
|
||||
/common:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/binutils.git
|
||||
ref: main
|
||||
name: /plans/build-gating/common
|
||||
|
||||
/kernel-rebuild:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/binutils.git
|
||||
ref: main
|
||||
name: /plans/build-gating/kernel-rebuild
|
||||
|
||||
adjust+:
|
||||
- because: "Plan to be ran when executed locally, or executed by CI system to gate a build or PR."
|
||||
# `commit` is used by Fedora CI, CentOS Stream CI, `build` by BaseOS CI
|
||||
when: >-
|
||||
trigger is defined
|
||||
and trigger != commit
|
||||
and trigger != build
|
||||
enabled: false
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
summary: CI Gating Plan
|
||||
discover:
|
||||
how: fmf
|
||||
directory: tests
|
||||
execute:
|
||||
how: beakerlib
|
||||
18
plans/regression.fmf
Normal file
18
plans/regression.fmf
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#
|
||||
# Build/PR gating tests for binutils
|
||||
#
|
||||
|
||||
/common:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/binutils.git
|
||||
ref: main
|
||||
name: /plans/regression
|
||||
|
||||
adjust+:
|
||||
- because: "Plan to be ran when executed locally, or executed by CI system after updating an erratum/bodhi update."
|
||||
# `build` is used by Bodhi
|
||||
when: >-
|
||||
trigger is defined
|
||||
and trigger != build
|
||||
enabled: false
|
||||
2
sources
2
sources
|
|
@ -1,2 +1,2 @@
|
|||
SHA512 (binutils-2.37.tar.xz) = 5c11aeef6935860a6819ed3a3c93371f052e52b4bdc5033da36037c1544d013b7f12cb8d561ec954fe7469a68f1b66f1a3cd53d5a3af7293635a90d69edd15e7
|
||||
SHA512 (binutils-with-gold-2.47.50-48c933a69a8.tar.xz) = c4300e4881227c431c0bbbb949a5ee5bc113701f993766418b152df7d46d9df378ebace9efffcb6e1f0b7e72ad716bbcccf5b6aa55851dc28216555b242d18a0
|
||||
SHA512 (binutils-2.19.50.0.1-output-format.sed) = 2f8686b0c8af13c98cda056824c2820416f6e2d003f70b78ccf5314525b9ee3684d421dfa83e638a2d42d06ea4d4bdaf5226b64d6ec26f7ff59c44ffb2a23dd2
|
||||
|
|
|
|||
|
|
@ -1,67 +0,0 @@
|
|||
|
||||
# Note - this is an rpm spec file, but it has been renamed in order to avoid
|
||||
# conflict with the real binutils.spec file.
|
||||
#
|
||||
# Its only use is to build a set of cross-binutils rpms by putting it into
|
||||
# the SPECS directory of an rpmbuild tree, installing the binutils source
|
||||
# rpm into the SOURCES directory and then running:
|
||||
#
|
||||
# rpmbuild -bb spec.binutils.cross
|
||||
|
||||
Summary: A meta collection of GNU binutils executables for cross builds
|
||||
Name: cross-binutils
|
||||
License: GPLv3+
|
||||
URL: https://sourceware.org/binutils
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# Configurable settings - adjust to match your needs:
|
||||
#
|
||||
|
||||
Version: 2.30
|
||||
Release: 89.el8
|
||||
|
||||
# The list of cross architectures to build.
|
||||
# Note: this list assumes that we are building on an x86_64-linux-gnu host.
|
||||
|
||||
%define arch_list aarch64-linux-gnu ppc64le-linux-gnu s390x-linux-gnu
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%define binutils_source_rpm binutils-%{version}-%{release}.src.rpm
|
||||
|
||||
Source: %{binutils_source_rpm}
|
||||
|
||||
# Provides: bundled(libiberty)
|
||||
|
||||
BuildRequires: autoconf automake
|
||||
BuildRequires: perl, sed, coreutils
|
||||
BuildRequires: gcc, bison
|
||||
BuildRequires: gettext, flex, zlib-devel
|
||||
BuildRequires: findutils, texinfo
|
||||
BuildRequires: dejagnu, zlib-static, glibc-static, sharutils, bc
|
||||
# BuildRequires: elfutils-debuginfod-client-devel
|
||||
BuildRequires: rpm-build
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%description
|
||||
Provides a collection of cross built binutils for the targets
|
||||
supported by RHEL (aarch64, ppc64le, s390x).
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%build
|
||||
|
||||
# Install the binutils sources.
|
||||
rpm -ivh %{_sourcedir}/%{binutils_source_rpm}
|
||||
|
||||
# Build each set of cross binutils individually.
|
||||
for f in %{arch_list}; do
|
||||
rpmbuild -bb --define "binutils_target $f" %{_specdir}/binutils.spec --without testsuite --without gold
|
||||
done
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
%changelog
|
||||
* Wed Nov 11 2020 Nick Clifton <nickc@redhat.com> - 2.35.1-14
|
||||
- First release of cross binutils rpm.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
The test's Makefiles are not used in Fedora CI infrastructure. But are kept here
|
||||
for backward compatibility with traditional beakerlib test harness in RHEL.
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Testcases for this bugzilla were provided by Jakub Jelinek <jakub@redhat.com>
|
||||
# I've only wrapped them to RHTS
|
||||
|
||||
TOPLEVEL_NAMESPACE=/tools
|
||||
PACKAGE_NAME=binutils
|
||||
RELATIVE_PATH=bugzillas/241252
|
||||
|
||||
export TESTVERSION=1.0
|
||||
|
||||
export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
FILES=$(METADATA) \
|
||||
runtest.sh \
|
||||
Makefile \
|
||||
x.i \
|
||||
y.i
|
||||
|
||||
run: $(FILES) #build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x ./runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@touch $(METADATA)
|
||||
@echo "Owner: Michal Nowak <mnowak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Description: Regression test for bz241252." >> $(METADATA)
|
||||
@echo "TestTime: 3m" >> $(METADATA)
|
||||
@echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
|
||||
@echo "Requires: $(PACKAGE_NAME) gcc" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
summary: Regression test for bz241252.
|
||||
contact: Michal Nowak <mnowak@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
- gcc
|
||||
duration: 3m
|
||||
extra-summary: /tools/binutils/bugzillas/241252
|
||||
extra-task: /tools/binutils/bugzillas/241252
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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 rhts environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="binutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup Setup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlShowRunningKernel
|
||||
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
cp x.i y.i $TmpDir
|
||||
rlRun "pushd $TmpDir"
|
||||
|
||||
rlRun "gcc -c -O2 -fpic -o x.o x.i -g" 0 "Compile test case 'x'"
|
||||
rlRun "gcc -c -O2 -fpic -o y.o y.i -g" 0 "Compile test case 'y'"
|
||||
rlRun "gcc -Wl,--unique -o x [xy].o" 0 "Link 'x' and 'y'"
|
||||
|
||||
# Note: debug_ranges replaced by debug_rnglist (since DWARF 5 in Fedora 34)
|
||||
rlLogInfo 'x.o + y.o:'
|
||||
rlLogInfo "$( readelf -WS [xy].o | grep debug_rnglist | grep PROGBITS )"
|
||||
rlLogInfo 'x:'
|
||||
rlLogInfo "$( readelf -WS x | grep debug_rnglist )"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest Testing
|
||||
if [ $( readelf -WS [xy].o | grep debug_rnglist | grep PROGBITS | wc -l ) -eq 2 ] \
|
||||
&& [ $( readelf -WS x | grep debug_rnglist | wc -l ) -eq 1 ]; then
|
||||
rlPass "Debug ranges sections were merged"
|
||||
else
|
||||
rlFail "Debug ranges sections were not merged"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup Cleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir $rlRun_LOG" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
extern void __assert_fail (const char *, const char *, unsigned int, const char *)
|
||||
__attribute__ ((__nothrow__, __noreturn__));
|
||||
|
||||
struct gst;
|
||||
struct gs;
|
||||
|
||||
extern void bar (void *) __attribute__ ((__nothrow__));
|
||||
|
||||
typedef int (*gf) (struct gst *, struct gs *,
|
||||
const unsigned char **, const unsigned char *,
|
||||
unsigned char **, unsigned long *, int, int);
|
||||
|
||||
struct gst
|
||||
{
|
||||
gf fct;
|
||||
int min_needed_from;
|
||||
};
|
||||
|
||||
struct gs
|
||||
{
|
||||
unsigned char *outbuf;
|
||||
unsigned char *outbufend;
|
||||
int flags;
|
||||
int invocation_counter;
|
||||
int internal_use;
|
||||
};
|
||||
|
||||
typedef struct gi
|
||||
{
|
||||
unsigned long nsteps;
|
||||
struct gst *steps;
|
||||
struct gs data [10];
|
||||
} *gt;
|
||||
|
||||
int
|
||||
foo (gt cd, const unsigned char **inbuf,
|
||||
const unsigned char *inbufend, unsigned char **outbuf,
|
||||
unsigned char *outbufend, unsigned long *irreversible)
|
||||
{
|
||||
unsigned long last_step;
|
||||
int result;
|
||||
last_step = cd->nsteps - 1;
|
||||
*irreversible = 0;
|
||||
cd->data[last_step].outbuf = outbuf != ((void *)0) ? *outbuf : ((void *)0);
|
||||
cd->data[last_step].outbufend = outbufend;
|
||||
gf fct = cd->steps->fct;
|
||||
if (inbuf == ((void *)0) || *inbuf == ((void *)0))
|
||||
result = (bar ((void *) (fct)), (*(fct)) (cd->steps, cd->data, ((void *)0), ((void *)0), ((void *)0), irreversible, cd->data[last_step].outbuf == ((void *)0) ? 2 : 1, 0));
|
||||
else
|
||||
{
|
||||
const unsigned char *last_start;
|
||||
((outbuf != ((void *)0) && *outbuf != ((void *)0)) ? (void) (0) : __assert_fail ("outbuf != ((void *)0) && *outbuf != ((void *)0)", "gconv.c", 67, "foo"));
|
||||
do
|
||||
{
|
||||
last_start = *inbuf;
|
||||
result = (bar ((void *) (fct)), (*(fct)) (cd->steps, cd->data, inbuf, inbufend, ((void *)0), irreversible, 0, 0));
|
||||
}
|
||||
while (result == 4 && last_start != *inbuf
|
||||
&& *inbuf + cd->steps->min_needed_from <= inbufend);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
extern void __assert_fail (const char *, const char *, unsigned int, const char *)
|
||||
__attribute__ ((__nothrow__, __noreturn__));
|
||||
|
||||
struct gst;
|
||||
struct gs;
|
||||
|
||||
extern void bar (void *) __attribute__ ((__nothrow__));
|
||||
|
||||
void bar (void *x)
|
||||
{
|
||||
}
|
||||
|
||||
typedef int (*gf) (struct gst *, struct gs *,
|
||||
const unsigned char **, const unsigned char *,
|
||||
unsigned char **, unsigned long *, int, int);
|
||||
|
||||
struct gst
|
||||
{
|
||||
gf fct;
|
||||
int min_needed_from;
|
||||
};
|
||||
|
||||
struct gs
|
||||
{
|
||||
unsigned char *outbuf;
|
||||
unsigned char *outbufend;
|
||||
int flags;
|
||||
int invocation_counter;
|
||||
int internal_use;
|
||||
};
|
||||
|
||||
typedef struct gi
|
||||
{
|
||||
unsigned long nsteps;
|
||||
struct gst *steps;
|
||||
struct gs data [10];
|
||||
} *gt;
|
||||
|
||||
int
|
||||
baz (gt cd, const unsigned char **inbuf,
|
||||
const unsigned char *inbufend, unsigned char **outbuf,
|
||||
unsigned char *outbufend, unsigned long *irreversible)
|
||||
{
|
||||
unsigned long last_step;
|
||||
int result;
|
||||
last_step = cd->nsteps - 1;
|
||||
*irreversible = 0;
|
||||
cd->data[last_step].outbuf = outbuf != ((void *)0) ? *outbuf : ((void *)0);
|
||||
cd->data[last_step].outbufend = outbufend;
|
||||
gf fct = cd->steps->fct;
|
||||
if (inbuf == ((void *)0) || *inbuf == ((void *)0))
|
||||
result = (bar ((void *) (fct)), (*(fct)) (cd->steps, cd->data, ((void *)0), ((void *)0), ((void *)0), irreversible, cd->data[last_step].outbuf == ((void *)0) ? 2 : 1, 0));
|
||||
else
|
||||
{
|
||||
const unsigned char *last_start;
|
||||
((outbuf != ((void *)0) && *outbuf != ((void *)0)) ? (void) (0) : __assert_fail ("outbuf != ((void *)0) && *outbuf != ((void *)0)", "gconv.c", 67, "foo"));
|
||||
do
|
||||
{
|
||||
last_start = *inbuf;
|
||||
result = (bar ((void *) (fct)), (*(fct)) (cd->steps, cd->data, inbuf, inbufend, ((void *)0), irreversible, 0, 0));
|
||||
}
|
||||
while (result == 4 && last_start != *inbuf
|
||||
&& *inbuf + cd->steps->min_needed_from <= inbufend);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
#
|
||||
# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
|
||||
# is made available to anyone wishing to use, modify, copy, or
|
||||
# redistribute it subject to the terms and conditions of the GNU General
|
||||
# Public License v.2.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Author: Michal Nowak <mnowak@redhat.com>
|
||||
|
||||
# The toplevel namespace within which the test lives.
|
||||
TOPLEVEL_NAMESPACE=tools
|
||||
|
||||
# The name of the package under test:
|
||||
PACKAGE_NAME=binutils
|
||||
|
||||
# The path of the test below the package:
|
||||
RELATIVE_PATH=Sanity/430856-libbfd.a-not-compiled-with-fPIC
|
||||
|
||||
# Version of the Test. Used with make tag.
|
||||
export TESTVERSION=1.1
|
||||
|
||||
# The combined namespace of the test.
|
||||
export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
|
||||
|
||||
|
||||
# A phony target is one that is not really the name of a file.
|
||||
# It is just a name for some commands to be executed when you
|
||||
# make an explicit request. There are two reasons to use a
|
||||
# phony target: to avoid a conflict with a file of the same
|
||||
# name, and to improve performance.
|
||||
.PHONY: all install download clean
|
||||
|
||||
# executables to be built should be added here, they will be generated on the system under test.
|
||||
BUILT_FILES=
|
||||
|
||||
# data files, .c files, scripts anything needed to either compile the test and/or run it.
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE bz430856.tar.gz
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x ./runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ *.rpm $(BUILT_FILES)
|
||||
|
||||
# You may need to add other targets e.g. to build executables from source code
|
||||
# Add them here:
|
||||
|
||||
|
||||
# Include Common Makefile
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
# Generate the testinfo.desc here:
|
||||
$(METADATA): Makefile
|
||||
@touch $(METADATA)
|
||||
# Change to the test owner's name
|
||||
@echo "Owner: Michal Nowak <mnowak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Description: libbfd.a not compiled with -fPIC">> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
|
||||
# add any other packages for which your test ought to run here
|
||||
@echo "Requires: $(PACKAGE_NAME)" >> $(METADATA)
|
||||
@echo "Requires: $(PACKAGE_NAME)-devel" >> $(METADATA)
|
||||
@echo "Requires: gcc glibc-headers" >> $(METADATA)
|
||||
# add any other requirements for the script to run here
|
||||
|
||||
# You may need other fields here; see the documentation
|
||||
rhts-lint $(METADATA)
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
Would it be possible to have /usr/lib64/libbfd.a in binutils
|
||||
compiled with -fPIC? Otherwise, shared apps can't link against
|
||||
libbfd. In binutils.spec, libiberty.a is already recreated
|
||||
with -fPIC, is there some reason the same isn't done for
|
||||
libbfd?
|
||||
|
||||
From binutils.spec:
|
||||
|
||||
# Rebuild libiberty.a with -fPIC
|
||||
make -C libiberty clean
|
||||
make CFLAGS="-g -fPIC $RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64" -C libiberty
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
summary: libbfd.a not compiled with -fPIC
|
||||
description: "Would it be possible to have /usr/lib64/libbfd.a in binutils\ncompiled\
|
||||
\ with -fPIC? Otherwise, shared apps can't link against\nlibbfd. In binutils.spec,\
|
||||
\ libiberty.a is already recreated \nwith -fPIC, is there some reason the same\
|
||||
\ isn't done for \nlibbfd?\n\nFrom binutils.spec:\n\n # Rebuild libiberty.a with\
|
||||
\ -fPIC\n make -C libiberty clean\n make CFLAGS=\"-g -fPIC $RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64\"\
|
||||
\ -C libiberty\n"
|
||||
contact: Michal Nowak <mnowak@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
- binutils-devel
|
||||
- gcc
|
||||
- glibc-headers
|
||||
duration: 5m
|
||||
extra-summary: /tools/binutils/Sanity/430856-libbfd.a-not-compiled-with-fPIC
|
||||
extra-task: /tools/binutils/Sanity/430856-libbfd.a-not-compiled-with-fPIC
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
CC=gcc
|
||||
CFLAGS=-g -Wall
|
||||
|
||||
all: test
|
||||
|
||||
libbfdtest.so bfdtest: Makefile
|
||||
|
||||
libbfdtest.so: libbfdtest.c libbfdtest.h
|
||||
$(CC) $(CFLAGS) -shared -o $@ -fPIC $< -lbfd -liberty
|
||||
|
||||
bfdtest: bfdtest.c libbfdtest.h libbfdtest.so
|
||||
$(CC) -o $@ $< -L. -Wl,-rpath,. -lbfdtest -ldl
|
||||
|
||||
.PHONY: test
|
||||
test: bfdtest
|
||||
./$<
|
||||
@echo OK
|
||||
|
||||
clean:
|
||||
$(RM) libbfdtest.so bfdtest
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
#include "libbfdtest.h"
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
return libbfdtest () ? 0 : 1;
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#include <bfd.h>
|
||||
|
||||
#include "libbfdtest.h"
|
||||
|
||||
int
|
||||
libbfdtest (void)
|
||||
{
|
||||
bfd_set_error (bfd_error_no_error);
|
||||
return bfd_get_error () == bfd_error_no_error;
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
extern int libbfdtest (void);
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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 rhts environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="binutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlShowPackageVersion $PACKAGE
|
||||
rlShowRunningKernel
|
||||
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
cp reproducer/* $TmpDir
|
||||
rlRun "pushd $TmpDir"
|
||||
rlRun "make clean" 0 "Make clean"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "make" 0 "Build the files"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
|
||||
# is made available to anyone wishing to use, modify, copy, or
|
||||
# redistribute it subject to the terms and conditions of the GNU General
|
||||
# Public License v.2.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Author: Michal Nowak <mnowak@redhat.com>
|
||||
|
||||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
|
||||
# Example Makefile for RHTS #
|
||||
# This example is geared towards a test for a specific package #
|
||||
# It does most of the work for you, but may require further coding #
|
||||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
|
||||
|
||||
# The toplevel namespace within which the test lives.
|
||||
TOPLEVEL_NAMESPACE=tools
|
||||
|
||||
# The name of the package under test:
|
||||
PACKAGE_NAME=binutils
|
||||
|
||||
# The path of the test below the package:
|
||||
RELATIVE_PATH=Sanity/435078-output-of-strings-0-n-is-incorrect
|
||||
|
||||
# Version of the Test. Used with make tag.
|
||||
export TESTVERSION=1.1
|
||||
|
||||
# The combined namespace of the test.
|
||||
export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
|
||||
|
||||
|
||||
# A phony target is one that is not really the name of a file.
|
||||
# It is just a name for some commands to be executed when you
|
||||
# make an explicit request. There are two reasons to use a
|
||||
# phony target: to avoid a conflict with a file of the same
|
||||
# name, and to improve performance.
|
||||
.PHONY: all install download clean
|
||||
|
||||
# executables to be built should be added here, they will be generated on the system under test.
|
||||
BUILT_FILES=
|
||||
|
||||
# data files, .c files, scripts anything needed to either compile the test and/or run it.
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x ./runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ *.rpm $(BUILT_FILES)
|
||||
|
||||
# You may need to add other targets e.g. to build executables from source code
|
||||
# Add them here:
|
||||
|
||||
|
||||
# Include Common Makefile
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
# Generate the testinfo.desc here:
|
||||
$(METADATA): Makefile
|
||||
@touch $(METADATA)
|
||||
# Change to the test owner's name
|
||||
@echo "Owner: Michal Nowak <mnowak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Description: The output of "strings -0 file" is in loop and "-n 0xA" cannot be correctly recognized">> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
|
||||
# add any other packages for which your test ought to run here
|
||||
@echo "Requires: $(PACKAGE_NAME)" >> $(METADATA)
|
||||
# add any other requirements for the script to run here
|
||||
|
||||
# You may need other fields here; see the documentation
|
||||
rhts-lint $(METADATA)
|
||||
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
Use "strings -0 file", the output will be in loop.
|
||||
And "strings -n 0xA file" will report error as "invalid number 0xA"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
summary: The output of strings -0 file is in loop and -n 0xA cannot be correctly recognized
|
||||
description: |
|
||||
Use "strings -0 file", the output will be in loop.
|
||||
And "strings -n 0xA file" will report error as "invalid number 0xA"
|
||||
contact: Michal Nowak <mnowak@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
duration: 5m
|
||||
extra-summary: /tools/binutils/Sanity/435078-output-of-strings-0-n-is-incorrect
|
||||
extra-task: /tools/binutils/Sanity/435078-output-of-strings-0-n-is-incorrect
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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 rhts environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="binutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup Setup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlShowPackageVersion $PACKAGE
|
||||
rlShowRunningKernel
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlRun "echo -e \"asdjkhsd\nsdsdsdssd\n\nsdsd\n\" > tstfile" 0 "Generating test file tstfile"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest TestingOne
|
||||
rlRun "strings -0 tstfile > errorfile 2>&1 &"
|
||||
rlRun "sleep 5"
|
||||
rlRun "jobs"
|
||||
rlRun "kill -9 %1" 1 "strings in the loop"
|
||||
rlAssertGrep "minim" errorfile
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest TestingTwo
|
||||
rlRun "strings -n 0xA tstfile" 0 "echo \"PASS: tstfile processed.\""
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup Cleanup
|
||||
rlBundleLogs "binutils-outputs" errorfile tstfile
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir $rlRun_LOG" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Author: Michal Nowak <mnowak@redhat.com>
|
||||
|
||||
|
||||
TOPLEVEL_NAMESPACE=/tools
|
||||
PACKAGE_NAME=binutils
|
||||
RELATIVE_PATH=Sanity/480009-when-mistaking-argument-of-strings
|
||||
|
||||
export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x ./runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
|
||||
$(METADATA): Makefile
|
||||
@touch $(METADATA)
|
||||
@echo "Owner: Michal Nowak <mnowak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Description: When mistaking the argument of strings command , the same error message is output." >> $(METADATA)
|
||||
@echo "Bug: 480009" >> $(METADATA)
|
||||
@echo "Type: Sanity" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
|
||||
@echo "Requires: $(PACKAGE_NAME)" >> $(METADATA)
|
||||
@echo "License: GPLv3+" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHEL5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
[RHEL5.2]
|
||||
# strings -n file1
|
||||
strings: invalid integer argument file1
|
||||
|
||||
# strings --bytes file1
|
||||
strings: invalid integer argument file1
|
||||
|
||||
# strings -n 0
|
||||
strings: invalid number 0
|
||||
|
||||
# strings --bytes 0
|
||||
strings: invalid number 0
|
||||
|
||||
|
||||
[RHEL5.3]
|
||||
# strings -n file1
|
||||
strings: invalid minimum string length 0
|
||||
|
||||
# strings --bytes file1
|
||||
strings: invalid minimum string length 0
|
||||
|
||||
# strings -n 0
|
||||
strings: invalid minimum string length 0
|
||||
|
||||
# strings --bytes 0
|
||||
strings: invalid minimum string length 0
|
||||
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
summary: When mistaking the argument of strings command , the same error message is
|
||||
output.
|
||||
description: |+
|
||||
[RHEL5.2]
|
||||
# strings -n file1
|
||||
strings: invalid integer argument file1
|
||||
|
||||
# strings --bytes file1
|
||||
strings: invalid integer argument file1
|
||||
|
||||
# strings -n 0
|
||||
strings: invalid number 0
|
||||
|
||||
# strings --bytes 0
|
||||
strings: invalid number 0
|
||||
|
||||
|
||||
[RHEL5.3]
|
||||
# strings -n file1
|
||||
strings: invalid minimum string length 0
|
||||
|
||||
# strings --bytes file1
|
||||
strings: invalid minimum string length 0
|
||||
|
||||
# strings -n 0
|
||||
strings: invalid minimum string length 0
|
||||
|
||||
# strings --bytes 0
|
||||
strings: invalid minimum string length 0
|
||||
|
||||
contact: Michal Nowak <mnowak@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
duration: 5m
|
||||
link:
|
||||
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=480009
|
||||
extra-summary: /tools/binutils/Sanity/480009-when-mistaking-argument-of-strings
|
||||
extra-task: /tools/binutils/Sanity/480009-when-mistaking-argument-of-strings
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
#
|
||||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Author: Michal Nowak <mnowak@redhat.com>
|
||||
|
||||
# source the test script helpers
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE=binutils
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlShowPackageVersion $PACKAGE
|
||||
rlShowRunningKernel
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "#1: strings -n file1"
|
||||
rlRun "strings -n file1 2>&1 | grep 'invalid integer argument file1'" 0 "Produced expected error msg: 'strings: invalid integer argument file1'"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "#2: strings --bytes file1"
|
||||
rlRun "strings --bytes file1 2>&1 | grep 'invalid integer argument file1'" 0 "Produced expected error msg: 'strings: invalid integer argument file1'"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "#3: strings -n 0"
|
||||
rlRun "strings -n 0 2>&1 | grep 'invalid minimum string length 0'" 0 "Produced expected error msg: 'strings: invalid minimum string length 0'"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "#4: strings --bytes 0"
|
||||
rlRun "strings --bytes 0 2>&1 | grep 'invalid minimum string length 0'" 0 "Produced expected error msg: 'strings: invalid minimum string length 0'"
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/binutils/Regressions/readelf/509124-holes-in-debuginfo
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE ascend.C test.c
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x ./runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Michal Nowak <mnowak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: holes in debuginfo" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 15m" >> $(METADATA)
|
||||
@echo "RunFor: binutils" >> $(METADATA)
|
||||
@echo "Requires: binutils gcc44 gcc gcc44-c++ gcc-c++" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 509124 499164" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHEL5" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
(1) readelf fix now posted upstream:
|
||||
http://sourceware.org/ml/binutils/2009-07/msg00123.html
|
||||
QA: New testcase: binutils-all/testranges.s
|
||||
|
||||
(2) gcc has been fixed based on this bugreport by Jakub upstream:
|
||||
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40713
|
||||
gcc44 backport request for RHEL-5.5 is: Bug 510958
|
||||
|
||||
(3) Going to be backported for RHEL-5.5 readelf.
|
||||
It has been already fixed by Nick Clifton upstream:
|
||||
http://sourceware.org/ml/binutils/2009-06/msg00418.html
|
||||
http://sourceware.org/ml/binutils-cvs/2009-06/msg00158.html
|
||||
QA: RHEL-only new testcase: binutils-all/testloc.S
|
||||
as a part of binutils-all/readelf.exp (not shown when PASSing)
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
class A {
|
||||
public:
|
||||
A();
|
||||
void f(){}
|
||||
};
|
||||
|
||||
class C {
|
||||
C();
|
||||
};
|
||||
|
||||
C::C() {
|
||||
A* p = new A;
|
||||
p->f();
|
||||
}
|
||||
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
summary: holes in debuginfo
|
||||
description: "(1) readelf fix now posted upstream:\n http://sourceware.org/ml/binutils/2009-07/msg00123.html\n\
|
||||
QA: New testcase: binutils-all/testranges.s\n\n(2) gcc has been fixed based on\
|
||||
\ this bugreport by Jakub upstream:\n http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40713\n\
|
||||
\ gcc44 backport request for RHEL-5.5 is: Bug 510958\n\n(3) Going to be backported\
|
||||
\ for RHEL-5.5 readelf.\n It has been already fixed by Nick Clifton upstream:\n\
|
||||
\ http://sourceware.org/ml/binutils/2009-06/msg00418.html\n http://sourceware.org/ml/binutils-cvs/2009-06/msg00158.html\n\
|
||||
QA: RHEL-only new testcase: binutils-all/testloc.S\n as a part of binutils-all/readelf.exp\
|
||||
\ (not shown when PASSing) \n"
|
||||
contact: Michal Nowak <mnowak@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
- gcc44
|
||||
- gcc
|
||||
- gcc44-c++
|
||||
- gcc-c++
|
||||
duration: 15m
|
||||
link:
|
||||
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=509124
|
||||
extra-summary: /tools/binutils/Regressions/readelf/509124-holes-in-debuginfo
|
||||
extra-task: /tools/binutils/Regressions/readelf/509124-holes-in-debuginfo
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Author: Michal Nowak <mnowak@redhat.com>
|
||||
#
|
||||
# Include rhts environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="binutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup Setup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlShowPackageVersion $PACKAGE
|
||||
rlShowRunningKernel
|
||||
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
cp ascend.C test.c $TmpDir
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
for gcc in $( ls /usr/bin/gcc{,44} 2> /dev/null ); do
|
||||
for opt in s $( seq 0 3 ); do
|
||||
rlPhaseStartTest "ascend.C: gcc=$gcc opt=$opt"
|
||||
rlRun "$gcc -O${opt} ascend.C -c -g"
|
||||
rlAssertExists "ascend.o"
|
||||
# kinda weird running readelf on .o file, but...
|
||||
rlRun "readelf -a -w -W ./ascend.o > /dev/less 2> readelf.errout.g++" 0 "[gcc] Generating readelf output"
|
||||
rlLog "$( cat readelf.errout.g++ )"
|
||||
rlAssertNotGrep "readelf" readelf.errout.g++
|
||||
rm -f ./ascend.o
|
||||
rlPhaseEnd
|
||||
done
|
||||
done
|
||||
|
||||
for gcc in $( ls /usr/bin/gcc{,44} 2> /dev/null ); do
|
||||
for opt in s $( seq 0 3 ); do
|
||||
rlPhaseStartTest "test.c: gcc=$gcc opt=$opt"
|
||||
rlRun "$gcc -O${opt} test.c -c -g"
|
||||
rlAssertExists "test.o"
|
||||
# kinda weird running readelf on .o file, but...
|
||||
rlRun "readelf -a -w -W ./test.o > /dev/less 2> readelf.errout.g++" 0 "[gcc] Generating readelf output"
|
||||
rlLog "$( cat readelf.errout.g++ )"
|
||||
rlAssertNotGrep "readelf" readelf.errout.g++
|
||||
rm -f ./test.o
|
||||
rlPhaseEnd
|
||||
done
|
||||
done
|
||||
|
||||
rlPhaseStartCleanup Cleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
void f(int i) {
|
||||
k(i);
|
||||
}
|
||||
|
||||
void g(int i) {
|
||||
int j[65537];
|
||||
l(i,j);
|
||||
}
|
||||
|
||||
struct s {
|
||||
void (*m)(int i);
|
||||
void (*n)(int i);
|
||||
} t={f,g};
|
||||
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/binutils/Regressions/ld/531269-ld-fails-to-merge-different-visibility-for-the-same-symbol
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE bar.c foo.c
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
chmod a+x ./runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Michal Nowak <mnowak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: ld fails to merge different visibility for the same symbol in distinct object files" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: binutils binutils220" >> $(METADATA)
|
||||
@echo "Requires: binutils binutils220 gcc44 gcc" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 531269" >> $(METADATA)
|
||||
@echo "Architectures: i386 x86_64" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
int foo __attribute__ ((section (".gnu.linkonce.d.1"),
|
||||
visibility ("hidden"))) = 1;
|
||||
int
|
||||
__attribute__ ((section (".gnu.linkonce.t.1"), visibility ("hidden")))
|
||||
bar ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
int
|
||||
get_foo ()
|
||||
{
|
||||
return foo;
|
||||
}
|
||||
int
|
||||
get_bar ()
|
||||
{
|
||||
return bar ();
|
||||
}
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
int foo __attribute__ ((section (".gnu.linkonce.d.1"))) = 1;
|
||||
int
|
||||
__attribute__ ((section (".gnu.linkonce.t.1")))
|
||||
bar ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
summary: ld fails to merge different visibility for the same symbol in distinct object
|
||||
files
|
||||
description: ''
|
||||
contact: Michal Nowak <mnowak@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
- binutils220
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
- binutils220
|
||||
- gcc44
|
||||
- gcc
|
||||
duration: 5m
|
||||
link:
|
||||
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=531269
|
||||
extra-summary: /tools/binutils/Regressions/ld/531269-ld-fails-to-merge-different-visibility-for-the-same-symbol
|
||||
extra-task: /tools/binutils/Regressions/ld/531269-ld-fails-to-merge-different-visibility-for-the-same-symbol
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Author: Michal Nowak <mnowak@redhat.com>
|
||||
#
|
||||
# Include rhts environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="binutils"
|
||||
|
||||
# Choose the compiler.
|
||||
GCC=${GCC:-gcc}
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlShowPackageVersion $PACKAGE
|
||||
rlShowRunningKernel
|
||||
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
cp foo.c bar.c $TmpDir
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "gcc=$GCC Testing"
|
||||
rlRun "$GCC -fPIC -c -o foo.o foo.c" 0 "Compile foo.c => foo.o"
|
||||
rlRun "$GCC -fPIC -c -o bar.o bar.c" 0 "Compile bar.c => bar.o"
|
||||
rlRun "ld -shared -o foobar.so foo.o bar.o" 0 "Link foo.o & bar.o => foobar.so"
|
||||
rlAssertExists foobar.so
|
||||
rm foobar.so foo.o bar.o
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup Cleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/binutils/Regression/RELRO-protection-effective
|
||||
# Description: bz1174826
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# 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 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/binutils/Regression/RELRO-protection-effective
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: bz1174826" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: binutils" >> $(METADATA)
|
||||
@echo "Requires: binutils gcc" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1174826" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
PURPOSE of /tools/binutils/Regression/RELRO-protection-effective
|
||||
Description: bz1174826
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Bug summary: RELRO is not read-only on PowerLE
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1174826
|
||||
|
||||
/*
|
||||
* Test to exercise PIE and RELRO provided by Roland McGrath <roland@redhat.com>.
|
||||
*
|
||||
* Description:
|
||||
* Simple test for RELRO, which happens to be a PIE too, but that's only
|
||||
* because this kind of example has to be in PIC code to make RELRO relevant,
|
||||
* and PIE makes it simpler to write a standalone one-file test than writing
|
||||
* a DSO.
|
||||
*
|
||||
* The "const" makes "foo" .rodata material, and the init to an external symbol
|
||||
* reference makes it require a data relocation. Enabling -z relro for this
|
||||
* link puts that .rodata into a RELRO area. This program will crash because
|
||||
* the page containing "foo" has been made read-only when "main" runs.
|
||||
* Without RELRO, it would let you modify "foo" even though it's supposed to
|
||||
* be const.
|
||||
*
|
||||
* Test with RELRO should fail:
|
||||
* $ gcc -pie -fPIE -g -Wl,-z,relro -o relro relro.c
|
||||
* $ ./relro
|
||||
* Segmentation fault (core dumped)
|
||||
*
|
||||
* Test without RELRO should pass:
|
||||
* $ gcc -pie -fPIE -g -Wl,-z,norelro -o no-relro relro.c
|
||||
* $ ./no-relro
|
||||
*
|
||||
**/
|
||||
|
||||
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
summary: bz1174826
|
||||
description: "Bug summary: RELRO is not read-only on PowerLE\nBugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1174826\n\
|
||||
\n/* \
|
||||
\ \n * Test to exercise PIE and RELRO provided by Roland McGrath <roland@redhat.com>.\n\
|
||||
\ * \
|
||||
\ \n * Description: \
|
||||
\ \n * Simple test for RELRO, which happens to be a PIE too,\
|
||||
\ but that's only \n * because this kind of example has to be in PIC\
|
||||
\ code to make RELRO relevant, \n * and PIE makes it simpler to write a standalone\
|
||||
\ one-file test than writing \n * a DSO. \
|
||||
\ \n * \
|
||||
\ \n * The \"const\" makes \"\
|
||||
foo\" .rodata material, and the init to an external symbol\n * reference makes\
|
||||
\ it require a data relocation. Enabling -z relro for this \n * link puts\
|
||||
\ that .rodata into a RELRO area. This program will crash because \n * the\
|
||||
\ page containing \"foo\" has been made read-only when \"main\" runs. \
|
||||
\ \n * Without RELRO, it would let you modify \"foo\" even though it's supposed\
|
||||
\ to \n * be const. \
|
||||
\ \n * \
|
||||
\ \n * Test with RELRO should fail: \
|
||||
\ \n * $ gcc -pie -fPIE -g -Wl,-z,relro -o relro\
|
||||
\ relro.c \n * $ ./relro \
|
||||
\ \n * Segmentation fault (core\
|
||||
\ dumped) \n * \
|
||||
\ \n * Test without\
|
||||
\ RELRO should pass: \n * $\
|
||||
\ gcc -pie -fPIE -g -Wl,-z,norelro -o no-relro relro.c \
|
||||
\ \n * $ ./no-relro \
|
||||
\ \n * \
|
||||
\ \n**/\n\n\n"
|
||||
contact: Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
- gcc
|
||||
duration: 5m
|
||||
link:
|
||||
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1174826
|
||||
extra-summary: /tools/binutils/Regression/RELRO-protection-effective
|
||||
extra-task: /tools/binutils/Regression/RELRO-protection-effective
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/binutils/Regression/RELRO-protection-effective
|
||||
# Description: bz1174826
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# 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 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="binutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
touch /tmp/disable-qe-abrt
|
||||
rlRun "TMPD=\$(mktemp -d)"
|
||||
rlRun "pushd $TMPD"
|
||||
cat > relro.c <<-EOF
|
||||
#include <stdio.h>
|
||||
|
||||
void *const foo = &stdout;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
*(void **) &foo = &stderr;
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
rlRun "gcc -pie -fPIE -g -Wl,-z,relro -o relro relro.c"
|
||||
rlRun "gcc -pie -fPIE -g -Wl,-z,norelro -o no-relro relro.c"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "./relro" 139
|
||||
rlRun "./no-relro"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TMPD"
|
||||
rm -f /tmp/disable-qe-abrt
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot
|
||||
# Description: Test for BZ#1080077 ([RFE] - Please configure ld.bfd to allow --sysroot)
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# 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 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#1080077 ([RFE] - Please configure ld.bfd to allow --sysroot)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: binutils" >> $(METADATA)
|
||||
@echo "Requires: binutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1080077" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot
|
||||
Description: Test for BZ#1080077 ([RFE] - Please configure ld.bfd to allow --sysroot)
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Bug summary: [RFE] - Please configure ld.bfd to allow --sysroot
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1080077
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
summary: Test for BZ#1080077 ([RFE] - Please configure ld.bfd to allow --sysroot)
|
||||
description: |
|
||||
Bug summary: [RFE] - Please configure ld.bfd to allow --sysroot
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1080077
|
||||
contact: Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
duration: 5m
|
||||
link:
|
||||
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1080077
|
||||
extra-summary: /tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot
|
||||
extra-task: /tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/binutils/Regression/bz1080077-RFE-Please-configure-ld-bfd-to-allow-sysroot
|
||||
# Description: Test for BZ#1080077 ([RFE] - Please configure ld.bfd to allow --sysroot)
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# 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 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartTest
|
||||
LD_BDF=$(which ld.bfd)
|
||||
RPM=$(rpm -qf $LD_BDF)
|
||||
rlLogInfo "ld.bfd is $LD_BDF of $RPM"
|
||||
rlRun "ld.bfd --sysroot=/tmp |& grep 'not configured to use sysroots'" 1
|
||||
rlRun "ld.bfd --sysroot=/tmp |& grep 'no input files'"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/binutils/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED
|
||||
# Description: Test for BZ#1117458 (ld from devtoolset copies SONAME to DT_NEEDED)
|
||||
# Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/binutils/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE libtest.tar.gz
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Milos Prchlik <mprchlik@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#1117458 (ld from devtoolset copies SONAME to DT_NEEDED)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: binutils" >> $(METADATA)
|
||||
@echo "Requires: binutils" >> $(METADATA)
|
||||
@echo "Requires: devtoolset-3.0-tools-devtoolset-3.0-Install-latest" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: yes" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1117458" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/binutils/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED
|
||||
Description: Test for BZ#1117458 (ld from devtoolset copies SONAME to DT_NEEDED)
|
||||
Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
Bug summary: ld from devtoolset copies SONAME to DT_NEEDED without checking if it’s empty
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1117458
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
int foo(void) {
|
||||
return 10;
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
summary: Test for BZ#1117458 (ld from devtoolset copies SONAME to DT_NEEDED)
|
||||
description: |
|
||||
Bug summary: ld from devtoolset copies SONAME to DT_NEEDED without checking if it’s empty
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1117458
|
||||
contact: Milos Prchlik <mprchlik@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
- gcc
|
||||
duration: 5m
|
||||
link:
|
||||
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1117458
|
||||
extra-summary: /tools/binutils/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED
|
||||
extra-task: /tools/binutils/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/binutils/Regression/bz1117458-ld-from-devtoolset-copies-SONAME-to-DT-NEEDED
|
||||
# Description: Test for BZ#1117458 (ld from devtoolset copies SONAME to DT_NEEDED)
|
||||
# Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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 Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="binutils"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "cp user.c libfoo.c $TmpDir/"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "gcc -fPIC -g -c libfoo.c"
|
||||
rlAssertExists "libfoo.o"
|
||||
rlRun "gcc -shared -Wl,-soname, -o libfoo.so -lc libfoo.o 2>&1 | tee out" 0
|
||||
rlAssertExists "libfoo.so"
|
||||
rlLogInfo "gcc output:"
|
||||
rlLogInfo "$(cat out)"
|
||||
rlAssertGrep "SONAME must not be empty string; ignored" out
|
||||
rlRun "objdump -p libfoo.so | grep SONAME | awk '{print \$2}' > soname"
|
||||
if [ "`stat -c '%s' soname`" != "0" ]; then
|
||||
rlLogInfo "SONAME='$(cat soname)'"
|
||||
rlFail "Detected SONAME is empty"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd" # $TmpDir
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#include <stdio.h>
|
||||
|
||||
extern int foo(void);
|
||||
|
||||
int main(void) {
|
||||
int a = foo();
|
||||
printf("a is %d\n", a);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd
|
||||
# Description: Test for BZ#1172766 (ppc64 segv in libbfd)
|
||||
# Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2015 Red Hat, Inc.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Milos Prchlik <mprchlik@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#1172766 (ppc64 segv in libbfd)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 30m" >> $(METADATA)
|
||||
@echo "RunFor: binutils" >> $(METADATA)
|
||||
@echo "Requires: binutils kernel-debuginfo xz" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: yes" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1172766" >> $(METADATA)
|
||||
@echo "Releases: RHEL7" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd
|
||||
Description: Test for BZ#1172766 (ppc64 segv in libbfd)
|
||||
Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
Bug summary: ppc64: segv in libbfd
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1172766
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
summary: Test for BZ#1172766 (ppc64 segv in libbfd)
|
||||
description: |
|
||||
Bug summary: ppc64: segv in libbfd
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1172766
|
||||
contact: Milos Prchlik <mprchlik@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
- elfutils
|
||||
- koji
|
||||
- kernel-debuginfo
|
||||
- xz
|
||||
duration: 30m
|
||||
link:
|
||||
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1172766
|
||||
extra-summary: /tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd
|
||||
extra-task: /tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/binutils/Regression/bz1172766-ppc64-segv-in-libbfd
|
||||
# Description: Test for BZ#1172766 (ppc64 segv in libbfd)
|
||||
# Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2015 Red Hat, Inc.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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 Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGES="binutils"
|
||||
REQUIRES="${REQUIRES:-kernel-debuginfo}"
|
||||
|
||||
__have_kernel_debuginfo () {
|
||||
local RELEASE ARCH TEMPDIR
|
||||
rlRun "RELEASE=$(uname -r)"
|
||||
rlRun "ARCH=$(uname -i)"
|
||||
if ! rpm -q kernel-debuginfo-$RELEASE &>/dev/null; then
|
||||
rlLogInfo 'kernel-debuginfo not present, trying to install it'
|
||||
rlRun "TEMPDIR=$(mktemp -d -p $HOME)" # $HOME to avoid "small" tmpfs
|
||||
rlRun "pushd '$TEMPDIR'"
|
||||
rlRun "koji download-build -q --debuginfo kernel-$RELEASE --arch $ARCH"
|
||||
rlRun "dnf -y install ./kernel-debuginfo-*.rpm"
|
||||
rlRun 'popd'
|
||||
rlRun "rm -rf '$TEMPDIR'"
|
||||
fi
|
||||
rlAssertRpm kernel-debuginfo-$RELEASE
|
||||
}
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlLogInfo "PACKAGES=$PACKAGES"
|
||||
rlLogInfo "REQUIRES=$REQUIRES"
|
||||
rlLogInfo "COLLECTIONS=$COLLECTIONS"
|
||||
rlLogInfo "KERNEL=$(uname -a)"
|
||||
|
||||
__have_kernel_debuginfo
|
||||
|
||||
rlAssertRpm --all
|
||||
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
|
||||
rlRun "KERNEL_RELEASE=$(uname -r)"
|
||||
rlRun "KMOD=/usr/lib/modules/$KERNEL_RELEASE/kernel/fs/nfsd/nfsd.ko"
|
||||
rlRun "KMOD_XZ=$KMOD.xz"
|
||||
rlRun "KMOD_DEBUG=/usr/lib/debug/$KMOD.debug"
|
||||
rlAssertExists "$KMOD_DEBUG"
|
||||
rlAssertExists "$KMOD_XZ"
|
||||
[[ -e "$KMOD" ]] || rlRun "unxz -k $KMOD_XZ"
|
||||
rlAssertExists "$KMOD"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "eu-unstrip $KMOD $KMOD_DEBUG --output=$TmpDir/unstripped.ko"
|
||||
rlRun "objdump -drS $TmpDir/unstripped.ko &> /dev/null"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/binutils/Regression/bz1226864-ld-crashes-on-ppc64-when-being-used-with-oformat
|
||||
# Description: Test for BZ#1226864 (ld crashes on ppc64 when being used with --oformat)
|
||||
# Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2015 Red Hat, Inc.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/binutils/Regression/bz1226864-ld-crashes-on-ppc64-when-being-used-with-oformat
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE ldtest.S
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Milos Prchlik <mprchlik@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Test for BZ#1226864 (ld crashes on ppc64 when being used with --oformat)" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 15m" >> $(METADATA)
|
||||
@echo "RunFor: binutils" >> $(METADATA)
|
||||
@echo "Requires: binutils" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: yes" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Bug: 1226864" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
||||
@echo "Architectures: x86_64 ppc64 ppc64le s390x" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
PURPOSE of /tools/binutils/Regression/bz1226864-ld-crashes-on-ppc64-when-being-used-with-oformat
|
||||
Description: Test for BZ#1226864 (ld crashes on ppc64 when being used with --oformat)
|
||||
Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
Bug summary: ld crashes on ppc64 when being used with --oformat binary
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1226864
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
.org 0x100
|
||||
nop
|
||||
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
summary: Test for BZ#1226864 (ld crashes on ppc64 when being used with --oformat)
|
||||
description: |
|
||||
Bug summary: ld crashes on ppc64 when being used with --oformat binary
|
||||
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1226864
|
||||
contact: Milos Prchlik <mprchlik@redhat.com>
|
||||
component:
|
||||
- binutils
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- binutils
|
||||
- gcc
|
||||
duration: 15m
|
||||
link:
|
||||
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1226864
|
||||
extra-summary: /tools/binutils/Regression/bz1226864-ld-crashes-on-ppc64-when-being-used-with-oformat
|
||||
extra-task: /tools/binutils/Regression/bz1226864-ld-crashes-on-ppc64-when-being-used-with-oformat
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/binutils/Regression/bz1226864-ld-crashes-on-ppc64-when-being-used-with-oformat
|
||||
# Description: Test for BZ#1226864 (ld crashes on ppc64 when being used with --oformat)
|
||||
# Author: Milos Prchlik <mprchlik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2015 Red Hat, Inc.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# 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 Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
LD="${LD:-$(which ld)}"
|
||||
GCC="${GCC:-$(which gcc)}"
|
||||
PACKAGE=$(rpm --qf '%{name}\n' -qf $(which $LD) | head -1)
|
||||
REQUIRES="${REQUIRES:-$(rpm --qf '%{name}\n' -qf $(which $GCC) | head -1)}"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlLogInfo "PACKAGES=$PACKAGES"
|
||||
rlLogInfo "REQUIRES=$REQUIRES"
|
||||
rlLogInfo "COLLECTIONS=$COLLECTIONS"
|
||||
rlLogInfo "GCC=$GCC"
|
||||
rlLogInfo "LD=$LD"
|
||||
|
||||
rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK"
|
||||
|
||||
# We optionally need to skip checking for the presence of the metapackage
|
||||
# because that would pull in all the dependent toolset subrpms. We do not
|
||||
# always want that, especially in CI.
|
||||
_COLLECTIONS="$COLLECTIONS"
|
||||
if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then
|
||||
for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do
|
||||
rlLogInfo "ignoring metapackage check for collection $c"
|
||||
export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/})
|
||||
done
|
||||
fi
|
||||
|
||||
rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS"
|
||||
|
||||
rlAssertRpm --all
|
||||
|
||||
export COLLECTIONS="$_COLLECTIONS"
|
||||
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "cp ldtest.S $TmpDir/"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlRun "gcc -c -o ldtest.o ldtest.S"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "ld --oformat=binary -o ldtest.bin ldtest.o"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue