Compare commits
8 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25d3f6a8bb | ||
|
|
0e219f419b | ||
|
|
4f8e38c581 | ||
|
|
ca7cb33bca | ||
|
|
ee826a17b4 | ||
|
|
1be393f237 | ||
|
|
7234e9846c | ||
|
|
6c52f46a6b |
63 changed files with 6009 additions and 5168 deletions
|
|
@ -1 +0,0 @@
|
|||
1
|
||||
80
.gitignore
vendored
80
.gitignore
vendored
|
|
@ -1,70 +1,14 @@
|
|||
*.diff
|
||||
*.orig
|
||||
*.rej
|
||||
*.sed
|
||||
*.xz
|
||||
binutils-2.*/
|
||||
i386
|
||||
i686
|
||||
x86_64
|
||||
/binutils-*.tar.bz2
|
||||
.build-*
|
||||
*.src.rpm
|
||||
*.log
|
||||
HOWTO
|
||||
build-sources
|
||||
|
||||
*~
|
||||
.#*
|
||||
*#
|
||||
|
||||
*.flt
|
||||
*.gmo
|
||||
*.info
|
||||
*.la
|
||||
*.lo
|
||||
*.o
|
||||
*.pyc
|
||||
*.tmp
|
||||
*.a
|
||||
|
||||
.deps
|
||||
.libs
|
||||
|
||||
autom4te.cache
|
||||
config.cache
|
||||
config.h
|
||||
config.intl
|
||||
config.log
|
||||
config.status
|
||||
libtool
|
||||
POTFILES
|
||||
*-POTFILES
|
||||
|
||||
TAGS
|
||||
TAGS.sub
|
||||
|
||||
.local.vimrc
|
||||
.lvimrc
|
||||
|
||||
.clang-format
|
||||
|
||||
.gdbinit
|
||||
.gdb_history
|
||||
|
||||
perf.data
|
||||
perf.data.old
|
||||
|
||||
# ignore core files, but not java/net/protocol/core/
|
||||
core
|
||||
!core/
|
||||
|
||||
lost+found
|
||||
|
||||
# ignore ./contrib/gcc_update output
|
||||
LAST_UPDATED
|
||||
REVISION
|
||||
|
||||
stamp-*
|
||||
*.stamp
|
||||
|
||||
# ignore in-tree prerequisites
|
||||
/mpfr*
|
||||
/mpc*
|
||||
/gmp*
|
||||
/isl*
|
||||
/binutils-2.29.tar.xz
|
||||
/binutils-2.29.1.tar.xz
|
||||
/binutils-2.19.50.0.1-output-format.sed
|
||||
/binutils-2.44.50-13.fc43.src.rpm
|
||||
/binutils-with-gold-2.45.50-be970c68891.tar.gz
|
||||
/binutils-with-gold-2.45.50-ba5838a98fb.tar.gz
|
||||
/binutils-2.47.50-1.fc46.src.rpm
|
||||
|
|
|
|||
38
binutils-2.19.50.0.1-output-format.sed
Normal file
38
binutils-2.19.50.0.1-output-format.sed
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Generate OUTPUT_FORMAT line for .so files from the system linker output.
|
||||
# Imported from glibc/Makerules.
|
||||
|
||||
/ld.*[ ]-E[BL]/b f
|
||||
/collect.*[ ]-E[BL]/b f
|
||||
/OUTPUT_FORMAT[^)]*$/{N
|
||||
s/\n[ ]*/ /
|
||||
}
|
||||
t o
|
||||
: o
|
||||
s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/
|
||||
t q
|
||||
s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\1,\2,\3/
|
||||
t s
|
||||
s/^.*OUTPUT_FORMAT(\([^,)]*\).*$)/OUTPUT_FORMAT(\1)/
|
||||
t q
|
||||
d
|
||||
: s
|
||||
s/"//g
|
||||
G
|
||||
s/\n//
|
||||
s/^\([^,]*\),\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\2)/p
|
||||
s/^\([^,]*\),\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\3)/p
|
||||
s/^\([^,]*\),\([^,]*\),\([^,]*\)/OUTPUT_FORMAT(\1)/p
|
||||
/,/s|^|*** BUG in libc/scripts/output-format.sed *** |p
|
||||
q
|
||||
: q
|
||||
s/"//g
|
||||
p
|
||||
q
|
||||
: f
|
||||
s/^.*[ ]-E\([BL]\)[ ].*$/,\1/
|
||||
t h
|
||||
s/^.*[ ]-E\([BL]\)$/,\1/
|
||||
t h
|
||||
d
|
||||
: h
|
||||
h
|
||||
21
binutils-2.22.52.0.1-export-demangle.h.patch
Normal file
21
binutils-2.22.52.0.1-export-demangle.h.patch
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
--- a/bfd/Makefile.am 2012-03-06 14:00:33.229957572 +0000
|
||||
+++ b/bfd/Makefile.am 2012-04-27 16:46:05.410974817 +0100
|
||||
@@ -18,7 +18,7 @@
|
||||
bfdlibdir = @bfdlibdir@
|
||||
bfdincludedir = @bfdincludedir@
|
||||
bfdlib_LTLIBRARIES = libbfd.la
|
||||
-bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h
|
||||
+bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
|
||||
else !INSTALL_LIBBFD
|
||||
# Empty these so that the respective installation directories will not be created.
|
||||
bfdlibdir =
|
||||
--- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:23:35.054721634 +0000
|
||||
+++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:25:59.292607840 +0000
|
||||
@@ -350,6 +350,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel
|
||||
@INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2)
|
||||
@INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \
|
||||
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
|
||||
+@INSTALL_LIBBFD_TRUE@ $(INCDIR)/demangle.h \
|
||||
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2)
|
||||
@INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@
|
||||
@INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la
|
||||
13
binutils-2.22.52.0.1-relro-on-by-default.patch
Normal file
13
binutils-2.22.52.0.1-relro-on-by-default.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
--- binutils-2.27.orig/ld/configure.tgt 2016-07-07 11:16:49.967963649 +0100
|
||||
+++ binutils-2.27/ld/configure.tgt 2016-07-07 11:17:02.252045673 +0100
|
||||
@@ -901,8 +901,8 @@ frv-*-* | hppa*-*-* | ia64-*-* | mips*-*
|
||||
# FAIL: objcopy -shared -z relro (tbss2)
|
||||
# FAIL: objcopy -shared -z relro (tbss3)
|
||||
;;
|
||||
-*-*-linux*)
|
||||
- if test ${ac_default_ld_z_relro} = unset; then
|
||||
+*)
|
||||
+ if test x${ac_default_ld_z_relro} = xunset; then
|
||||
ac_default_ld_z_relro=1
|
||||
fi
|
||||
;;
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
diff -rup binutils.orig/bfd/Makefile.am binutils-2.38/bfd/Makefile.am
|
||||
--- binutils.orig/bfd/Makefile.am 2022-02-09 14:10:42.659300681 +0000
|
||||
+++ binutils-2.38/bfd/Makefile.am 2022-02-09 14:12:40.562532916 +0000
|
||||
@@ -977,8 +977,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
|
||||
--- binutils-2.26.orig/bfd/Makefile.am 2016-01-25 10:11:33.505289018 +0000
|
||||
+++ binutils-2.26/bfd/Makefile.am 2016-01-25 10:13:23.489964145 +0000
|
||||
@@ -1043,8 +1043,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
|
||||
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
|
||||
$(AM_V_GEN)\
|
||||
bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
@echo "creating $@"
|
||||
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
- bfd_version_string="\"$(VERSION)\"" ;\
|
||||
- bfd_soversion="$(VERSION)" ;\
|
||||
+ bfd_version_string="\"$(VERSION)-%{release}\"" ;\
|
||||
|
|
@ -12,7 +11,7 @@ diff -rup binutils.orig/bfd/Makefile.am binutils-2.38/bfd/Makefile.am
|
|||
bfd_version_package="\"$(PKGVERSION)\"" ;\
|
||||
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
|
||||
. $(srcdir)/development.sh ;\
|
||||
@@ -989,7 +989,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
@@ -1055,7 +1055,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
fi ;\
|
||||
$(SED) -e "s,@bfd_version@,$$bfd_version," \
|
||||
-e "s,@bfd_version_string@,$$bfd_version_string," \
|
||||
|
|
@ -21,13 +20,12 @@ diff -rup binutils.orig/bfd/Makefile.am binutils-2.38/bfd/Makefile.am
|
|||
-e "s,@report_bugs_to@,$$report_bugs_to," \
|
||||
< $(srcdir)/version.h > $@; \
|
||||
echo "$${bfd_soversion}" > libtool-soversion
|
||||
diff -rup binutils.orig/bfd/Makefile.in binutils-2.38/bfd/Makefile.in
|
||||
--- binutils.orig/bfd/Makefile.in 2022-02-09 14:10:42.653300720 +0000
|
||||
+++ binutils-2.38/bfd/Makefile.in 2022-02-09 14:19:03.362040188 +0000
|
||||
@@ -2094,8 +2094,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC
|
||||
--- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:11:33.505289018 +0000
|
||||
+++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:14:17.818297941 +0000
|
||||
@@ -2111,8 +2111,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
|
||||
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
|
||||
$(AM_V_GEN)\
|
||||
bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
@echo "creating $@"
|
||||
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
- bfd_version_string="\"$(VERSION)\"" ;\
|
||||
- bfd_soversion="$(VERSION)" ;\
|
||||
+ bfd_version_string="\"$(VERSION)-%{release}\"" ;\
|
||||
|
|
@ -35,7 +33,7 @@ diff -rup binutils.orig/bfd/Makefile.in binutils-2.38/bfd/Makefile.in
|
|||
bfd_version_package="\"$(PKGVERSION)\"" ;\
|
||||
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
|
||||
. $(srcdir)/development.sh ;\
|
||||
@@ -2106,7 +2106,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
@@ -2123,7 +2123,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
fi ;\
|
||||
$(SED) -e "s,@bfd_version@,$$bfd_version," \
|
||||
-e "s,@bfd_version_string@,$$bfd_version_string," \
|
||||
2419
binutils-2.26-lto.patch
Normal file
2419
binutils-2.26-lto.patch
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,11 +0,0 @@
|
|||
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.27/bfd/elfnn-aarch64.c
|
||||
--- binutils.orig/bfd/elfnn-aarch64.c 2017-02-21 10:45:19.311956006 +0000
|
||||
+++ binutils-2.27/bfd/elfnn-aarch64.c 2017-02-21 11:55:07.517922655 +0000
|
||||
@@ -4947,6 +4947,7 @@ elfNN_aarch64_final_link_relocate (reloc
|
||||
it here if it is defined in a non-shared object. */
|
||||
if (h != NULL
|
||||
&& h->type == STT_GNU_IFUNC
|
||||
+ && (input_section->flags & SEC_ALLOC)
|
||||
&& h->def_regular)
|
||||
{
|
||||
asection *plt;
|
||||
33
binutils-2.28-dynamic-section-warning.patch
Normal file
33
binutils-2.28-dynamic-section-warning.patch
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
diff -rup binutils.orig/binutils/readelf.c binutils-2.28/binutils/readelf.c
|
||||
--- binutils.orig/binutils/readelf.c 2017-03-20 17:06:41.260789454 +0000
|
||||
+++ binutils-2.28/binutils/readelf.c 2017-03-20 17:08:09.181289807 +0000
|
||||
@@ -4965,12 +4965,6 @@ process_program_headers (FILE * file)
|
||||
section in the DYNAMIC segment. */
|
||||
dynamic_addr = segment->p_offset;
|
||||
dynamic_size = segment->p_filesz;
|
||||
- /* PR binutils/17512: Avoid corrupt dynamic section info in the segment. */
|
||||
- if (dynamic_addr + dynamic_size >= current_file_size)
|
||||
- {
|
||||
- error (_("the dynamic segment offset + size exceeds the size of the file\n"));
|
||||
- dynamic_addr = dynamic_size = 0;
|
||||
- }
|
||||
|
||||
/* Try to locate the .dynamic section. If there is
|
||||
a section header table, we can easily locate it. */
|
||||
@@ -5005,6 +4999,16 @@ process_program_headers (FILE * file)
|
||||
warn (_("the .dynamic section is not the first section"
|
||||
" in the dynamic segment.\n"));
|
||||
}
|
||||
+
|
||||
+ /* PR binutils/17512: Avoid corrupt dynamic section info in the
|
||||
+ segment. Check this after matching against the section headers
|
||||
+ so we don't warn on debuginfo file (which have NOBITS .dynamic
|
||||
+ sections). */
|
||||
+ if (dynamic_addr + dynamic_size >= current_file_size)
|
||||
+ {
|
||||
+ error (_("the dynamic segment offset + size exceeds the size of the file\n"));
|
||||
+ dynamic_addr = dynamic_size = 0;
|
||||
+ }
|
||||
break;
|
||||
|
||||
case PT_INTERP:
|
||||
14
binutils-2.28-ignore-gold-duplicates.patch
Normal file
14
binutils-2.28-ignore-gold-duplicates.patch
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
diff -rup binutils.orig/ld/ldmain.c binutils-2.28/ld/ldmain.c
|
||||
--- binutils.orig/ld/ldmain.c 2017-06-09 09:08:26.954016429 +0100
|
||||
+++ binutils-2.28/ld/ldmain.c 2017-06-09 09:09:11.307490976 +0100
|
||||
@@ -923,6 +923,10 @@ multiple_definition (struct bfd_link_inf
|
||||
obfd = h->u.def.section->owner;
|
||||
break;
|
||||
case bfd_link_hash_indirect:
|
||||
+ /* PR 21074: The GOLD linker can produce multiple indirect
|
||||
+ refences to the same symbol. These can be ignored. */
|
||||
+ if (bfd_is_ind_section (nsec))
|
||||
+ return;
|
||||
osec = bfd_ind_section_ptr;
|
||||
oval = 0;
|
||||
obfd = NULL;
|
||||
74
binutils-2.29-filename-in-error-messages.patch
Normal file
74
binutils-2.29-filename-in-error-messages.patch
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
--- binutils.orig/binutils/readelf.c 2017-07-24 15:27:09.859116315 +0100
|
||||
+++ binutils-2.29/binutils/readelf.c 2017-07-24 15:30:33.557770525 +0100
|
||||
@@ -18414,39 +18414,50 @@ process_archive (char * file_name, FILE
|
||||
static bfd_boolean
|
||||
process_file (char * file_name)
|
||||
{
|
||||
+ char * name;
|
||||
+ char * saved_program_name;
|
||||
FILE * file;
|
||||
struct stat statbuf;
|
||||
char armag[SARMAG];
|
||||
bfd_boolean ret = TRUE;
|
||||
|
||||
+ /* 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;
|
||||
}
|
||||
|
||||
file = fopen (file_name, "rb");
|
||||
if (file == NULL)
|
||||
{
|
||||
- error (_("Input file '%s' is not readable.\n"), file_name);
|
||||
- return FALSE;
|
||||
+ error (_("Not readable\n"));
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
if (fread (armag, SARMAG, 1, file) != 1)
|
||||
{
|
||||
- error (_("%s: Failed to read file's magic number\n"), file_name);
|
||||
+ error (_("Failed to read file's magic number\n"));
|
||||
fclose (file);
|
||||
- return FALSE;
|
||||
+ ret = FALSE;
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
current_file_size = (bfd_size_type) statbuf.st_size;
|
||||
@@ -18474,7 +18484,10 @@ process_file (char * file_name)
|
||||
}
|
||||
|
||||
fclose (file);
|
||||
+ done:
|
||||
current_file_size = 0;
|
||||
+ free (program_name);
|
||||
+ program_name = saved_program_name;
|
||||
|
||||
return ret;
|
||||
}
|
||||
304
binutils-2.29-revert-PLT-elision.patch
Normal file
304
binutils-2.29-revert-PLT-elision.patch
Normal file
|
|
@ -0,0 +1,304 @@
|
|||
diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.29.1/bfd/elf32-i386.c
|
||||
--- binutils.orig/bfd/elf32-i386.c 2017-11-15 13:32:41.209042711 +0000
|
||||
+++ binutils-2.29.1/bfd/elf32-i386.c 2017-11-15 13:42:09.365205187 +0000
|
||||
@@ -2747,24 +2747,6 @@ elf_i386_allocate_dynrelocs (struct elf_
|
||||
if (h->type != STT_FUNC)
|
||||
eh->func_pointer_refcount = 0;
|
||||
|
||||
- /* We can't use the GOT PLT if pointer equality is needed since
|
||||
- finish_dynamic_symbol won't clear symbol value and the dynamic
|
||||
- linker won't update the GOT slot. We will get into an infinite
|
||||
- loop at run-time. */
|
||||
- if (htab->plt_got != NULL
|
||||
- && h->type != STT_GNU_IFUNC
|
||||
- && !h->pointer_equality_needed
|
||||
- && h->plt.refcount > 0
|
||||
- && h->got.refcount > 0)
|
||||
- {
|
||||
- /* Don't use the regular PLT if there are both GOT and GOTPLT
|
||||
- reloctions. */
|
||||
- h->plt.offset = (bfd_vma) -1;
|
||||
-
|
||||
- /* Use the GOT PLT. */
|
||||
- eh->plt_got.refcount = 1;
|
||||
- }
|
||||
-
|
||||
/* Since STT_GNU_IFUNC symbol must go through PLT, we handle it
|
||||
here if it is defined and referenced in a non-shared object. */
|
||||
if (h->type == STT_GNU_IFUNC
|
||||
diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.29.1/bfd/elf64-x86-64.c
|
||||
--- binutils.orig/bfd/elf64-x86-64.c 2017-11-15 13:32:41.142043517 +0000
|
||||
+++ binutils-2.29.1/bfd/elf64-x86-64.c 2017-11-15 13:41:45.030498045 +0000
|
||||
@@ -3184,24 +3184,6 @@ elf_x86_64_allocate_dynrelocs (struct el
|
||||
eh->has_got_reloc,
|
||||
eh);
|
||||
|
||||
- /* We can't use the GOT PLT if pointer equality is needed since
|
||||
- finish_dynamic_symbol won't clear symbol value and the dynamic
|
||||
- linker won't update the GOT slot. We will get into an infinite
|
||||
- loop at run-time. */
|
||||
- if (htab->plt_got != NULL
|
||||
- && h->type != STT_GNU_IFUNC
|
||||
- && !h->pointer_equality_needed
|
||||
- && h->plt.refcount > 0
|
||||
- && h->got.refcount > 0)
|
||||
- {
|
||||
- /* Don't use the regular PLT if there are both GOT and GOTPLT
|
||||
- reloctions. */
|
||||
- h->plt.offset = (bfd_vma) -1;
|
||||
-
|
||||
- /* Use the GOT PLT. */
|
||||
- eh->plt_got.refcount = 1;
|
||||
- }
|
||||
-
|
||||
/* Clear the reference count of function pointer relocations if
|
||||
symbol isn't a normal function. */
|
||||
if (h->type != STT_FUNC)
|
||||
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 13:32:39.335065263 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 15:03:55.649727195 +0000
|
||||
@@ -2,6 +2,7 @@
|
||||
#readelf: -S --wide
|
||||
#as: --32
|
||||
|
||||
+#pass
|
||||
#...
|
||||
+\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 13:32:39.329065335 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 15:04:20.803430034 +0000
|
||||
@@ -3,7 +3,6 @@
|
||||
#readelf: -d --wide
|
||||
#as: --32
|
||||
|
||||
-#failif
|
||||
#...
|
||||
+0x[0-9a-f]+ +\(PLTREL.*
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 13:32:39.336065251 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 15:03:00.413379749 +0000
|
||||
@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
|
||||
-
|
||||
+#...
|
||||
Symbol table '\.dynsym' contains [0-9]+ entries:
|
||||
+Num: +Value +Size Type +Bind +Vis +Ndx Name
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 13:32:39.330065323 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 15:03:28.928042882 +0000
|
||||
@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
|
||||
-
|
||||
+#...
|
||||
Symbol table '\.dynsym' contains [0-9]+ entries:
|
||||
+Num: +Value +Size Type +Bind +Vis +Ndx Name
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pr20830.d binutils-2.29.1/ld/testsuite/ld-i386/pr20830.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pr20830.d 2017-11-15 13:32:39.332065299 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pr20830.d 2017-11-15 15:04:43.205165384 +0000
|
||||
@@ -19,7 +19,7 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r8 \(eip\) at cfa-4
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
0+18 00000010 0000001c FDE cie=00000000 pc=00000188..00000193
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 13:32:39.415064300 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 15:08:39.333375801 +0000
|
||||
@@ -2,8 +2,4 @@
|
||||
#readelf: -S --wide
|
||||
#as: --64
|
||||
|
||||
-#...
|
||||
- +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
|
||||
-#...
|
||||
- +\[ *[0-9]+\] \.got\.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+18 +.*
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 13:32:39.404064432 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 15:08:59.031143095 +0000
|
||||
@@ -3,7 +3,6 @@
|
||||
#readelf: -d --wide
|
||||
#as: --64
|
||||
|
||||
-#failif
|
||||
#...
|
||||
+0x[0-9a-f]+ +\(PLTREL.*
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 13:32:39.405064420 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 15:06:53.694623801 +0000
|
||||
@@ -1,7 +1,4 @@
|
||||
-#...
|
||||
-Disassembly of section .plt.got:
|
||||
|
||||
-[a-f0-9]+ <[a-z]+@plt>:
|
||||
-[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <.*>
|
||||
+#...
|
||||
[ ]*[a-f0-9]+: 90 nop
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-ibt.dd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2017-11-15 13:32:39.412064336 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2017-11-15 15:06:35.148842897 +0000
|
||||
@@ -1,7 +1,3 @@
|
||||
#...
|
||||
-Disassembly of section .plt.got:
|
||||
-
|
||||
-[a-f0-9]+ <[_a-z]+@plt>:
|
||||
[ ]*[a-f0-9]+: f3 0f 1e fa endbr64
|
||||
-[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <[_a-z]+>
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 13:32:39.407064397 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 15:06:17.244054423 +0000
|
||||
@@ -1,4 +1,3 @@
|
||||
-#failif
|
||||
#...
|
||||
[0-9a-f ]+R_X86_64_JUMP_SLOT +0+ +bar \+ 0
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 13:32:39.412064336 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 15:15:09.918750288 +0000
|
||||
@@ -20,6 +20,7 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
+#pass
|
||||
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000238..0000000000000244
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 13:32:39.413064324 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 15:16:08.227055104 +0000
|
||||
@@ -20,6 +20,7 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
+#pass
|
||||
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000238..0000000000000244
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 13:32:39.413064324 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 15:16:20.115913358 +0000
|
||||
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000188..0000000000000194
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 13:32:39.411064348 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 15:16:29.012807282 +0000
|
||||
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000188..0000000000000194
|
||||
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=0000000000000238..0000000000000244
|
||||
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=0000000000000238..0000000000000244
|
||||
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=0000000000000248..000000000000024d
|
||||
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=0000000000000248..000000000000024d
|
||||
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=0000000000000290..00000000000002a1
|
||||
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=0000000000000290..00000000000002a1
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 13:32:39.417064276 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 15:05:02.950932110 +0000
|
||||
@@ -14,6 +14,7 @@ Section Headers:
|
||||
+\[[ 0-9]+\] .dynsym +.*
|
||||
+\[[ 0-9]+\] .dynstr +.*
|
||||
+\[[ 0-9]+\] .rela.dyn +.*
|
||||
+#pass
|
||||
+\[[ 0-9]+\] .plt +.*
|
||||
+\[[ 0-9]+\] .plt.got +.*
|
||||
+\[[ 0-9]+\] .text +PROGBITS +0+1000 0+1000 0+31a 00 +AX +0 +0 4096
|
||||
32
binutils-2.29-skip-rp14918-test-for-arm.patch
Normal file
32
binutils-2.29-skip-rp14918-test-for-arm.patch
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2017-07-24 15:24:18.365091235 +0100
|
||||
+++ binutils-2.29/ld/testsuite/ld-plugin/lto.exp 2017-07-24 15:25:25.567317336 +0100
|
||||
@@ -301,9 +301,6 @@ set lto_link_elf_tests [list \
|
||||
[list "PR ld/16746 (2)" \
|
||||
"-O2 -flto -fuse-linker-plugin tmpdir/pr16746c.o tmpdir/pr16746a.o" "-O2 -flto" \
|
||||
{dummy.c} {} "pr16746b.exe"] \
|
||||
- [list "PR ld/14918" \
|
||||
- "-flto" "-flto" \
|
||||
- {pr14918.c} {{"readelf" {-d --wide} "pr14918.d"}} "pr14918.exe" "c"] \
|
||||
[list "Build pr21382a.o" \
|
||||
"" "-O2 -flto" \
|
||||
{pr21382a.c} {} "" "c"] \
|
||||
@@ -312,6 +309,19 @@ set lto_link_elf_tests [list \
|
||||
{pr21382b.c} {} "pr21382.so" "c"] \
|
||||
]
|
||||
|
||||
+# PR 14918 checks that libgcc is not spuriously included in a shared link of
|
||||
+# an empty program. The ARM crt1.o startup code however calls __libc_csu_init
|
||||
+# in /usr/lib/libc_nonshared.a(elf-init.oS). This in turn needs
|
||||
+# __aeabi_unwind_cpp_pr0@@GCC_3.5 which is provided by libgcc_s.so.1, so the
|
||||
+# test fails. Hence this code to skip the test.
|
||||
+if { ! [istarget "arm*-*-*"] } {
|
||||
+ set lto_link_elf_tests [concat $lto_link_elf_tests [list \
|
||||
+ [list "PR ld/14918" \
|
||||
+ "-flto" "-flto" \
|
||||
+ {pr14918.c} {{"readelf" {-d --wide} "pr14918.d"}} "pr14918.exe" "c"] \
|
||||
+ ]]
|
||||
+}
|
||||
+
|
||||
# Check final symbols in executables.
|
||||
set lto_link_symbol_tests [list \
|
||||
[list "LTO 3 symbol" \
|
||||
153
binutils-2.29.1-gold-start-stop.patch
Normal file
153
binutils-2.29.1-gold-start-stop.patch
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
diff -rup binutils.orig/gold/layout.cc binutils-2.29.1/gold/layout.cc
|
||||
--- binutils.orig/gold/layout.cc 2017-10-18 12:00:31.990714767 +0100
|
||||
+++ binutils-2.29.1/gold/layout.cc 2017-10-18 12:00:41.351604074 +0100
|
||||
@@ -2211,10 +2211,11 @@ Layout::define_section_symbols(Symbol_ta
|
||||
0, // symsize
|
||||
elfcpp::STT_NOTYPE,
|
||||
elfcpp::STB_GLOBAL,
|
||||
- elfcpp::STV_DEFAULT,
|
||||
+ elfcpp::STV_PROTECTED,
|
||||
0, // nonvis
|
||||
false, // offset_is_from_end
|
||||
- true); // only_if_ref
|
||||
+ true, // only_if_ref
|
||||
+ true); // must_be_in_reg
|
||||
|
||||
symtab->define_in_output_data(stop_name.c_str(),
|
||||
NULL, // version
|
||||
@@ -2224,10 +2225,11 @@ Layout::define_section_symbols(Symbol_ta
|
||||
0, // symsize
|
||||
elfcpp::STT_NOTYPE,
|
||||
elfcpp::STB_GLOBAL,
|
||||
- elfcpp::STV_DEFAULT,
|
||||
+ elfcpp::STV_PROTECTED,
|
||||
0, // nonvis
|
||||
true, // offset_is_from_end
|
||||
- true); // only_if_ref
|
||||
+ true, // only_if_ref
|
||||
+ true); // must_be_in_reg
|
||||
}
|
||||
}
|
||||
}
|
||||
Only in binutils-2.29.1/gold: layout.cc.orig
|
||||
diff -rup binutils.orig/gold/symtab.cc binutils-2.29.1/gold/symtab.cc
|
||||
--- binutils.orig/gold/symtab.cc 2017-10-18 12:00:31.990714767 +0100
|
||||
+++ binutils-2.29.1/gold/symtab.cc 2017-10-18 12:00:41.352604062 +0100
|
||||
@@ -1760,7 +1760,9 @@ Sized_symbol<size>*
|
||||
Symbol_table::define_special_symbol(const char** pname, const char** pversion,
|
||||
bool only_if_ref,
|
||||
Sized_symbol<size>** poldsym,
|
||||
- bool* resolve_oldsym, bool is_forced_local)
|
||||
+ bool* resolve_oldsym,
|
||||
+ bool is_forced_local,
|
||||
+ bool must_be_in_reg)
|
||||
{
|
||||
*resolve_oldsym = false;
|
||||
*poldsym = NULL;
|
||||
@@ -1797,7 +1799,11 @@ Symbol_table::define_special_symbol(cons
|
||||
oldsym = this->lookup(*pname, *pversion);
|
||||
if (oldsym == NULL && is_default_version)
|
||||
oldsym = this->lookup(*pname, NULL);
|
||||
- if (oldsym == NULL || !oldsym->is_undefined())
|
||||
+ // If the symbol must be defined in a regular object, ignore
|
||||
+ // definition from a dynamic object.
|
||||
+ if (oldsym == NULL
|
||||
+ || (!oldsym->is_undefined()
|
||||
+ && (!must_be_in_reg || !oldsym->is_from_dynobj())))
|
||||
return NULL;
|
||||
|
||||
*pname = oldsym->name();
|
||||
@@ -1916,7 +1922,8 @@ Symbol_table::define_in_output_data(cons
|
||||
elfcpp::STV visibility,
|
||||
unsigned char nonvis,
|
||||
bool offset_is_from_end,
|
||||
- bool only_if_ref)
|
||||
+ bool only_if_ref,
|
||||
+ bool must_be_in_reg)
|
||||
{
|
||||
if (parameters->target().get_size() == 32)
|
||||
{
|
||||
@@ -1925,7 +1932,8 @@ Symbol_table::define_in_output_data(cons
|
||||
value, symsize, type, binding,
|
||||
visibility, nonvis,
|
||||
offset_is_from_end,
|
||||
- only_if_ref);
|
||||
+ only_if_ref,
|
||||
+ must_be_in_reg);
|
||||
#else
|
||||
gold_unreachable();
|
||||
#endif
|
||||
@@ -1937,7 +1945,8 @@ Symbol_table::define_in_output_data(cons
|
||||
value, symsize, type, binding,
|
||||
visibility, nonvis,
|
||||
offset_is_from_end,
|
||||
- only_if_ref);
|
||||
+ only_if_ref,
|
||||
+ must_be_in_reg);
|
||||
#else
|
||||
gold_unreachable();
|
||||
#endif
|
||||
@@ -1962,7 +1971,8 @@ Symbol_table::do_define_in_output_data(
|
||||
elfcpp::STV visibility,
|
||||
unsigned char nonvis,
|
||||
bool offset_is_from_end,
|
||||
- bool only_if_ref)
|
||||
+ bool only_if_ref,
|
||||
+ bool must_be_in_reg)
|
||||
{
|
||||
Sized_symbol<size>* sym;
|
||||
Sized_symbol<size>* oldsym;
|
||||
@@ -1975,7 +1985,8 @@ Symbol_table::do_define_in_output_data(
|
||||
sym = this->define_special_symbol<size, true>(&name, &version,
|
||||
only_if_ref, &oldsym,
|
||||
&resolve_oldsym,
|
||||
- is_forced_local);
|
||||
+ is_forced_local,
|
||||
+ must_be_in_reg);
|
||||
#else
|
||||
gold_unreachable();
|
||||
#endif
|
||||
@@ -1986,7 +1997,8 @@ Symbol_table::do_define_in_output_data(
|
||||
sym = this->define_special_symbol<size, false>(&name, &version,
|
||||
only_if_ref, &oldsym,
|
||||
&resolve_oldsym,
|
||||
- is_forced_local);
|
||||
+ is_forced_local,
|
||||
+ must_be_in_reg);
|
||||
#else
|
||||
gold_unreachable();
|
||||
#endif
|
||||
diff -rup binutils.orig/gold/symtab.h binutils-2.29.1/gold/symtab.h
|
||||
--- binutils.orig/gold/symtab.h 2017-10-18 12:00:32.002714624 +0100
|
||||
+++ binutils-2.29.1/gold/symtab.h 2017-10-18 12:00:41.352604062 +0100
|
||||
@@ -1488,7 +1488,8 @@ class Symbol_table
|
||||
Output_data*, uint64_t value, uint64_t symsize,
|
||||
elfcpp::STT type, elfcpp::STB binding,
|
||||
elfcpp::STV visibility, unsigned char nonvis,
|
||||
- bool offset_is_from_end, bool only_if_ref);
|
||||
+ bool offset_is_from_end, bool only_if_ref,
|
||||
+ bool must_be_in_reg = false);
|
||||
|
||||
// Define a special symbol based on an Output_segment. It is a
|
||||
// multiple definition error if this symbol is already defined.
|
||||
@@ -1803,7 +1804,8 @@ class Symbol_table
|
||||
Sized_symbol<size>*
|
||||
define_special_symbol(const char** pname, const char** pversion,
|
||||
bool only_if_ref, Sized_symbol<size>** poldsym,
|
||||
- bool* resolve_oldsym, bool is_forced_local);
|
||||
+ bool* resolve_oldsym, bool is_forced_local,
|
||||
+ bool must_be_in_reg = false);
|
||||
|
||||
// Define a symbol in an Output_data, sized version.
|
||||
template<int size>
|
||||
@@ -1814,7 +1816,8 @@ class Symbol_table
|
||||
typename elfcpp::Elf_types<size>::Elf_WXword ssize,
|
||||
elfcpp::STT type, elfcpp::STB binding,
|
||||
elfcpp::STV visibility, unsigned char nonvis,
|
||||
- bool offset_is_from_end, bool only_if_ref);
|
||||
+ bool offset_is_from_end, bool only_if_ref,
|
||||
+ bool must_be_in_reg = false);
|
||||
|
||||
// Define a symbol in an Output_segment, sized version.
|
||||
template<int size>
|
||||
Only in binutils-2.29.1/gold: symtab.h.orig
|
||||
55
binutils-2.29.1-readelf-use-dynamic.patch
Normal file
55
binutils-2.29.1-readelf-use-dynamic.patch
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
diff -rup binutils.orig/binutils/doc/binutils.texi binutils-2.29.1/binutils/doc/binutils.texi
|
||||
--- binutils.orig/binutils/doc/binutils.texi 2017-11-01 11:44:12.360707737 +0000
|
||||
+++ binutils-2.29.1/binutils/doc/binutils.texi 2017-11-01 11:45:38.702652255 +0000
|
||||
@@ -4661,8 +4661,13 @@ given.
|
||||
@itemx --all
|
||||
Equivalent to specifying @option{--file-header},
|
||||
@option{--program-headers}, @option{--sections}, @option{--symbols},
|
||||
-@option{--relocs}, @option{--dynamic}, @option{--notes} and
|
||||
-@option{--version-info}.
|
||||
+@option{--relocs}, @option{--dynamic}, @option{--notes},
|
||||
+@option{--version-info}, @option{--arch-specific}, @option{--unwind},
|
||||
+@option{--section-groups} and @option{--histogram}.
|
||||
+
|
||||
+Note - this option does not enable @option{--use-dynamic} itself, so
|
||||
+if that option is not present on the command line then dynamic symbols
|
||||
+and dynamic relocs will not be displayed.
|
||||
|
||||
@item -h
|
||||
@itemx --file-header
|
||||
@@ -4758,6 +4763,9 @@ When displaying symbols, this option mak
|
||||
symbol hash tables in the file's dynamic section, rather than the
|
||||
symbol table sections.
|
||||
|
||||
+When displaying relocations, this option makes @command{readelf}
|
||||
+display the dynamic relocations rather than the static relocations.
|
||||
+
|
||||
@item -x <number or name>
|
||||
@itemx --hex-dump=<number or name>
|
||||
Displays the contents of the indicated section as a hexadecimal bytes.
|
||||
diff -rup binutils.orig/binutils/readelf.c binutils-2.29.1/binutils/readelf.c
|
||||
--- binutils.orig/binutils/readelf.c 2017-11-01 11:44:12.357707774 +0000
|
||||
+++ binutils-2.29.1/binutils/readelf.c 2017-11-01 11:45:11.901979878 +0000
|
||||
@@ -7117,7 +7117,21 @@ process_relocs (FILE * file)
|
||||
}
|
||||
|
||||
if (! found)
|
||||
- printf (_("\nThere are no relocations in this file.\n"));
|
||||
+ {
|
||||
+ /* Users sometimes forget the -D option, so try to be helpful. */
|
||||
+ for (i = 0; i < ARRAY_SIZE (dynamic_relocations); i++)
|
||||
+ {
|
||||
+ if (dynamic_info [dynamic_relocations [i].size])
|
||||
+ {
|
||||
+ printf (_("\nThere are no static relocations in this file."));
|
||||
+ printf (_("\nTo see the dynamic relocations add --use-dynamic to the command line.\n"));
|
||||
+
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if (i == ARRAY_SIZE (dynamic_relocations))
|
||||
+ printf (_("\nThere are no relocations in this file.\n"));
|
||||
+ }
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
BIN
binutils-2.29.1.tar.xz
Normal file
BIN
binutils-2.29.1.tar.xz
Normal file
Binary file not shown.
22
binutils-CVE-2018-10372.patch
Normal file
22
binutils-CVE-2018-10372.patch
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
--- binutils.orig/binutils/dwarf.c 2018-07-11 11:45:09.971024884 +0100
|
||||
+++ binutils-2.29/binutils/dwarf.c 2018-07-11 14:16:38.417025086 +0100
|
||||
@@ -8509,7 +8509,18 @@ process_cu_tu_index (struct dwarf_sectio
|
||||
}
|
||||
|
||||
if (!do_display)
|
||||
- memcpy (&this_set[row - 1].signature, ph, sizeof (uint64_t));
|
||||
+ {
|
||||
+ size_t num_copy = sizeof (uint64_t);
|
||||
+
|
||||
+ /* PR 23064: Beware of buffer overflow. */
|
||||
+ if (ph + num_copy < limit)
|
||||
+ memcpy (&this_set[row - 1].signature, ph, num_copy);
|
||||
+ else
|
||||
+ {
|
||||
+ warn (_("Signature (%p) extends beyond end of space in section\n"), ph);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
prow = poffsets + (row - 1) * ncols * 4;
|
||||
/* PR 17531: file: b8ce60a8. */
|
||||
11
binutils-CVE-2018-10373.patch
Normal file
11
binutils-CVE-2018-10373.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- binutils.orig/bfd/dwarf2.c 2018-07-11 14:28:44.557235916 +0100
|
||||
+++ binutils-2.29.1/bfd/dwarf2.c 2018-07-11 14:38:37.611875790 +0100
|
||||
@@ -1593,7 +1593,7 @@ concat_filename (struct line_info_table
|
||||
{
|
||||
char *filename;
|
||||
|
||||
- if (file - 1 >= table->num_files)
|
||||
+ if (table == NULL || file - 1 >= table->num_files)
|
||||
{
|
||||
/* FILE == 0 means unknown. */
|
||||
if (file)
|
||||
19
binutils-CVE-2018-10535.patch
Normal file
19
binutils-CVE-2018-10535.patch
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
--- binutils.orig/bfd/peXXigen.c 2018-07-11 14:28:44.937231840 +0100
|
||||
+++ binutils-2.29.1/bfd/peXXigen.c 2018-07-11 14:29:27.861771394 +0100
|
||||
@@ -2992,6 +2992,16 @@ _bfd_XX_bfd_copy_private_bfd_data_common
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ /* PR 23110. */
|
||||
+ else if (ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size < 0)
|
||||
+ {
|
||||
+ /* xgettext:c-format */
|
||||
+ _bfd_error_handler
|
||||
+ (_("%pB: Data Directory size (%#lx) is negative"),
|
||||
+ obfd, ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
for (i = 0; i < ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size
|
||||
/ sizeof (struct external_IMAGE_DEBUG_DIRECTORY); i++)
|
||||
{
|
||||
18
binutils-CVE-2018-13033.patch
Normal file
18
binutils-CVE-2018-13033.patch
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
--- binutils.orig/bfd/elf-attrs.c 2018-07-05 11:14:28.914603764 +0100
|
||||
+++ binutils-2.29.1/bfd/elf-attrs.c 2018-07-05 11:14:58.249275811 +0100
|
||||
@@ -438,6 +438,15 @@ _bfd_elf_parse_attributes (bfd *abfd, El
|
||||
/* PR 17512: file: 2844a11d. */
|
||||
if (hdr->sh_size == 0)
|
||||
return;
|
||||
+ if (hdr->sh_size > bfd_get_file_size (abfd))
|
||||
+ {
|
||||
+ /* xgettext:c-format */
|
||||
+ _bfd_error_handler (_("%pB: error: attribute section '%pA' too big: %#llx"),
|
||||
+ abfd, hdr->bfd_section, (long long) hdr->sh_size);
|
||||
+ bfd_set_error (bfd_error_invalid_operation);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
contents = (bfd_byte *) bfd_malloc (hdr->sh_size + 1);
|
||||
if (!contents)
|
||||
return;
|
||||
20
binutils-CVE-2018-6323.patch
Normal file
20
binutils-CVE-2018-6323.patch
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
--- binutils.orig/bfd/elfcode.h 2018-07-11 14:28:45.439226455 +0100
|
||||
+++ binutils-2.29.1/bfd/elfcode.h 2018-07-11 15:23:54.982819379 +0100
|
||||
@@ -680,7 +680,7 @@ elf_object_p (bfd *abfd)
|
||||
if (i_ehdrp->e_shnum > ((bfd_size_type) -1) / sizeof (*i_shdrp))
|
||||
goto got_wrong_format_error;
|
||||
#endif
|
||||
- amt = sizeof (*i_shdrp) * i_ehdrp->e_shnum;
|
||||
+ amt = sizeof (*i_shdrp) * (bfd_size_type) i_ehdrp->e_shnum;
|
||||
i_shdrp = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt);
|
||||
if (!i_shdrp)
|
||||
goto got_no_match;
|
||||
@@ -776,7 +776,7 @@ elf_object_p (bfd *abfd)
|
||||
if (i_ehdrp->e_phnum > ((bfd_size_type) -1) / sizeof (*i_phdr))
|
||||
goto got_wrong_format_error;
|
||||
#endif
|
||||
- amt = i_ehdrp->e_phnum * sizeof (*i_phdr);
|
||||
+ amt = (bfd_size_type) i_ehdrp->e_phnum * sizeof (*i_phdr);
|
||||
elf_tdata (abfd)->phdr = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->phdr == NULL)
|
||||
goto got_no_match;
|
||||
68
binutils-CVE-2018-6759.patch
Normal file
68
binutils-CVE-2018-6759.patch
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
--- binutils.orig/bfd/opncls.c 2018-07-11 14:28:44.690234489 +0100
|
||||
+++ binutils-2.29.1/bfd/opncls.c 2018-07-11 15:14:54.576580916 +0100
|
||||
@@ -1179,6 +1179,7 @@ bfd_get_debug_link_info_1 (bfd *abfd, vo
|
||||
bfd_byte *contents;
|
||||
unsigned int crc_offset;
|
||||
char *name;
|
||||
+ bfd_size_type size;
|
||||
|
||||
BFD_ASSERT (abfd);
|
||||
BFD_ASSERT (crc32_out);
|
||||
@@ -1188,6 +1189,12 @@ bfd_get_debug_link_info_1 (bfd *abfd, vo
|
||||
if (sect == NULL)
|
||||
return NULL;
|
||||
|
||||
+ size = bfd_get_section_size (sect);
|
||||
+
|
||||
+ /* PR 22794: Make sure that the section has a reasonable size. */
|
||||
+ if (size < 8 || size >= bfd_get_size (abfd))
|
||||
+ return NULL;
|
||||
+
|
||||
if (!bfd_malloc_and_get_section (abfd, sect, &contents))
|
||||
{
|
||||
if (contents != NULL)
|
||||
@@ -1198,9 +1205,9 @@ bfd_get_debug_link_info_1 (bfd *abfd, vo
|
||||
/* CRC value is stored after the filename, aligned up to 4 bytes. */
|
||||
name = (char *) contents;
|
||||
/* PR 17597: avoid reading off the end of the buffer. */
|
||||
- crc_offset = strnlen (name, bfd_get_section_size (sect)) + 1;
|
||||
+ crc_offset = strnlen (name, size) + 1;
|
||||
crc_offset = (crc_offset + 3) & ~3;
|
||||
- if (crc_offset >= bfd_get_section_size (sect))
|
||||
+ if (crc_offset >= size)
|
||||
return NULL;
|
||||
|
||||
*crc32 = bfd_get_32 (abfd, contents + crc_offset);
|
||||
@@ -1261,6 +1268,7 @@ bfd_get_alt_debug_link_info (bfd * abfd,
|
||||
bfd_byte *contents;
|
||||
unsigned int buildid_offset;
|
||||
char *name;
|
||||
+ bfd_size_type size;
|
||||
|
||||
BFD_ASSERT (abfd);
|
||||
BFD_ASSERT (buildid_len);
|
||||
@@ -1271,6 +1279,10 @@ bfd_get_alt_debug_link_info (bfd * abfd,
|
||||
if (sect == NULL)
|
||||
return NULL;
|
||||
|
||||
+ size = bfd_get_section_size (sect);
|
||||
+ if (size < 8 || size >= bfd_get_size (abfd))
|
||||
+ return NULL;
|
||||
+
|
||||
if (!bfd_malloc_and_get_section (abfd, sect, & contents))
|
||||
{
|
||||
if (contents != NULL)
|
||||
@@ -1280,11 +1292,11 @@ bfd_get_alt_debug_link_info (bfd * abfd,
|
||||
|
||||
/* BuildID value is stored after the filename. */
|
||||
name = (char *) contents;
|
||||
- buildid_offset = strnlen (name, bfd_get_section_size (sect)) + 1;
|
||||
+ buildid_offset = strnlen (name, size) + 1;
|
||||
if (buildid_offset >= bfd_get_section_size (sect))
|
||||
return NULL;
|
||||
|
||||
- *buildid_len = bfd_get_section_size (sect) - buildid_offset;
|
||||
+ *buildid_len = size - buildid_offset;
|
||||
*buildid_out = bfd_malloc (*buildid_len);
|
||||
memcpy (*buildid_out, contents + buildid_offset, *buildid_len);
|
||||
|
||||
12
binutils-CVE-2018-7208.patch
Normal file
12
binutils-CVE-2018-7208.patch
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
--- binutils.orig/bfd/coffgen.c 2018-07-11 11:45:09.490030070 +0100
|
||||
+++ binutils-2.29/bfd/coffgen.c 2018-07-11 15:02:48.863331411 +0100
|
||||
@@ -1555,7 +1555,8 @@ coff_pointerize_aux (bfd *abfd,
|
||||
}
|
||||
/* A negative tagndx is meaningless, but the SCO 3.2v4 cc can
|
||||
generate one, so we must be careful to ignore it. */
|
||||
- if (auxent->u.auxent.x_sym.x_tagndx.l > 0)
|
||||
+ if ((unsigned long) auxent->u.auxent.x_sym.x_tagndx.l
|
||||
+ < obj_raw_syment_count (abfd))
|
||||
{
|
||||
auxent->u.auxent.x_sym.x_tagndx.p =
|
||||
table_base + auxent->u.auxent.x_sym.x_tagndx.l;
|
||||
39
binutils-CVE-2018-7568.patch
Normal file
39
binutils-CVE-2018-7568.patch
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
--- binutils.orig/bfd/dwarf1.c 2018-07-11 11:45:09.482030157 +0100
|
||||
+++ binutils-2.29/bfd/dwarf1.c 2018-07-11 11:48:19.564980423 +0100
|
||||
@@ -208,6 +208,7 @@ parse_die (bfd * abfd,
|
||||
/* Then the attributes. */
|
||||
while (xptr < (this_die + aDieInfo->length))
|
||||
{
|
||||
+ unsigned int block_len;
|
||||
unsigned short attr;
|
||||
|
||||
/* Parse the attribute based on its form. This section
|
||||
@@ -243,10 +244,26 @@ parse_die (bfd * abfd,
|
||||
xptr += 4;
|
||||
break;
|
||||
case FORM_BLOCK2:
|
||||
- xptr += 2 + bfd_get_16 (abfd, (bfd_byte *) xptr);
|
||||
+ if (xptr + 2 <= aDiePtrEnd)
|
||||
+ {
|
||||
+ block_len = bfd_get_16 (abfd, xptr);
|
||||
+ if (xptr + block_len > aDiePtrEnd
|
||||
+ || xptr + block_len < xptr)
|
||||
+ return FALSE;
|
||||
+ xptr += block_len;
|
||||
+ }
|
||||
+ xptr += 2;
|
||||
break;
|
||||
case FORM_BLOCK4:
|
||||
- xptr += 4 + bfd_get_32 (abfd, (bfd_byte *) xptr);
|
||||
+ if (xptr + 4 <= aDiePtrEnd)
|
||||
+ {
|
||||
+ block_len = bfd_get_32 (abfd, xptr);
|
||||
+ if (xptr + block_len > aDiePtrEnd
|
||||
+ || xptr + block_len < xptr)
|
||||
+ return FALSE;
|
||||
+ xptr += block_len;
|
||||
+ }
|
||||
+ xptr += 4;
|
||||
break;
|
||||
case FORM_STRING:
|
||||
if (attr == AT_name)
|
||||
75
binutils-CVE-2018-7569.patch
Normal file
75
binutils-CVE-2018-7569.patch
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
--- binutils.orig/bfd/dwarf2.c 2018-07-11 11:45:09.491030059 +0100
|
||||
+++ binutils-2.29/bfd/dwarf2.c 2018-07-11 12:16:12.975943400 +0100
|
||||
@@ -626,14 +626,24 @@ read_8_bytes (bfd *abfd, bfd_byte *buf,
|
||||
}
|
||||
|
||||
static bfd_byte *
|
||||
-read_n_bytes (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
- bfd_byte *buf,
|
||||
- bfd_byte *end,
|
||||
- unsigned int size ATTRIBUTE_UNUSED)
|
||||
-{
|
||||
- if (buf + size > end)
|
||||
- return NULL;
|
||||
- return buf;
|
||||
+read_n_bytes (bfd_byte * buf,
|
||||
+ bfd_byte * end,
|
||||
+ struct dwarf_block * block)
|
||||
+{
|
||||
+ unsigned int size = block->size;
|
||||
+ bfd_byte * block_end = buf + size;
|
||||
+
|
||||
+ if (block_end > end || block_end < buf)
|
||||
+ {
|
||||
+ block->data = NULL;
|
||||
+ block->size = 0;
|
||||
+ return end;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ block->data = buf;
|
||||
+ return block_end;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Scans a NUL terminated string starting at BUF, returning a pointer to it.
|
||||
@@ -1131,8 +1141,7 @@ read_attribute_value (struct attribute *
|
||||
return NULL;
|
||||
blk->size = read_2_bytes (abfd, info_ptr, info_ptr_end);
|
||||
info_ptr += 2;
|
||||
- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size);
|
||||
- info_ptr += blk->size;
|
||||
+ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk);
|
||||
attr->u.blk = blk;
|
||||
break;
|
||||
case DW_FORM_block4:
|
||||
@@ -1142,8 +1151,7 @@ read_attribute_value (struct attribute *
|
||||
return NULL;
|
||||
blk->size = read_4_bytes (abfd, info_ptr, info_ptr_end);
|
||||
info_ptr += 4;
|
||||
- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size);
|
||||
- info_ptr += blk->size;
|
||||
+ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk);
|
||||
attr->u.blk = blk;
|
||||
break;
|
||||
case DW_FORM_data2:
|
||||
@@ -1183,8 +1191,7 @@ read_attribute_value (struct attribute *
|
||||
blk->size = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read,
|
||||
FALSE, info_ptr_end);
|
||||
info_ptr += bytes_read;
|
||||
- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size);
|
||||
- info_ptr += blk->size;
|
||||
+ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk);
|
||||
attr->u.blk = blk;
|
||||
break;
|
||||
case DW_FORM_block1:
|
||||
@@ -1194,8 +1201,7 @@ read_attribute_value (struct attribute *
|
||||
return NULL;
|
||||
blk->size = read_1_byte (abfd, info_ptr, info_ptr_end);
|
||||
info_ptr += 1;
|
||||
- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size);
|
||||
- info_ptr += blk->size;
|
||||
+ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk);
|
||||
attr->u.blk = blk;
|
||||
break;
|
||||
case DW_FORM_data1:
|
||||
16
binutils-CVE-2018-7643.patch
Normal file
16
binutils-CVE-2018-7643.patch
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
--- binutils.orig/binutils/dwarf.c 2018-04-27 09:22:07.402864408 +0100
|
||||
+++ binutils-2.30/binutils/dwarf.c 2018-04-27 09:24:26.794235786 +0100
|
||||
@@ -6810,6 +6810,13 @@ display_debug_ranges (struct dwarf_secti
|
||||
continue;
|
||||
}
|
||||
|
||||
+ if (next < section_begin || next >= finish)
|
||||
+ {
|
||||
+ warn (_("Corrupt offset (%#8.8lx) in range entry %u\n"),
|
||||
+ (unsigned long) offset, i);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
if (dwarf_check != 0 && i > 0)
|
||||
{
|
||||
if (start < next)
|
||||
|
|
@ -1,154 +0,0 @@
|
|||
From 3221c470f0765886a49a1a3d2ec602e4104a377b Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Fri, 2 Aug 2024 19:52:00 -0700
|
||||
Subject: [PATCH] LTO: Restore the wrapper symbol check for standard function
|
||||
|
||||
Call unwrap_hash_lookup to restore the wrapper symbol check for standard
|
||||
function since reference to standard function may not show up in LTO
|
||||
symbol table:
|
||||
|
||||
[hjl@gnu-tgl-3 pr31956-3]$ nm foo.o
|
||||
00000000 T main
|
||||
U __real_malloc
|
||||
00000000 T __wrap_malloc
|
||||
[hjl@gnu-tgl-3 pr31956-3]$ lto-dump -list foo.o
|
||||
Type Visibility Size Name
|
||||
function default 0 malloc
|
||||
function default 0 __real_malloc
|
||||
function default 3 main
|
||||
function default 5 __wrap_malloc
|
||||
[hjl@gnu-tgl-3 pr31956-3]$ make
|
||||
gcc -O2 -flto -Wall -c -o foo.o foo.c
|
||||
gcc -Wl,--wrap=malloc -O2 -flto -Wall -o x foo.o
|
||||
/usr/local/bin/ld: /tmp/ccsPW0a9.ltrans0.ltrans.o: in function `main':
|
||||
<artificial>:(.text.startup+0xa): undefined reference to `__wrap_malloc'
|
||||
collect2: error: ld returned 1 exit status
|
||||
make: *** [Makefile:22: x] Error 1
|
||||
[hjl@gnu-tgl-3 pr31956-3]$
|
||||
|
||||
Also add a test to verify that the unused wrapper is removed.
|
||||
|
||||
PR ld/31956
|
||||
* plugin.c (get_symbols): Restore the wrapper symbol check for
|
||||
standard function.
|
||||
* testsuite/ld-plugin/lto.exp: Run the malloc test and the
|
||||
unused test.
|
||||
* testsuite/ld-plugin/pr31956c.c: New file.
|
||||
* testsuite/ld-plugin/pr31956d.c: New file.
|
||||
* testsuite/ld-plugin/pr31956d.d: New file.
|
||||
|
||||
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
||||
---
|
||||
ld/plugin.c | 14 ++++++++++++--
|
||||
ld/testsuite/ld-plugin/lto.exp | 16 ++++++++++++++++
|
||||
ld/testsuite/ld-plugin/pr31956c.c | 19 +++++++++++++++++++
|
||||
ld/testsuite/ld-plugin/pr31956d.c | 7 +++++++
|
||||
ld/testsuite/ld-plugin/pr31956d.d | 4 ++++
|
||||
5 files changed, 58 insertions(+), 2 deletions(-)
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr31956c.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr31956d.c
|
||||
create mode 100644 ld/testsuite/ld-plugin/pr31956d.d
|
||||
|
||||
diff --git a/ld/plugin.c b/ld/plugin.c
|
||||
index 03ee9880d10..51c4765cc5b 100644
|
||||
--- a/ld/plugin.c
|
||||
+++ b/ld/plugin.c
|
||||
@@ -778,8 +778,18 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms,
|
||||
{
|
||||
blhe = h;
|
||||
/* Check if a symbol is a wrapper symbol. */
|
||||
- if (blhe && blhe->wrapper_symbol)
|
||||
- wrap_status = wrapper;
|
||||
+ if (blhe)
|
||||
+ {
|
||||
+ if (blhe->wrapper_symbol)
|
||||
+ wrap_status = wrapper;
|
||||
+ else if (link_info.wrap_hash != NULL)
|
||||
+ {
|
||||
+ struct bfd_link_hash_entry *unwrap
|
||||
+ = unwrap_hash_lookup (&link_info, (bfd *) abfd, blhe);
|
||||
+ if (unwrap != NULL && unwrap != h)
|
||||
+ wrap_status = wrapper;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
|
||||
index ad59e2abd61..1a8c3736307 100644
|
||||
--- a/ld/testsuite/ld-plugin/lto.exp
|
||||
+++ b/ld/testsuite/ld-plugin/lto.exp
|
||||
@@ -546,6 +546,22 @@ set lto_link_elf_tests [list \
|
||||
{} \
|
||||
"pr31956b" \
|
||||
] \
|
||||
+ [list \
|
||||
+ "PR ld/31956 (malloc)" \
|
||||
+ "-Wl,--wrap=malloc" \
|
||||
+ "-O2 -flto" \
|
||||
+ {pr31956c.c} \
|
||||
+ {} \
|
||||
+ "pr31956c" \
|
||||
+ ] \
|
||||
+ [list \
|
||||
+ "PR ld/31956 (unused)" \
|
||||
+ "-Wl,--wrap=parse_line" \
|
||||
+ "-O2 -flto" \
|
||||
+ {pr31956d.c} \
|
||||
+ {{"nm" {} "pr31956d.d"}} \
|
||||
+ "pr31956d" \
|
||||
+ ] \
|
||||
[list \
|
||||
"Build pr30281.so" \
|
||||
"-shared -Wl,--version-script,pr30281.t \
|
||||
diff --git a/ld/testsuite/ld-plugin/pr31956c.c b/ld/testsuite/ld-plugin/pr31956c.c
|
||||
new file mode 100644
|
||||
index 00000000000..4a46b2b49a8
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr31956c.c
|
||||
@@ -0,0 +1,19 @@
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+extern void *__real_malloc (size_t);
|
||||
+
|
||||
+void *
|
||||
+__wrap_malloc (size_t n)
|
||||
+{
|
||||
+ if (n == 0)
|
||||
+ return NULL;
|
||||
+ else
|
||||
+ return __real_malloc (n);
|
||||
+};
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ void *ptr = malloc (30);
|
||||
+ return ptr == NULL ? 1 : 0;
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr31956d.c b/ld/testsuite/ld-plugin/pr31956d.c
|
||||
new file mode 100644
|
||||
index 00000000000..cb7f2d50643
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr31956d.c
|
||||
@@ -0,0 +1,7 @@
|
||||
+void __wrap_parse_line(void) {};
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-plugin/pr31956d.d b/ld/testsuite/ld-plugin/pr31956d.d
|
||||
new file mode 100644
|
||||
index 00000000000..b579cdc7353
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-plugin/pr31956d.d
|
||||
@@ -0,0 +1,4 @@
|
||||
+#failif
|
||||
+#...
|
||||
+[0-9a-f]+ T .*parse_line
|
||||
+#...
|
||||
--
|
||||
2.45.2
|
||||
|
||||
193
binutils-aarch64-pie.patch
Normal file
193
binutils-aarch64-pie.patch
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
Only in binutils-2.29.1/bfd: ChangeLog.orig
|
||||
Only in binutils-2.29.1/bfd: ChangeLog.rej
|
||||
diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.29.1/bfd/elf64-s390.c
|
||||
--- binutils.orig/bfd/elf64-s390.c 2018-01-22 12:10:06.282231202 +0000
|
||||
+++ binutils-2.29.1/bfd/elf64-s390.c 2018-01-22 12:32:36.743617339 +0000
|
||||
@@ -1600,8 +1600,7 @@ elf_s390_adjust_dynamic_symbol (struct b
|
||||
{
|
||||
if (h->plt.refcount <= 0
|
||||
|| SYMBOL_CALLS_LOCAL (info, h)
|
||||
- || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|
||||
- && h->root.type == bfd_link_hash_undefweak))
|
||||
+ || UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
|
||||
{
|
||||
/* This case can occur if we saw a PLT32 reloc in an input
|
||||
file, but the symbol was never referred to by a dynamic
|
||||
@@ -1850,8 +1849,7 @@ allocate_dynrelocs (struct elf_link_hash
|
||||
htab->elf.srelgot->size += sizeof (Elf64_External_Rela);
|
||||
else if (tls_type == GOT_TLS_GD)
|
||||
htab->elf.srelgot->size += 2 * sizeof (Elf64_External_Rela);
|
||||
- else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
- || h->root.type != bfd_link_hash_undefweak)
|
||||
+ else if (!UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)
|
||||
&& (bfd_link_pic (info)
|
||||
|| WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
|
||||
htab->elf.srelgot->size += sizeof (Elf64_External_Rela);
|
||||
@@ -1890,7 +1888,8 @@ allocate_dynrelocs (struct elf_link_hash
|
||||
if (eh->dyn_relocs != NULL
|
||||
&& h->root.type == bfd_link_hash_undefweak)
|
||||
{
|
||||
- if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
|
||||
+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|
||||
+ || UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
|
||||
eh->dyn_relocs = NULL;
|
||||
|
||||
/* Make sure undefined weak symbols are output as a dynamic
|
||||
@@ -2307,6 +2306,7 @@ elf_s390_relocate_section (bfd *output_b
|
||||
bfd_reloc_status_type r;
|
||||
int tls_type;
|
||||
asection *base_got = htab->elf.sgot;
|
||||
+ bfd_boolean resolved_to_zero;
|
||||
|
||||
r_type = ELF64_R_TYPE (rel->r_info);
|
||||
if (r_type == (int) R_390_GNU_VTINHERIT
|
||||
@@ -2402,6 +2402,9 @@ elf_s390_relocate_section (bfd *output_b
|
||||
if (bfd_link_relocatable (info))
|
||||
continue;
|
||||
|
||||
+ resolved_to_zero = (h != NULL
|
||||
+ && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h));
|
||||
+
|
||||
switch (r_type)
|
||||
{
|
||||
case R_390_GOTPLT12:
|
||||
@@ -2489,8 +2492,7 @@ elf_s390_relocate_section (bfd *output_b
|
||||
h)
|
||||
|| (bfd_link_pic (info)
|
||||
&& SYMBOL_REFERENCES_LOCAL (info, h))
|
||||
- || (ELF_ST_VISIBILITY (h->other)
|
||||
- && h->root.type == bfd_link_hash_undefweak))
|
||||
+ || resolved_to_zero)
|
||||
{
|
||||
/* This is actually a static link, or it is a
|
||||
-Bsymbolic link and the symbol is defined
|
||||
@@ -2804,7 +2806,8 @@ elf_s390_relocate_section (bfd *output_b
|
||||
|
||||
if ((bfd_link_pic (info)
|
||||
&& (h == NULL
|
||||
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
+ || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
+ && !resolved_to_zero)
|
||||
|| h->root.type != bfd_link_hash_undefweak)
|
||||
&& ((r_type != R_390_PC16
|
||||
&& r_type != R_390_PC12DBL
|
||||
@@ -3592,6 +3595,9 @@ elf_s390_finish_dynamic_symbol (bfd *out
|
||||
else if (bfd_link_pic (info)
|
||||
&& SYMBOL_REFERENCES_LOCAL (info, h))
|
||||
{
|
||||
+ if (UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
|
||||
+ return TRUE;
|
||||
+
|
||||
/* If this is a static link, or it is a -Bsymbolic link and
|
||||
the symbol is defined locally or was forced to be local
|
||||
because of a version file, we just want to emit a
|
||||
Only in binutils-2.29.1/bfd: elf64-s390.c.orig
|
||||
diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.29.1/bfd/elf-bfd.h
|
||||
--- binutils.orig/bfd/elf-bfd.h 2018-01-22 12:10:06.277231259 +0000
|
||||
+++ binutils-2.29.1/bfd/elf-bfd.h 2018-01-22 12:30:14.318245660 +0000
|
||||
@@ -266,6 +266,13 @@ struct elf_link_hash_entry
|
||||
#define SYMBOL_CALLS_LOCAL(INFO, H) \
|
||||
_bfd_elf_symbol_refs_local_p (H, INFO, 1)
|
||||
|
||||
+/* Whether an undefined weak symbol should resolve to its link-time
|
||||
+ value, even in PIC or PIE objects. */
|
||||
+#define UNDEFWEAK_NO_DYNAMIC_RELOC(INFO, H) \
|
||||
+ ((H)->root.type == bfd_link_hash_undefweak \
|
||||
+ && (ELF_ST_VISIBILITY ((H)->other) != STV_DEFAULT \
|
||||
+ || (INFO)->dynamic_undefined_weak == 0))
|
||||
+
|
||||
/* Common symbols that are turned into definitions don't have the
|
||||
DEF_REGULAR flag set, so they might appear to be undefined.
|
||||
Symbols defined in linker scripts also don't have DEF_REGULAR set. */
|
||||
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.29.1/bfd/elfnn-aarch64.c
|
||||
--- binutils.orig/bfd/elfnn-aarch64.c 2018-01-22 12:10:06.271231328 +0000
|
||||
+++ binutils-2.29.1/bfd/elfnn-aarch64.c 2018-01-22 12:35:13.030825190 +0000
|
||||
@@ -4578,7 +4578,7 @@ aarch64_can_relax_tls (bfd *input_bfd,
|
||||
if (symbol_got_type == GOT_TLS_IE && GOT_TLS_GD_ANY_P (reloc_got_type))
|
||||
return TRUE;
|
||||
|
||||
- if (bfd_link_pic (info))
|
||||
+ if (!bfd_link_executable (info))
|
||||
return FALSE;
|
||||
|
||||
if (h && h->root.type == bfd_link_hash_undefweak)
|
||||
@@ -4951,6 +4951,7 @@ elfNN_aarch64_final_link_relocate (reloc
|
||||
bfd_boolean relative_reloc;
|
||||
asection *base_got;
|
||||
bfd_vma orig_value = value;
|
||||
+ bfd_boolean resolved_to_zero;
|
||||
|
||||
globals = elf_aarch64_hash_table (info);
|
||||
|
||||
@@ -5176,6 +5177,9 @@ bad_ifunc_reloc:
|
||||
}
|
||||
}
|
||||
|
||||
+ resolved_to_zero = (h != NULL
|
||||
+ && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h));
|
||||
+
|
||||
switch (bfd_r_type)
|
||||
{
|
||||
case BFD_RELOC_AARCH64_NONE:
|
||||
@@ -5194,7 +5198,8 @@ bad_ifunc_reloc:
|
||||
|| globals->root.is_relocatable_executable)
|
||||
&& (input_section->flags & SEC_ALLOC)
|
||||
&& (h == NULL
|
||||
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
+ || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
+ && !resolved_to_zero)
|
||||
|| h->root.type != bfd_link_hash_undefweak))
|
||||
/* Or we are creating an executable, we may need to keep relocations
|
||||
for symbols satisfied by a dynamic library if we manage to avoid
|
||||
@@ -6246,7 +6251,7 @@ elfNN_aarch64_relocate_section (bfd *out
|
||||
indx = h && h->dynindx != -1 ? h->dynindx : 0;
|
||||
|
||||
need_relocs =
|
||||
- (bfd_link_pic (info) || indx != 0) &&
|
||||
+ (!bfd_link_executable (info) || indx != 0) &&
|
||||
(h == NULL
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
|| h->root.type != bfd_link_hash_undefweak);
|
||||
@@ -6341,7 +6346,7 @@ elfNN_aarch64_relocate_section (bfd *out
|
||||
indx = h && h->dynindx != -1 ? h->dynindx : 0;
|
||||
|
||||
need_relocs =
|
||||
- (bfd_link_pic (info) || indx != 0) &&
|
||||
+ (!bfd_link_executable (info) || indx != 0) &&
|
||||
(h == NULL
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
|| h->root.type != bfd_link_hash_undefweak);
|
||||
@@ -8195,7 +8200,10 @@ elfNN_aarch64_allocate_dynrelocs (struct
|
||||
if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
|| h->root.type != bfd_link_hash_undefweak)
|
||||
&& (bfd_link_pic (info)
|
||||
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
|
||||
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
|
||||
+ /* Undefined weak symbol in static PIE resolves to 0 without
|
||||
+ any dynamic relocations. */
|
||||
+ && !UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
|
||||
{
|
||||
htab->root.srelgot->size += RELOC_SIZE (htab);
|
||||
}
|
||||
@@ -8227,7 +8235,7 @@ elfNN_aarch64_allocate_dynrelocs (struct
|
||||
indx = h && h->dynindx != -1 ? h->dynindx : 0;
|
||||
if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
|| h->root.type != bfd_link_hash_undefweak)
|
||||
- && (bfd_link_pic (info)
|
||||
+ && (!bfd_link_executable (info)
|
||||
|| indx != 0
|
||||
|| WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
|
||||
{
|
||||
@@ -8995,7 +9003,10 @@ elfNN_aarch64_finish_dynamic_symbol (bfd
|
||||
}
|
||||
|
||||
if (h->got.offset != (bfd_vma) - 1
|
||||
- && elf_aarch64_hash_entry (h)->got_type == GOT_NORMAL)
|
||||
+ && elf_aarch64_hash_entry (h)->got_type == GOT_NORMAL
|
||||
+ /* Undefined weak symbol in static PIE resolves to 0 without
|
||||
+ any dynamic relocations. */
|
||||
+ && !UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
|
||||
{
|
||||
Elf_Internal_Rela rela;
|
||||
bfd_byte *loc;
|
||||
Only in binutils-2.29.1/bfd: elfnn-aarch64.c.orig
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
--- binutils.orig/bfd/elfnn-aarch64.c 2025-02-07 13:42:20.961333141 +0000
|
||||
+++ binutils-with-gold-2.44/bfd/elfnn-aarch64.c 2025-02-07 13:42:29.781353740 +0000
|
||||
@@ -10162,7 +10162,8 @@ elfNN_aarch64_init_small_plt0_entry (bfd
|
||||
/* PR 26312: Explicitly set the sh_entsize to 0 so that
|
||||
consumers do not think that the section contains fixed
|
||||
sized objects. */
|
||||
- elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0;
|
||||
+ if (elf_section_data (htab->root.splt->output_section) != NULL)
|
||||
+ elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0;
|
||||
|
||||
plt_got_2nd_ent = (htab->root.sgotplt->output_section->vma
|
||||
+ htab->root.sgotplt->output_offset
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- binutils.orig/config/override.m4 2021-08-31 14:20:17.275574804 +0100
|
||||
+++ binutils-2.37/config/override.m4 2021-08-31 14:36:37.793954247 +0100
|
||||
@@ -41,7 +41,7 @@ dnl Or for updating the whole tree at on
|
||||
AC_DEFUN([_GCC_AUTOCONF_VERSION_CHECK],
|
||||
[m4_if(m4_defn([_GCC_AUTOCONF_VERSION]),
|
||||
m4_defn([m4_PACKAGE_VERSION]), [],
|
||||
- [m4_fatal([Please use exactly Autoconf ]_GCC_AUTOCONF_VERSION[ instead of ]m4_defn([m4_PACKAGE_VERSION])[.])])
|
||||
+ [])
|
||||
])
|
||||
m4_define([AC_INIT], m4_defn([AC_INIT])[
|
||||
_GCC_AUTOCONF_VERSION_CHECK
|
||||
39
binutils-debug-section-marking.patch
Normal file
39
binutils-debug-section-marking.patch
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
--- binutils.orig/bfd/elflink.c 2018-03-14 10:14:49.729271271 +0000
|
||||
+++ binutils-2.30/bfd/elflink.c 2018-03-14 10:15:15.748967793 +0000
|
||||
@@ -12785,7 +12785,7 @@ _bfd_elf_gc_mark_hook (asection *sec,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-/* Return the global debug definition section. */
|
||||
+/* Return the debug definition section. */
|
||||
|
||||
static asection *
|
||||
elf_gc_mark_debug_section (asection *sec ATTRIBUTE_UNUSED,
|
||||
@@ -12794,11 +12794,22 @@ elf_gc_mark_debug_section (asection *sec
|
||||
struct elf_link_hash_entry *h,
|
||||
Elf_Internal_Sym *sym ATTRIBUTE_UNUSED)
|
||||
{
|
||||
- if (h != NULL
|
||||
- && (h->root.type == bfd_link_hash_defined
|
||||
- || h->root.type == bfd_link_hash_defweak)
|
||||
- && (h->root.u.def.section->flags & SEC_DEBUGGING) != 0)
|
||||
- return h->root.u.def.section;
|
||||
+ if (h != NULL)
|
||||
+ {
|
||||
+ /* Return the global debug definition section. */
|
||||
+ if ((h->root.type == bfd_link_hash_defined
|
||||
+ || h->root.type == bfd_link_hash_defweak)
|
||||
+ && (h->root.u.def.section->flags & SEC_DEBUGGING) != 0)
|
||||
+ return h->root.u.def.section;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* Return the local debug definition section. */
|
||||
+ asection *isec = bfd_section_from_elf_index (sec->owner,
|
||||
+ sym->st_shndx);
|
||||
+ if ((isec->flags & SEC_DEBUGGING) != 0)
|
||||
+ return isec;
|
||||
+ }
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
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
|
||||
|
||||
-# Check whether -static-libstdc++ -static-libgcc is supported.
|
||||
-have_static_libs=no
|
||||
-if test "$GCC" = yes; then
|
||||
- saved_LDFLAGS="$LDFLAGS"
|
||||
-
|
||||
- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++ -static-libgcc" >&5
|
||||
-$as_echo_n "checking whether g++ accepts -static-libstdc++ -static-libgcc... " >&6; }
|
||||
- ac_ext=cpp
|
||||
-ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
-
|
||||
-
|
||||
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
-/* end confdefs.h. */
|
||||
-
|
||||
-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
|
||||
-#error -static-libstdc++ not implemented
|
||||
-#endif
|
||||
-int main() {}
|
||||
-_ACEOF
|
||||
-if ac_fn_cxx_try_link "$LINENO"; then :
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
-$as_echo "yes" >&6; }; have_static_libs=yes
|
||||
-else
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
-$as_echo "no" >&6; }
|
||||
-fi
|
||||
-rm -f core conftest.err conftest.$ac_objext \
|
||||
- conftest$ac_exeext conftest.$ac_ext
|
||||
- ac_ext=c
|
||||
-ac_cpp='$CPP $CPPFLAGS'
|
||||
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
-
|
||||
-
|
||||
- LDFLAGS="$saved_LDFLAGS"
|
||||
-fi
|
||||
-
|
||||
-
|
||||
|
||||
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
--- binutils.orig/configure.ac 2024-11-26 15:08:50.162328683 +0000
|
||||
+++ binutils-2.43.50-1686dc7079f/configure.ac 2024-11-26 15:08:56.929374527 +0000
|
||||
@@ -1410,26 +1410,6 @@ if test -z "$LD"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
-# Check whether -static-libstdc++ -static-libgcc is supported.
|
||||
-have_static_libs=no
|
||||
-if test "$GCC" = yes; then
|
||||
- saved_LDFLAGS="$LDFLAGS"
|
||||
-
|
||||
- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
|
||||
- AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
|
||||
- AC_LANG_PUSH(C++)
|
||||
- AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
|
||||
-#error -static-libstdc++ not implemented
|
||||
-#endif
|
||||
-int main() {}])],
|
||||
- [AC_MSG_RESULT([yes]); have_static_libs=yes],
|
||||
- [AC_MSG_RESULT([no])])
|
||||
- AC_LANG_POP(C++)
|
||||
-
|
||||
- LDFLAGS="$saved_LDFLAGS"
|
||||
-fi
|
||||
-
|
||||
ACX_PROG_GNAT
|
||||
ACX_PROG_GDC
|
||||
ACX_PROG_CARGO
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
diff -rup binutils.orig/bfd/Makefile.am binutils-2.32/bfd/Makefile.am
|
||||
--- binutils.orig/bfd/Makefile.am 2019-02-08 12:22:51.395684251 +0000
|
||||
+++ binutils-2.32/bfd/Makefile.am 2019-02-08 12:22:53.970664973 +0000
|
||||
@@ -33,7 +33,7 @@ bfdlibdir = @bfdlibdir@
|
||||
bfdincludedir = @bfdincludedir@
|
||||
bfdlib_LTLIBRARIES = libbfd.la
|
||||
bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
|
||||
- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
|
||||
+ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
|
||||
else !INSTALL_LIBBFD
|
||||
# Empty these so that the respective installation directories will not be created.
|
||||
bfdlibdir =
|
||||
diff -rup binutils.orig/bfd/Makefile.in binutils-2.32/bfd/Makefile.in
|
||||
--- binutils.orig/bfd/Makefile.in 2019-02-08 12:21:35.291254044 +0000
|
||||
+++ binutils-2.32/bfd/Makefile.in 2019-02-08 12:22:10.163992947 +0000
|
||||
@@ -249,7 +249,7 @@ am__can_run_installinfo = \
|
||||
esac
|
||||
am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \
|
||||
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
|
||||
- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
|
||||
+ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
|
||||
HEADERS = $(bfdinclude_HEADERS)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
@@ -468,7 +468,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel
|
||||
@INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2)
|
||||
@INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \
|
||||
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
|
||||
-@INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h \
|
||||
+@INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h \
|
||||
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2)
|
||||
@INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@
|
||||
@INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- binutils.orig/binutils/testsuite/binutils-all/ar.exp 2024-02-07 13:02:23.490031197 +0000
|
||||
+++ binutils-2.42/binutils/testsuite/binutils-all/ar.exp 2024-02-07 13:03:10.285034069 +0000
|
||||
@@ -1017,7 +1017,7 @@ symbol_table
|
||||
argument_parsing
|
||||
deterministic_archive
|
||||
replacing_deterministic_member
|
||||
-replacing_non_deterministic_member
|
||||
+# replacing_non_deterministic_member
|
||||
replacing_sde_deterministic_member
|
||||
delete_an_element
|
||||
move_an_element
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
diff -rup binutils.orig/gold/gdb-index.cc binutils-2.34.0/gold/gdb-index.cc
|
||||
--- binutils.orig/gold/gdb-index.cc 2020-07-24 09:12:29.241306445 +0100
|
||||
+++ binutils-2.34.0/gold/gdb-index.cc 2020-07-24 09:15:48.332095898 +0100
|
||||
@@ -817,7 +817,7 @@ Gdb_index_info_reader::get_qualified_nam
|
||||
void
|
||||
Gdb_index_info_reader::record_cu_ranges(Dwarf_die* die)
|
||||
{
|
||||
- unsigned int shndx;
|
||||
+ unsigned int shndx = 0;
|
||||
unsigned int shndx2;
|
||||
|
||||
off_t ranges_offset = die->ref_attribute(elfcpp::DW_AT_ranges, &shndx);
|
||||
diff -rup binutils.orig/gold/layout.cc binutils-2.34.0/gold/layout.cc
|
||||
--- binutils.orig/gold/layout.cc 2020-07-24 09:12:29.243306433 +0100
|
||||
+++ binutils-2.34.0/gold/layout.cc 2020-07-24 09:15:11.464320064 +0100
|
||||
@@ -1986,7 +1986,7 @@ Layout::attach_allocated_section_to_segm
|
||||
seg_flags |= os->extra_segment_flags();
|
||||
|
||||
// Check for --section-start.
|
||||
- uint64_t addr;
|
||||
+ uint64_t addr = 0;
|
||||
bool is_address_set = parameters->options().section_start(os->name(), &addr);
|
||||
|
||||
// In general the only thing we really care about for PT_LOAD
|
||||
diff -rup binutils.orig/binutils/dlltool.c binutils-2.34.0/binutils/dlltool.c
|
||||
--- binutils.orig/binutils/dlltool.c 2020-07-24 09:12:28.974308069 +0100
|
||||
+++ binutils-2.34.0/binutils/dlltool.c 2020-07-24 12:09:37.527121295 +0100
|
||||
@@ -1305,7 +1305,7 @@ run (const char *what, char *args)
|
||||
int pid, wait_status;
|
||||
int i;
|
||||
const char **argv;
|
||||
- char *errmsg_fmt, *errmsg_arg;
|
||||
+ char *errmsg_fmt = "", *errmsg_arg = "";
|
||||
char *temp_base = choose_temp_base ();
|
||||
|
||||
inform (_("run: %s %s"), what, args);
|
||||
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
|
||||
--- binutils.orig/gas/config/tc-arm.c 2020-07-24 09:12:32.368287432 +0100
|
||||
+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:14:19.842360634 +0100
|
||||
@@ -28416,9 +28416,12 @@ md_apply_fix (fixS * fixP,
|
||||
perform relaxation. */
|
||||
if (value == -2)
|
||||
{
|
||||
- newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
- newval = 0xbf00; /* NOP encoding T1 */
|
||||
- md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
+ if (fixP->fx_done || !seg->use_rela_p)
|
||||
+ {
|
||||
+ newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
+ newval = 0xbf00; /* NOP encoding T1 */
|
||||
+ md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -28631,17 +28634,14 @@ md_apply_fix (fixS * fixP,
|
||||
case BFD_RELOC_ARM_GOTFUNCDESC:
|
||||
case BFD_RELOC_ARM_GOTOFFFUNCDESC:
|
||||
case BFD_RELOC_ARM_FUNCDESC:
|
||||
- if (arm_fdpic)
|
||||
- {
|
||||
- if (fixP->fx_done || !seg->use_rela_p)
|
||||
- md_number_to_chars (buf, 0, 4);
|
||||
- }
|
||||
- else
|
||||
+ if (!arm_fdpic)
|
||||
{
|
||||
as_bad_where (fixP->fx_file, fixP->fx_line,
|
||||
_("Relocation supported only in FDPIC mode"));
|
||||
- }
|
||||
- break;
|
||||
+ break;
|
||||
+ }
|
||||
+ value = 0;
|
||||
+ /* Fall through. */
|
||||
#endif
|
||||
|
||||
case BFD_RELOC_RVA:
|
||||
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
|
||||
--- binutils.orig/gas/config/tc-arm.c 2020-07-24 12:16:02.099719884 +0100
|
||||
+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:34:17.690858328 +0100
|
||||
@@ -28641,7 +28641,7 @@ md_apply_fix (fixS * fixP,
|
||||
break;
|
||||
}
|
||||
value = 0;
|
||||
- /* Fall through. */
|
||||
+ goto fred;
|
||||
#endif
|
||||
|
||||
case BFD_RELOC_RVA:
|
||||
@@ -28653,6 +28653,7 @@ md_apply_fix (fixS * fixP,
|
||||
#ifdef TE_PE
|
||||
case BFD_RELOC_32_SECREL:
|
||||
#endif
|
||||
+ fred:
|
||||
if (fixP->fx_done || !seg->use_rela_p)
|
||||
#ifdef TE_WINCE
|
||||
/* For WinCE we only do this for pcrel fixups. */
|
||||
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
|
||||
--- binutils.orig/gas/config/tc-arm.c 2020-07-24 13:28:26.926553452 +0100
|
||||
+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 13:31:57.835215763 +0100
|
||||
@@ -28416,12 +28416,8 @@ md_apply_fix (fixS * fixP,
|
||||
perform relaxation. */
|
||||
if (value == -2)
|
||||
{
|
||||
- if (fixP->fx_done || !seg->use_rela_p)
|
||||
- {
|
||||
- newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
- newval = 0xbf00; /* NOP encoding T1 */
|
||||
- md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
- }
|
||||
+ newval = 0xbf00; /* NOP encoding T1 */
|
||||
+ goto jim;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -28432,6 +28428,7 @@ md_apply_fix (fixS * fixP,
|
||||
{
|
||||
newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3);
|
||||
+ jim:
|
||||
md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
}
|
||||
}
|
||||
diff -rup binutils.orig/binutils/mclex.c binutils-2.34.0/binutils/mclex.c
|
||||
--- binutils.orig/binutils/mclex.c 2020-07-24 13:28:26.297557441 +0100
|
||||
+++ binutils-2.34.0/binutils/mclex.c 2020-07-24 14:46:53.587940149 +0100
|
||||
@@ -207,7 +207,7 @@ enum_severity (int e)
|
||||
static void
|
||||
mc_add_keyword_ascii (const char *sz, int rid, const char *grp, rc_uint_type nv, const char *sv)
|
||||
{
|
||||
- unichar *usz, *usv = NULL;
|
||||
+ unichar *usz = NULL, *usv = NULL;
|
||||
rc_uint_type usz_len;
|
||||
|
||||
unicode_from_codepage (&usz_len, &usz, sz, CP_ACP);
|
||||
diff -rup binutils.orig/binutils/windmc.c binutils-2.34.0/binutils/windmc.c
|
||||
--- binutils.orig/binutils/windmc.c 2020-07-24 13:28:26.279557556 +0100
|
||||
+++ binutils-2.34.0/binutils/windmc.c 2020-07-24 14:48:05.460477478 +0100
|
||||
@@ -338,7 +338,7 @@ mc_add_node_lang (mc_node *root, const m
|
||||
static char *
|
||||
convert_unicode_to_ACP (const unichar *usz)
|
||||
{
|
||||
- char *s;
|
||||
+ char *s = NULL;
|
||||
rc_uint_type l;
|
||||
|
||||
if (! usz)
|
||||
@@ -607,10 +607,10 @@ mc_generate_bin_item (mc_node_lang *n, r
|
||||
else
|
||||
{
|
||||
rc_uint_type txt_len, l;
|
||||
- char *cvt_txt;
|
||||
+ char *cvt_txt = NULL;
|
||||
|
||||
codepage_from_unicode( &l, n->message, &cvt_txt, n->lang->lang_info.wincp);
|
||||
- if (! cvt_txt)
|
||||
+ if (cvt_txt == NULL)
|
||||
fatal ("Failed to convert message to language codepage.\n");
|
||||
txt_len = strlen (cvt_txt);
|
||||
if (mcset_automatic_null_termination && txt_len > 0)
|
||||
@@ -1107,7 +1107,7 @@ main (int argc, char **argv)
|
||||
|
||||
/* Load the input file and do code page transformations to UTF16. */
|
||||
{
|
||||
- unichar *u;
|
||||
+ unichar *u = NULL;
|
||||
rc_uint_type ul;
|
||||
char *buff;
|
||||
bfd_size_type flen;
|
||||
--- binutils.orig/binutils/srconv.c 2020-07-24 15:37:25.847459208 +0100
|
||||
+++ binutils-2.34.0/binutils/srconv.c 2020-07-24 15:39:12.853773423 +0100
|
||||
@@ -316,6 +316,7 @@ wr_hd (struct coff_ofile *p)
|
||||
struct IT_hd hd;
|
||||
|
||||
hd.spare1 = 0;
|
||||
+ hd.spare2 = 0;
|
||||
if (bfd_get_file_flags (abfd) & EXEC_P)
|
||||
hd.mt = MTYPE_ABS_LM;
|
||||
else
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- binutils.orig/gold/dwp.cc 2023-05-02 13:26:44.075148082 +0100
|
||||
+++ binutils-2.40/gold/dwp.cc 2023-05-02 13:27:16.189130127 +0100
|
||||
@@ -2418,6 +2418,8 @@ main(int argc, char** argv)
|
||||
{
|
||||
Dwo_file exe_file(exe_filename);
|
||||
exe_file.read_executable(&files);
|
||||
+ if (files.empty())
|
||||
+ gold_fatal(_("Could not find any dwo links in specified EXE"));
|
||||
}
|
||||
|
||||
// Add any additional files listed on command line.
|
||||
|
|
@ -1,193 +0,0 @@
|
|||
diff --git a/gold/i386.cc b/gold/i386.cc
|
||||
index bf209fe9a86..31161ff091c 100644
|
||||
--- a/gold/i386.cc
|
||||
+++ b/gold/i386.cc
|
||||
@@ -360,7 +360,11 @@ class Target_i386 : public Sized_target<32, false>
|
||||
got_(NULL), plt_(NULL), got_plt_(NULL), got_irelative_(NULL),
|
||||
got_tlsdesc_(NULL), global_offset_table_(NULL), rel_dyn_(NULL),
|
||||
rel_irelative_(NULL), copy_relocs_(elfcpp::R_386_COPY),
|
||||
- got_mod_index_offset_(-1U), tls_base_symbol_defined_(false)
|
||||
+ got_mod_index_offset_(-1U), tls_base_symbol_defined_(false),
|
||||
+ isa_1_used_(0), isa_1_needed_(0),
|
||||
+ feature_1_(0), feature_2_used_(0), feature_2_needed_(0),
|
||||
+ object_isa_1_used_(0), object_feature_1_(0),
|
||||
+ object_feature_2_used_(0), seen_first_object_(false)
|
||||
{ }
|
||||
|
||||
// Process the relocations to determine unreferenced sections for
|
||||
@@ -859,6 +863,21 @@ class Target_i386 : public Sized_target<32, false>
|
||||
this->rel_dyn_section(layout));
|
||||
}
|
||||
|
||||
+ // Record a target-specific program property in the .note.gnu.property
|
||||
+ // section.
|
||||
+ void
|
||||
+ record_gnu_property(unsigned int, unsigned int, size_t,
|
||||
+ const unsigned char*, const Object*);
|
||||
+
|
||||
+ // Merge the target-specific program properties from the current object.
|
||||
+ void
|
||||
+ merge_gnu_properties(const Object*);
|
||||
+
|
||||
+ // Finalize the target-specific program properties and add them back to
|
||||
+ // the layout.
|
||||
+ void
|
||||
+ do_finalize_gnu_properties(Layout*) const;
|
||||
+
|
||||
// Information about this specific target which we pass to the
|
||||
// general Target structure.
|
||||
static const Target::Target_info i386_info;
|
||||
@@ -898,6 +917,26 @@ class Target_i386 : public Sized_target<32, false>
|
||||
unsigned int got_mod_index_offset_;
|
||||
// True if the _TLS_MODULE_BASE_ symbol has been defined.
|
||||
bool tls_base_symbol_defined_;
|
||||
+
|
||||
+ // Target-specific program properties, from .note.gnu.property section.
|
||||
+ // Each bit represents a specific feature.
|
||||
+ uint32_t isa_1_used_;
|
||||
+ uint32_t isa_1_needed_;
|
||||
+ uint32_t feature_1_;
|
||||
+ uint32_t feature_2_used_;
|
||||
+ uint32_t feature_2_needed_;
|
||||
+ // Target-specific properties from the current object.
|
||||
+ // These bits get ORed into ISA_1_USED_ after all properties for the object
|
||||
+ // have been processed. But if either is all zeroes (as when the property
|
||||
+ // is absent from an object), the result should be all zeroes.
|
||||
+ // (See PR ld/23486.)
|
||||
+ uint32_t object_isa_1_used_;
|
||||
+ // These bits get ANDed into FEATURE_1_ after all properties for the object
|
||||
+ // have been processed.
|
||||
+ uint32_t object_feature_1_;
|
||||
+ uint32_t object_feature_2_used_;
|
||||
+ // Whether we have seen our first object, for use in initializing FEATURE_1_.
|
||||
+ bool seen_first_object_;
|
||||
};
|
||||
|
||||
const Target::Target_info Target_i386::i386_info =
|
||||
@@ -1042,6 +1081,126 @@ Target_i386::rel_irelative_section(Layout* layout)
|
||||
return this->rel_irelative_;
|
||||
}
|
||||
|
||||
+// Record a target-specific program property from the .note.gnu.property
|
||||
+// section.
|
||||
+void
|
||||
+Target_i386::record_gnu_property(
|
||||
+ unsigned int, unsigned int pr_type,
|
||||
+ size_t pr_datasz, const unsigned char* pr_data,
|
||||
+ const Object* object)
|
||||
+{
|
||||
+ uint32_t val = 0;
|
||||
+
|
||||
+ switch (pr_type)
|
||||
+ {
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED:
|
||||
+ if (pr_datasz != 4)
|
||||
+ {
|
||||
+ gold_warning(_("%s: corrupt .note.gnu.property section "
|
||||
+ "(pr_datasz for property %d is not 4)"),
|
||||
+ object->name().c_str(), pr_type);
|
||||
+ return;
|
||||
+ }
|
||||
+ val = elfcpp::Swap<32, false>::readval(pr_data);
|
||||
+ break;
|
||||
+ default:
|
||||
+ gold_warning(_("%s: unknown program property type 0x%x "
|
||||
+ "in .note.gnu.property section"),
|
||||
+ object->name().c_str(), pr_type);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ switch (pr_type)
|
||||
+ {
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
+ this->object_isa_1_used_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED:
|
||||
+ this->isa_1_needed_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND:
|
||||
+ // If we see multiple feature props in one object, OR them together.
|
||||
+ this->object_feature_1_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED:
|
||||
+ this->object_feature_2_used_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED:
|
||||
+ this->feature_2_needed_ |= val;
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+// Merge the target-specific program properties from the current object.
|
||||
+void
|
||||
+Target_i386::merge_gnu_properties(const Object*)
|
||||
+{
|
||||
+ if (this->seen_first_object_)
|
||||
+ {
|
||||
+ // If any object is missing the ISA_1_USED property, we must omit
|
||||
+ // it from the output file.
|
||||
+ if (this->object_isa_1_used_ == 0)
|
||||
+ this->isa_1_used_ = 0;
|
||||
+ else if (this->isa_1_used_ != 0)
|
||||
+ this->isa_1_used_ |= this->object_isa_1_used_;
|
||||
+ this->feature_1_ &= this->object_feature_1_;
|
||||
+ // If any object is missing the FEATURE_2_USED property, we must
|
||||
+ // omit it from the output file.
|
||||
+ if (this->object_feature_2_used_ == 0)
|
||||
+ this->feature_2_used_ = 0;
|
||||
+ else if (this->feature_2_used_ != 0)
|
||||
+ this->feature_2_used_ |= this->object_feature_2_used_;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ this->isa_1_used_ = this->object_isa_1_used_;
|
||||
+ this->feature_1_ = this->object_feature_1_;
|
||||
+ this->feature_2_used_ = this->object_feature_2_used_;
|
||||
+ this->seen_first_object_ = true;
|
||||
+ }
|
||||
+ this->object_isa_1_used_ = 0;
|
||||
+ this->object_feature_1_ = 0;
|
||||
+ this->object_feature_2_used_ = 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+add_property(Layout* layout, unsigned int pr_type, uint32_t val)
|
||||
+{
|
||||
+ unsigned char buf[4];
|
||||
+ elfcpp::Swap<32, false>::writeval(buf, val);
|
||||
+ layout->add_gnu_property(elfcpp::NT_GNU_PROPERTY_TYPE_0, pr_type, 4, buf);
|
||||
+}
|
||||
+
|
||||
+// Finalize the target-specific program properties and add them back to
|
||||
+// the layout.
|
||||
+void
|
||||
+Target_i386::do_finalize_gnu_properties(Layout* layout) const
|
||||
+{
|
||||
+ if (this->isa_1_used_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_ISA_1_USED,
|
||||
+ this->isa_1_used_);
|
||||
+ if (this->isa_1_needed_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED,
|
||||
+ this->isa_1_needed_);
|
||||
+ if (this->feature_1_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND,
|
||||
+ this->feature_1_);
|
||||
+ if (this->feature_2_used_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED,
|
||||
+ this->feature_2_used_);
|
||||
+ if (this->feature_2_needed_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED,
|
||||
+ this->feature_2_needed_);
|
||||
+}
|
||||
+
|
||||
// Write the first three reserved words of the .got.plt section.
|
||||
// The remainder of the section is written while writing the PLT
|
||||
// in Output_data_plt_i386::do_write.
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
diff -rup binutils.orig/gold/options.h binutils-2.41/gold/options.h
|
||||
--- binutils.orig/gold/options.h 2024-01-04 09:52:09.282002253 +0000
|
||||
+++ binutils-2.41/gold/options.h 2024-01-04 09:52:51.890972630 +0000
|
||||
@@ -855,6 +855,12 @@ class General_options
|
||||
N_("(ARM only) Do not warn about objects with incompatible "
|
||||
"enum sizes"));
|
||||
|
||||
+ DEFINE_bool_ignore(error_execstack, options::TWO_DASHES, '\0',
|
||||
+ N_("Ignored"), N_("Ignored"));
|
||||
+
|
||||
+ DEFINE_bool_ignore(error_rwx_segments, options::TWO_DASHES, '\0',
|
||||
+ N_("Ignored"), N_("Ignored"));
|
||||
+
|
||||
DEFINE_special(exclude_libs, options::TWO_DASHES, '\0',
|
||||
N_("Exclude libraries from automatic export"),
|
||||
N_(("lib,lib ...")));
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
diff -rup binutils.orig/gold/layout.cc binutils-2.32/gold/layout.cc
|
||||
--- binutils.orig/gold/layout.cc 2019-06-24 14:37:36.013086899 +0100
|
||||
+++ binutils-2.32/gold/layout.cc 2019-06-24 14:41:40.054517479 +0100
|
||||
@@ -868,6 +868,7 @@ Layout::get_output_section(const char* n
|
||||
&& (same_name->flags() & elfcpp::SHF_TLS) == 0)
|
||||
os = same_name;
|
||||
}
|
||||
+#if 0 /* BZ 1722715, PR 17556. */
|
||||
else if ((flags & elfcpp::SHF_TLS) == 0)
|
||||
{
|
||||
elfcpp::Elf_Xword zero_flags = 0;
|
||||
@@ -878,6 +879,7 @@ Layout::get_output_section(const char* n
|
||||
if (p != this->section_name_map_.end())
|
||||
os = p->second;
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
if (os == NULL)
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
diff --git a/gold/options.cc b/gold/options.cc
|
||||
index c9834b66159..91d7802fffe 100644
|
||||
--- a/gold/options.cc
|
||||
+++ b/gold/options.cc
|
||||
@@ -989,7 +989,7 @@ parse_short_option(int argc, const char** argv, int pos_in_argv_i,
|
||||
}
|
||||
|
||||
// If we're a -z option, we need to parse our argument as a
|
||||
- // long-option, e.g. "-z stacksize=8192".
|
||||
+ // long-option, e.g. "-z stack-size=8192".
|
||||
if (retval == &dash_z)
|
||||
{
|
||||
int dummy_i = 0;
|
||||
diff --git a/gold/options.h b/gold/options.h
|
||||
index 46f658f23ea..d16e38066da 100644
|
||||
--- a/gold/options.h
|
||||
+++ b/gold/options.h
|
||||
@@ -1110,6 +1110,9 @@ class General_options
|
||||
N_("Generate package metadata note"),
|
||||
N_("[=JSON]"));
|
||||
|
||||
+ DEFINE_bool_ignore(pack_relative_relocs, options::DASH_Z, '\0',
|
||||
+ N_("Ignored"), N_("Ignored"));
|
||||
+
|
||||
DEFINE_bool(pie, options::ONE_DASH, '\0', false,
|
||||
N_("Create a position independent executable"),
|
||||
N_("Do not create a position independent executable"));
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
# The gold linker does not build if the target list includes s390x-linux
|
||||
# but does not include s390-linux. ie it needs the 32-bit target to be
|
||||
# enabled in order for the 64-bit target to work. On the other hand the
|
||||
# BFD library does not support the 32-bit s390 target. So this patch
|
||||
# "enhances" the gold configure script so that if s390x is listed, the
|
||||
# s390 target will automatically be added to the list as well.
|
||||
|
||||
diff -upr orig/gold/configure binutils-2.47/gold/configure
|
||||
--- orig/gold/configure 2026-07-27 09:38:54.907192013 +0100
|
||||
+++ binutils-2.47/gold/configure 2026-07-27 10:12:02.759629540 +0100
|
||||
@@ -5223,7 +5223,12 @@ if test -n "$enable_targets"; then
|
||||
for targ in `echo $enable_targets | sed -e 's/,/ /g'`; do
|
||||
result=`$ac_config_sub $targ 2>/dev/null`
|
||||
if test -n "$result"; then
|
||||
- canon_targets="$canon_targets $result"
|
||||
+ canon_targets="$canon_targets $result" ;
|
||||
+ case "$result" in
|
||||
+ s390x-*)
|
||||
+ canon_targets="$canon_targets s390-gnu-linux"
|
||||
+ ;;
|
||||
+ esac
|
||||
else
|
||||
# Permit unrecognized target names, like "all".
|
||||
canon_targets="$canon_targets $targ"
|
||||
diff -upr orig/gold/configure.ac binutils-2.47/gold/configure.ac
|
||||
--- orig/gold/configure.ac 2026-07-27 09:38:54.907192013 +0100
|
||||
+++ binutils-2.47/gold/configure.ac 2026-07-27 10:18:18.480766140 +0100
|
||||
@@ -133,6 +133,12 @@ if test -n "$enable_targets"; then
|
||||
result=`$ac_config_sub $targ 2>/dev/null`
|
||||
if test -n "$result"; then
|
||||
canon_targets="$canon_targets $result"
|
||||
+ # Hack: Enable the s390-linux target if s390x-linux is enabled.
|
||||
+ case "$result" in
|
||||
+ s390x-*)
|
||||
+ canon_targets="$canon_targets s390-gnu-linux"
|
||||
+ ;;
|
||||
+ esac
|
||||
else
|
||||
# Permit unrecognized target names, like "all".
|
||||
canon_targets="$canon_targets $targ"
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
Only in binutils-2.34/gold: autom4te.cache
|
||||
diff -rup binutils.orig/gold/configure binutils-2.34/gold/configure
|
||||
--- binutils.orig/gold/configure 2020-04-20 12:35:13.048297305 +0100
|
||||
+++ binutils-2.34/gold/configure 2020-04-20 14:02:06.743725696 +0100
|
||||
@@ -5180,7 +5180,8 @@ for targ in $target $canon_targets; do
|
||||
. ${srcdir}/configure.tgt
|
||||
|
||||
if test "$targ_obj" = "UNKNOWN"; then
|
||||
- as_fn_error $? "\"unsupported target $targ\"" "$LINENO" 5
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"unsupported target $targ\"" >&5
|
||||
+$as_echo "$as_me: WARNING: \"unsupported target $targ\"" >&2;}
|
||||
else
|
||||
targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
|
||||
if test "$targ_extra_obj" != ""; then
|
||||
diff -rup binutils.orig/gold/configure.ac binutils-2.34/gold/configure.ac
|
||||
--- binutils.orig/gold/configure.ac 2020-04-20 12:35:13.050297291 +0100
|
||||
+++ binutils-2.34/gold/configure.ac 2020-04-20 14:01:46.435868770 +0100
|
||||
@@ -181,7 +181,7 @@ for targ in $target $canon_targets; do
|
||||
. ${srcdir}/configure.tgt
|
||||
|
||||
if test "$targ_obj" = "UNKNOWN"; then
|
||||
- AC_MSG_ERROR("unsupported target $targ")
|
||||
+ AC_MSG_WARN("unsupported target $targ")
|
||||
else
|
||||
targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
|
||||
if test "$targ_extra_obj" != ""; then
|
||||
--- binutils.orig/bfd/config.bfd 2020-04-20 12:35:13.038297375 +0100
|
||||
+++ binutils-2.34/bfd/config.bfd 2020-04-20 14:25:26.452869193 +0100
|
||||
@@ -473,7 +473,7 @@ case "${targ}" in
|
||||
;;
|
||||
|
||||
#ifdef BFD64
|
||||
- bpf-*-none)
|
||||
+ bpf-*-none | bpf-*)
|
||||
targ_defvec=bpf_elf64_le_vec
|
||||
targ_selvecs=bpf_elf64_be_vec
|
||||
targ_underscore=yes
|
||||
--- 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
|
||||
;;
|
||||
139
binutils-ifunc-relocs-in-notes.patch
Normal file
139
binutils-ifunc-relocs-in-notes.patch
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.29.1/bfd/elf32-i386.c
|
||||
--- binutils.orig/bfd/elf32-i386.c 2018-03-09 15:55:56.812856843 +0000
|
||||
+++ binutils-2.29.1/bfd/elf32-i386.c 2018-03-09 16:00:45.104464000 +0000
|
||||
@@ -4080,6 +4080,10 @@ elf_i386_relocate_section (bfd *output_b
|
||||
|
||||
if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
{
|
||||
+ /* If this is a SHT_NOTE section without SHF_ALLOC, treat
|
||||
+ STT_GNU_IFUNC symbol as STT_FUNC. */
|
||||
+ if (elf_section_type (input_section) == SHT_NOTE)
|
||||
+ goto skip_ifunc;
|
||||
/* Dynamic relocs are not propagated for SEC_DEBUGGING
|
||||
sections because such sections are not SEC_ALLOC and
|
||||
thus ld.so will not process them. */
|
||||
@@ -4301,6 +4305,7 @@ do_ifunc_pointer:
|
||||
}
|
||||
}
|
||||
|
||||
+ skip_ifunc:
|
||||
resolved_to_zero = (eh != NULL
|
||||
&& UNDEFINED_WEAK_RESOLVED_TO_ZERO (info,
|
||||
eh->has_got_reloc,
|
||||
diff -rup binutils.orig/bfd/elf32-s390.c binutils-2.29.1/bfd/elf32-s390.c
|
||||
--- binutils.orig/bfd/elf32-s390.c 2018-03-09 15:55:56.827856667 +0000
|
||||
+++ binutils-2.29.1/bfd/elf32-s390.c 2018-03-09 16:00:37.519553849 +0000
|
||||
@@ -2770,6 +2770,9 @@ elf_s390_relocate_section (bfd *output_b
|
||||
case R_390_8:
|
||||
case R_390_16:
|
||||
case R_390_32:
|
||||
+ if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
+ break;
|
||||
+
|
||||
if (h != NULL
|
||||
&& s390_is_ifunc_symbol_p (h)
|
||||
&& h->def_regular)
|
||||
@@ -2831,9 +2834,6 @@ elf_s390_relocate_section (bfd *output_b
|
||||
}
|
||||
}
|
||||
|
||||
- if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
- break;
|
||||
-
|
||||
if ((bfd_link_pic (info)
|
||||
&& (h == NULL
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.29.1/bfd/elf64-s390.c
|
||||
--- binutils.orig/bfd/elf64-s390.c 2018-03-09 15:55:56.812856843 +0000
|
||||
+++ binutils-2.29.1/bfd/elf64-s390.c 2018-03-09 16:00:29.038654304 +0000
|
||||
@@ -2739,6 +2739,9 @@ elf_s390_relocate_section (bfd *output_b
|
||||
case R_390_32:
|
||||
case R_390_64:
|
||||
|
||||
+ if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
+ break;
|
||||
+
|
||||
if (h != NULL
|
||||
&& s390_is_ifunc_symbol_p (h)
|
||||
&& h->def_regular)
|
||||
@@ -2801,9 +2804,6 @@ elf_s390_relocate_section (bfd *output_b
|
||||
}
|
||||
}
|
||||
|
||||
- if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
- break;
|
||||
-
|
||||
if ((bfd_link_pic (info)
|
||||
&& (h == NULL
|
||||
|| (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.29.1/bfd/elf64-x86-64.c
|
||||
--- binutils.orig/bfd/elf64-x86-64.c 2018-03-09 15:55:56.826856678 +0000
|
||||
+++ binutils-2.29.1/bfd/elf64-x86-64.c 2018-03-09 16:00:20.798751915 +0000
|
||||
@@ -4409,6 +4409,10 @@ elf_x86_64_relocate_section (bfd *output
|
||||
|
||||
if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
{
|
||||
+ /* If this is a SHT_NOTE section without SHF_ALLOC, treat
|
||||
+ STT_GNU_IFUNC symbol as STT_FUNC. */
|
||||
+ if (elf_section_type (input_section) == SHT_NOTE)
|
||||
+ goto skip_ifunc;
|
||||
/* Dynamic relocs are not propagated for SEC_DEBUGGING
|
||||
sections because such sections are not SEC_ALLOC and
|
||||
thus ld.so will not process them. */
|
||||
@@ -4634,6 +4638,7 @@ do_ifunc_pointer:
|
||||
}
|
||||
}
|
||||
|
||||
+ skip_ifunc:
|
||||
resolved_to_zero = (eh != NULL
|
||||
&& UNDEFINED_WEAK_RESOLVED_TO_ZERO (info,
|
||||
eh->has_got_reloc,
|
||||
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.29.1/bfd/elfnn-aarch64.c
|
||||
--- binutils.orig/bfd/elfnn-aarch64.c 2018-03-09 15:55:56.821856737 +0000
|
||||
+++ binutils-2.29.1/bfd/elfnn-aarch64.c 2018-03-09 16:00:13.181842141 +0000
|
||||
@@ -4984,6 +4984,11 @@ elfNN_aarch64_final_link_relocate (reloc
|
||||
|
||||
if ((input_section->flags & SEC_ALLOC) == 0)
|
||||
{
|
||||
+ /* If this is a SHT_NOTE section without SHF_ALLOC, treat
|
||||
+ STT_GNU_IFUNC symbol as STT_FUNC. */
|
||||
+ if (elf_section_type (input_section) == SHT_NOTE)
|
||||
+ goto skip_ifunc;
|
||||
+
|
||||
/* Dynamic relocs are not propagated for SEC_DEBUGGING
|
||||
sections because such sections are not SEC_ALLOC and
|
||||
thus ld.so will not process them. */
|
||||
@@ -5177,6 +5182,7 @@ bad_ifunc_reloc:
|
||||
}
|
||||
}
|
||||
|
||||
+ skip_ifunc:
|
||||
resolved_to_zero = (h != NULL
|
||||
&& UNDEFWEAK_NO_DYNAMIC_RELOC (info, h));
|
||||
|
||||
diff -rup binutils.orig/bfd/elfxx-sparc.c binutils-2.29.1/bfd/elfxx-sparc.c
|
||||
--- binutils.orig/bfd/elfxx-sparc.c 2018-03-09 15:55:56.822856726 +0000
|
||||
+++ binutils-2.29.1/bfd/elfxx-sparc.c 2018-03-09 16:00:02.604967430 +0000
|
||||
@@ -3203,7 +3203,13 @@ _bfd_sparc_elf_relocate_section (bfd *ou
|
||||
|
||||
if ((input_section->flags & SEC_ALLOC) == 0
|
||||
|| h->plt.offset == (bfd_vma) -1)
|
||||
- abort ();
|
||||
+ {
|
||||
+ /* If this is a SHT_NOTE section without SHF_ALLOC, treat
|
||||
+ STT_GNU_IFUNC symbol as STT_FUNC. */
|
||||
+ if (elf_section_type (input_section) == SHT_NOTE)
|
||||
+ goto skip_ifunc;
|
||||
+ abort ();
|
||||
+ }
|
||||
|
||||
plt_sec = htab->elf.splt;
|
||||
if (! plt_sec)
|
||||
@@ -3307,6 +3313,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
|
||||
}
|
||||
}
|
||||
|
||||
+ skip_ifunc:
|
||||
eh = (struct _bfd_sparc_elf_link_hash_entry *) h;
|
||||
resolved_to_zero = (eh != NULL
|
||||
&& UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh));
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
diff -rup binutils.orig/bfd/elflink.c binutils-with-gold-2.45.50-be970c68891/bfd/elflink.c
|
||||
--- binutils.orig/bfd/elflink.c 2026-01-14 09:21:14.835847967 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/bfd/elflink.c 2026-01-14 09:23:48.780495205 +0000
|
||||
@@ -13786,7 +13786,7 @@ _bfd_elf_final_link (bfd *abfd, struct b
|
||||
{
|
||||
if (info->textrel_check == textrel_check_error)
|
||||
info->callbacks->einfo
|
||||
- (_("%P%X: read-only segment has dynamic relocations\n"));
|
||||
+ (_("%P%X: error: read-only segment has dynamic relocations\n"));
|
||||
else if (bfd_link_dll (info))
|
||||
info->callbacks->einfo
|
||||
(_("%P: warning: creating DT_TEXTREL in a shared object\n"));
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-mode.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-mode.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-mode.d 2026-01-14 09:21:15.248851537 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-mode.d 2026-01-14 09:22:24.603416270 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: dt-memtag.s
|
||||
-#ld: -shared -z memtag-mode=async
|
||||
+#ld: -shared -z memtag-mode=async -z notext
|
||||
#readelf: -d
|
||||
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-stack.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-stack.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/dt-memtag-stack.d 2026-01-14 09:21:15.248851537 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/dt-memtag-stack.d 2026-01-14 09:24:19.594780414 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: dt-memtag.s
|
||||
-#ld: -shared -z memtag-stack
|
||||
+#ld: -shared -z memtag-stack -z notext
|
||||
#readelf: -d
|
||||
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/relr-text-pie.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-pie.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/relr-text-pie.d 2026-01-14 09:21:15.246851520 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-pie.d 2026-01-14 09:24:45.363485698 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: relr-text.s
|
||||
-#ld: -pie -z pack-relative-relocs -T relocs.ld
|
||||
+#ld: -pie -z pack-relative-relocs -T relocs.ld -z notext
|
||||
#readelf: -drW
|
||||
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-aarch64/relr-text-shared.d binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-shared.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/relr-text-shared.d 2026-01-14 09:21:15.246851520 +0000
|
||||
+++ binutils-with-gold-2.45.50-be970c68891/ld/testsuite/ld-aarch64/relr-text-shared.d 2026-01-14 09:25:06.651664713 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#source: relr-text.s
|
||||
-#ld: -shared -z pack-relative-relocs -T relocs.ld
|
||||
+#ld: -shared -z pack-relative-relocs -T relocs.ld -z notext
|
||||
#readelf: -drW
|
||||
|
||||
#...
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
diff -rup binutils.orig/ltmain.sh binutils-2.37/ltmain.sh
|
||||
--- binutils.orig/ltmain.sh 2022-01-27 16:23:09.304207432 +0000
|
||||
+++ binutils-2.37/ltmain.sh 2022-01-27 16:23:18.380143759 +0000
|
||||
@@ -7103,6 +7103,7 @@ EOF
|
||||
rpath="$finalize_rpath"
|
||||
test "$mode" != relink && rpath="$compile_rpath$rpath"
|
||||
for libdir in $rpath; do
|
||||
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
|
||||
if test -n "$hardcode_libdir_flag_spec"; then
|
||||
if test -n "$hardcode_libdir_separator"; then
|
||||
if test -z "$hardcode_libdirs"; then
|
||||
@@ -7798,6 +7799,7 @@ EOF
|
||||
rpath=
|
||||
hardcode_libdirs=
|
||||
for libdir in $compile_rpath $finalize_rpath; do
|
||||
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
|
||||
if test -n "$hardcode_libdir_flag_spec"; then
|
||||
if test -n "$hardcode_libdir_separator"; then
|
||||
if test -z "$hardcode_libdirs"; then
|
||||
@@ -7849,6 +7851,7 @@ EOF
|
||||
rpath=
|
||||
hardcode_libdirs=
|
||||
for libdir in $finalize_rpath; do
|
||||
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
|
||||
if test -n "$hardcode_libdir_flag_spec"; then
|
||||
if test -n "$hardcode_libdir_separator"; then
|
||||
if test -z "$hardcode_libdirs"; then
|
||||
Only in binutils-2.37: ltmain.sh.orig
|
||||
22
binutils-ppc64-stub-creation.patch
Normal file
22
binutils-ppc64-stub-creation.patch
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
--- binutils.orig/bfd/elf64-ppc.c 2018-01-25 13:23:13.575860963 +0000
|
||||
+++ binutils-2.29.1/bfd/elf64-ppc.c 2018-01-25 13:24:36.564874275 +0000
|
||||
@@ -12805,6 +12805,9 @@ ppc64_elf_size_stubs (struct bfd_link_in
|
||||
stub_sec->flags &= ~SEC_RELOC;
|
||||
}
|
||||
|
||||
+ if (htab->stub_iteration <= STUB_SHRINK_ITER
|
||||
+ || htab->brlt->rawsize < htab->brlt->size)
|
||||
+ htab->brlt->rawsize = htab->brlt->size;
|
||||
htab->brlt->size = 0;
|
||||
htab->brlt->reloc_count = 0;
|
||||
htab->brlt->flags &= ~SEC_RELOC;
|
||||
@@ -12858,6 +12861,9 @@ ppc64_elf_size_stubs (struct bfd_link_in
|
||||
break;
|
||||
|
||||
if (group == NULL
|
||||
+ && (htab->brlt->rawsize == htab->brlt->size
|
||||
+ || (htab->stub_iteration > STUB_SHRINK_ITER
|
||||
+ && htab->brlt->rawsize > htab->brlt->size))
|
||||
&& (htab->glink_eh_frame == NULL
|
||||
|| htab->glink_eh_frame->rawsize == htab->glink_eh_frame->size))
|
||||
break;
|
||||
66
binutils-readelf-other-sym-info.patch
Normal file
66
binutils-readelf-other-sym-info.patch
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
diff -rup binutils.orig/binutils/readelf.c binutils-2.29/binutils/readelf.c
|
||||
--- binutils.orig/binutils/readelf.c 2017-12-12 16:24:19.571221194 +0000
|
||||
+++ binutils-2.29/binutils/readelf.c 2017-12-12 16:27:26.997979803 +0000
|
||||
@@ -11018,12 +11018,14 @@ print_dynamic_symbol (bfd_vma si, unsign
|
||||
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 (psym->st_other ^ vis));
|
||||
+#endif
|
||||
}
|
||||
|
||||
printf (" %3.3s ", get_symbol_index_type (psym->st_shndx));
|
||||
@@ -11031,6 +11033,15 @@ print_dynamic_symbol (bfd_vma si, unsign
|
||||
print_symbol (25, GET_DYNAMIC_NAME (psym->st_name));
|
||||
else
|
||||
printf (_(" <corrupt: %14ld>"), psym->st_name);
|
||||
+#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 (psym->st_other ^ vis));
|
||||
+ }
|
||||
+#endif
|
||||
putchar ('\n');
|
||||
}
|
||||
|
||||
--- binutils.orig/binutils/readelf.c 2017-12-12 16:36:21.806561149 +0000
|
||||
+++ binutils-2.29.1/binutils/readelf.c 2017-12-12 16:38:17.763168514 +0000
|
||||
@@ -11548,11 +11548,13 @@ process_symbol_table (FILE * file)
|
||||
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 (psym->st_other ^ vis));
|
||||
+#endif
|
||||
}
|
||||
printf (" %4s ", get_symbol_index_type (psym->st_shndx));
|
||||
print_symbol (25, psym->st_name < strtab_size
|
||||
@@ -11571,7 +11573,15 @@ process_symbol_table (FILE * file)
|
||||
printf (sym_info == symbol_hidden ? "@%s" : "@@%s",
|
||||
version_string);
|
||||
}
|
||||
+#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 (psym->st_other ^ vis));
|
||||
+ }
|
||||
+#endif
|
||||
putchar ('\n');
|
||||
|
||||
if (ELF_ST_BIND (psym->st_info) == STB_LOCAL
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-with-gold-2.45.50-96b8a8a633a/ld/testsuite/ld-x86-64/x86-64.exp
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2025-11-20 12:02:23.738336155 +0000
|
||||
+++ binutils-with-gold-2.45.50-96b8a8a633a/ld/testsuite/ld-x86-64/x86-64.exp 2025-11-20 12:03:17.894485264 +0000
|
||||
@@ -1413,14 +1413,6 @@ if { [isnative] && [check_compiler_avail
|
||||
"libprotected-func-2b.so" \
|
||||
] \
|
||||
[list \
|
||||
- "Build protected-func-2 without PIE" \
|
||||
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2b.so" \
|
||||
- "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
|
||||
- { protected-func-1b.c } \
|
||||
- {} \
|
||||
- "protected-func-2" \
|
||||
- ] \
|
||||
- [list \
|
||||
"Build libprotected-func-2c.so" \
|
||||
"-shared" \
|
||||
"-fPIC -Wa,-mx86-used-note=yes" \
|
||||
@@ -1429,14 +1421,6 @@ if { [isnative] && [check_compiler_avail
|
||||
"libprotected-func-2c.so" \
|
||||
] \
|
||||
[list \
|
||||
- "Build protected-func-2a without PIE" \
|
||||
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2c.so" \
|
||||
- "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
|
||||
- { protected-func-1b.c } \
|
||||
- {} \
|
||||
- "protected-func-2a" \
|
||||
- ] \
|
||||
- [list \
|
||||
"Build libprotected-data-1a.so" \
|
||||
"-shared -z noindirect-extern-access" \
|
||||
"-fPIC -Wa,-mx86-used-note=yes" \
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 13:32:39.335065263 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 15:03:55.649727195 +0000
|
||||
@@ -2,6 +2,7 @@
|
||||
#readelf: -S --wide
|
||||
#as: --32
|
||||
|
||||
+#pass
|
||||
#...
|
||||
+\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 13:32:39.329065335 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 15:04:20.803430034 +0000
|
||||
@@ -3,7 +3,6 @@
|
||||
#readelf: -d --wide
|
||||
#as: --32
|
||||
|
||||
-#failif
|
||||
#...
|
||||
+0x[0-9a-f]+ +\(PLTREL.*
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 13:32:39.336065251 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 15:03:00.413379749 +0000
|
||||
@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
|
||||
-
|
||||
+#...
|
||||
Symbol table '\.dynsym' contains [0-9]+ entries:
|
||||
+Num: +Value +Size Type +Bind +Vis +Ndx Name
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 13:32:39.330065323 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 15:03:28.928042882 +0000
|
||||
@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
|
||||
[0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
|
||||
-
|
||||
+#...
|
||||
Symbol table '\.dynsym' contains [0-9]+ entries:
|
||||
+Num: +Value +Size Type +Bind +Vis +Ndx Name
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 13:32:39.415064300 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 15:08:39.333375801 +0000
|
||||
@@ -2,8 +2,4 @@
|
||||
#readelf: -S --wide
|
||||
#as: --64
|
||||
|
||||
-#...
|
||||
- +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
|
||||
-#...
|
||||
- +\[ *[0-9]+\] \.got\.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+18 +.*
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 13:32:39.404064432 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 15:08:59.031143095 +0000
|
||||
@@ -3,7 +3,6 @@
|
||||
#readelf: -d --wide
|
||||
#as: --64
|
||||
|
||||
-#failif
|
||||
#...
|
||||
+0x[0-9a-f]+ +\(PLTREL.*
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 13:32:39.407064397 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 15:06:17.244054423 +0000
|
||||
@@ -1,4 +1,3 @@
|
||||
-#failif
|
||||
#...
|
||||
[0-9a-f ]+R_X86_64_JUMP_SLOT +0+ +bar \+ 0
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 13:32:39.412064336 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 15:15:09.918750288 +0000
|
||||
@@ -20,6 +20,7 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
+#pass
|
||||
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 13:32:39.413064324 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 15:16:08.227055104 +0000
|
||||
@@ -20,6 +20,7 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
+#pass
|
||||
|
||||
0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 13:32:39.413064324 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 15:16:20.115913358 +0000
|
||||
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 13:32:39.411064348 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 15:16:29.012807282 +0000
|
||||
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r16 \(rip\) at cfa-8
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
+
|
||||
0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 13:32:39.417064276 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 15:05:02.950932110 +0000
|
||||
@@ -14,6 +14,7 @@ Section Headers:
|
||||
+\[[ 0-9]+\] .dynsym +.*
|
||||
+\[[ 0-9]+\] .dynstr +.*
|
||||
+\[[ 0-9]+\] .rela.dyn +.*
|
||||
+#pass
|
||||
+\[[ 0-9]+\] .plt +.*
|
||||
+\[[ 0-9]+\] .plt.got +.*
|
||||
+\[[ 0-9]+\] .text +PROGBITS +0+1000 0+1000 0+31a 00 +AX +0 +0 4096
|
||||
--- binutils.orig/bfd/elfxx-x86.c 2018-01-22 15:59:25.875788033 +0000
|
||||
+++ binutils-2.30.0/bfd/elfxx-x86.c 2018-01-22 16:00:20.789146597 +0000
|
||||
@@ -107,7 +107,7 @@ elf_x86_allocate_dynrelocs (struct elf_l
|
||||
plt_entry_size = htab->plt.plt_entry_size;
|
||||
|
||||
resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh);
|
||||
-
|
||||
+#if 0
|
||||
/* We can't use the GOT PLT if pointer equality is needed since
|
||||
finish_dynamic_symbol won't clear symbol value and the dynamic
|
||||
linker won't update the GOT slot. We will get into an infinite
|
||||
@@ -125,7 +125,7 @@ elf_x86_allocate_dynrelocs (struct elf_l
|
||||
/* Use the GOT PLT. */
|
||||
eh->plt_got.refcount = 1;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
/* Since STT_GNU_IFUNC symbol must go through PLT, we handle it
|
||||
here if it is defined and referenced in a non-shared object. */
|
||||
if (h->type == STT_GNU_IFUNC
|
||||
--- binutils.orig/ld/testsuite/ld-i386/pr20830.d 2018-07-09 09:49:51.277239857 +0100
|
||||
+++ binutils-2.30.90/ld/testsuite/ld-i386/pr20830.d 2018-07-09 10:32:41.113356733 +0100
|
||||
@@ -19,7 +19,7 @@ Contents of the .eh_frame section:
|
||||
DW_CFA_offset: r8 \(eip\) at cfa-4
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
-
|
||||
+#pass
|
||||
0+18 00000010 0000001c FDE cie=00000000 pc=00000128..00000133
|
||||
DW_CFA_nop
|
||||
DW_CFA_nop
|
||||
|
|
@ -1,269 +0,0 @@
|
|||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:11:38.656875289 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:49:26.786573665 +0000
|
||||
@@ -12,8 +12,8 @@ Program Headers:
|
||||
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
|
||||
RISCV_ATTRIBUT .*
|
||||
LOAD .*
|
||||
-
|
||||
+#...
|
||||
Section to Segment mapping:
|
||||
Segment Sections...
|
||||
00 .riscv.attributes
|
||||
- 01 .text
|
||||
+#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:11:38.659875285 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:42:54.803431287 +0000
|
||||
@@ -8,7 +8,7 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:11:38.659875285 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:43:49.540306593 +0000
|
||||
@@ -11,5 +11,5 @@ Disassembly of section .text:
|
||||
[0-9a-f]+ <_start>:
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,gp.*<data_a>
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1.*<data_b>
|
||||
+.*:[ ]+[0-9a-f]+[ ]+mv[ ]+a1,a1
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:11:38.659875285 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:46:55.570899994 +0000
|
||||
@@ -2,4 +2,5 @@
|
||||
#source: pcrel-lo-addend-2a.s
|
||||
#as: -march=rv32ic
|
||||
#ld: -m[riscv_choose_ilp32_emul] --no-relax
|
||||
+#skip: *-*-*
|
||||
#error: .*dangerous relocation: %pcrel_lo overflow with an addend, the value of %pcrel_hi is 0x1000 without any addend, but may be 0x2000 after adding the %pcrel_lo addend
|
||||
diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf.exp binutils-2.40/ld/testsuite/ld-elf/dwarf.exp
|
||||
--- binutils.orig/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 10:11:38.515875516 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 11:08:52.209377332 +0000
|
||||
@@ -29,6 +29,10 @@ if ![is_elf_format] {
|
||||
return
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
# Skip targets where -shared is not supported
|
||||
|
||||
if ![check_shared_lib_support] {
|
||||
diff -rup binutils.orig/ld/testsuite/ld-elf/tls.exp binutils-2.40/ld/testsuite/ld-elf/tls.exp
|
||||
--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2023-02-16 10:11:38.540875476 +0000
|
||||
+++ binutils-2.40/ld/testsuite/ld-elf/tls.exp 2023-02-16 11:08:56.944369374 +0000
|
||||
@@ -28,6 +28,10 @@ if { !([istarget *-*-linux*]
|
||||
return
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
# Check to see if the C compiler works.
|
||||
if { ![check_compiler_available] } {
|
||||
return
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2023-08-24 07:48:30.429195480 +0100
|
||||
+++ binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp 2023-08-24 07:57:05.535302711 +0100
|
||||
@@ -1409,6 +1409,8 @@ proc objcopy_test_without_global_symbol
|
||||
# The AArch64 and ARM targets preserve mapping symbols
|
||||
# in object files, so they will fail this test.
|
||||
setup_xfail aarch64*-*-* arm*-*-*
|
||||
+# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
+setup_xfail riscv*-*-*
|
||||
|
||||
objcopy_test_without_global_symbol
|
||||
|
||||
--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2023-08-24 07:48:31.808196076 +0100
|
||||
+++ binutils-2.41/ld/testsuite/ld-plugin/plugin.exp 2023-08-24 07:59:30.285716568 +0100
|
||||
@@ -132,6 +132,10 @@ if [is_pecoff_format] {
|
||||
append libs " --image-base=0x10000000"
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
set plugin_tests [list \
|
||||
[list "load plugin" "-plugin $plugin_path \
|
||||
$testobjfiles $libs" "" "" "" {{ld plugin-1.d}} "main.x" ] \
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/compress.exp 2023-12-11 10:09:16.923374463 +0000
|
||||
+++ binutils-2.41/binutils/testsuite/binutils-all/compress.exp 2023-12-12 09:00:15.150036675 +0000
|
||||
@@ -818,6 +818,10 @@ proc test_gnu_debuglink {} {
|
||||
}
|
||||
}
|
||||
|
||||
+if { [istarget riscv*-*-*] } then {
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
if {[is_elf_format]} then {
|
||||
test_gnu_debuglink
|
||||
}
|
||||
--- binutils-2.41/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2023-07-03 00:00:00.000000000 +0100
|
||||
+++ binutils.new/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2023-12-12 11:52:54.564057931 +0000
|
||||
@@ -8,10 +8,10 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1,0x[0-9a-f]+
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,[0-9]+ # [0-9a-f]+ <data_g>
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+lui[ ]+a2,0x[0-9a-f]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,a2,[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a3,tp,0 # 0 <data_t>
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2023-12-12 14:21:10.225342926 +0000
|
||||
+++ binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp 2023-12-12 14:22:12.453421499 +0000
|
||||
@@ -1410,7 +1410,7 @@ proc objcopy_test_without_global_symbol
|
||||
# in object files, so they will fail this test.
|
||||
setup_xfail aarch64*-*-* arm*-*-*
|
||||
# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
-setup_xfail riscv*-*-*
|
||||
+# setup_xfail riscv*-*-*
|
||||
|
||||
objcopy_test_without_global_symbol
|
||||
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2024-10-03 15:21:47.926570551 +0100
|
||||
+++ binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d 2024-10-03 15:24:26.152502612 +0100
|
||||
@@ -8,10 +8,10 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1,0x[0-9a-f]+
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+lui[ ]+a2,0x[0-9a-f]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,a2,[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a3,tp,0 # 0 <data_t>
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2024-10-03 15:21:47.926570551 +0100
|
||||
+++ binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2024-10-03 15:23:54.512530979 +0100
|
||||
@@ -8,7 +8,7 @@
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+[0-9a-f]+ <_start>:
|
||||
-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+
|
||||
+.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
|
||||
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d
|
||||
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2024-10-03 15:21:47.926570551 +0100
|
||||
+++ binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2024-10-03 15:25:01.687468496 +0100
|
||||
@@ -11,5 +11,5 @@ Disassembly of section .text:
|
||||
[0-9a-f]+ <_start>:
|
||||
.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1.*
|
||||
.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,gp.*<data_a>
|
||||
-.*:[ ]+[0-9a-f]+[ ]+mv[ ]+a1,a1
|
||||
+.*:[ ]+[0-9a-f]+[ ]+.*
|
||||
#pass
|
||||
--- binutils-with-gold-2.45.50-79b2b564fec.orig/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.d 2025-09-09 15:52:30.684689609 +0100
|
||||
+++ binutils-with-gold-2.45.50-79b2b564fec/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.d 2025-09-09 15:53:12.837859447 +0100
|
||||
@@ -30,6 +30,6 @@ Disassembly of section \.plt:
|
||||
|
||||
[0-9a-f]+ <bar@plt>:
|
||||
.*:[ ]+[0-9a-f]+[ ]+lpad[ ]+0x0
|
||||
-.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+t3,0x1
|
||||
+.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+t3,0x[0-9a-f]+
|
||||
.*:[ ]+[0-9a-f]+[ ]+ld[ ]+t3,[0-9]+\(t3\) # [0-9a-f]+ <bar>
|
||||
.*:[ ]+[0-9a-f]+[ ]+jalr[ ]+t1,t3
|
||||
diff -rup binutils-with-gold-2.45.50-beab972c07d,orig/binutils/testsuite/binutils-all/objcopy.exp binutils-with-gold-2.45.50-beab972c07d/binutils/testsuite/binutils-all/objcopy.exp
|
||||
--- binutils-with-gold-2.45.50-beab972c07d,orig/binutils/testsuite/binutils-all/objcopy.exp 2025-12-02 12:47:19.063123207 +0000
|
||||
+++ binutils-with-gold-2.45.50-beab972c07d/binutils/testsuite/binutils-all/objcopy.exp 2025-12-04 12:39:26.079989597 +0000
|
||||
@@ -602,14 +602,19 @@ proc strip_test { } {
|
||||
set exec_output [binutils_run $STRIP "$STRIPFLAGS $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string equal "" $exec_output] {
|
||||
- fail $test
|
||||
+ fail "$test (warnings in linker output)"
|
||||
+ verbose $exec_output
|
||||
return
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $NM "-a $NMFLAGS $objfile"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string match "*: no symbols*" $exec_output] {
|
||||
- fail $test
|
||||
+
|
||||
+ # The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
+ setup_xfail riscv*-*-*
|
||||
+
|
||||
+ fail "$test (symbols in nm output)"
|
||||
return
|
||||
}
|
||||
|
||||
@@ -659,6 +664,9 @@ proc strip_test_with_saving_a_symbol { }
|
||||
pass $test
|
||||
}
|
||||
|
||||
+# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
+setup_xfail riscv*-*-*
|
||||
+
|
||||
strip_test_with_saving_a_symbol
|
||||
|
||||
# Test stripping an archive.
|
||||
@@ -1503,7 +1519,7 @@ proc objcopy_test_without_global_symbol
|
||||
# in object files, so they will fail this test.
|
||||
setup_xfail aarch64*-*-* arm*-*-*
|
||||
# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
|
||||
-# setup_xfail riscv*-*-*
|
||||
+setup_xfail riscv*-*-*
|
||||
|
||||
objcopy_test_without_global_symbol
|
||||
|
||||
diff -rup binutils-with-gold-2.45.50-beab972c07d,orig/ld/testsuite/lib/ld-lib.exp binutils-with-gold-2.45.50-beab972c07d/ld/testsuite/lib/ld-lib.exp
|
||||
--- binutils-with-gold-2.45.50-beab972c07d,orig/ld/testsuite/lib/ld-lib.exp 2025-12-02 12:47:19.201090894 +0000
|
||||
+++ binutils-with-gold-2.45.50-beab972c07d/ld/testsuite/lib/ld-lib.exp 2025-12-03 09:30:07.184360005 +0000
|
||||
@@ -1633,6 +1633,12 @@ proc compile_one_cc { src output additio
|
||||
proc check_ctf_available { } {
|
||||
global ctf_available_saved
|
||||
|
||||
+ # Skip CTF tests for the Risc-V target for now, as the
|
||||
+ # tests have not been tweaked to support the riscv format.
|
||||
+ if { [istarget "riscv*-*-linux*"] } {
|
||||
+ return 0
|
||||
+ }
|
||||
+
|
||||
if {![info exists ctf_available_saved]} {
|
||||
set ctf_available_saved 0
|
||||
|
||||
--- fred/binutils/testsuite/lib/binutils-common.exp 2026-03-16 09:18:37.205413649 +0000
|
||||
+++ binutils-with-gold-2.46.50-d712202846b/binutils/testsuite/lib/binutils-common.exp 2026-03-16 09:18:49.559358668 +0000
|
||||
@@ -803,6 +803,9 @@ proc prune_warnings_extra { text } {
|
||||
# Ignore warnings about linking objects with an old sframe format
|
||||
regsub -all {(^|\n)([^\n]* unexpected SFrame format version [^\n]*\n[^\n]* SFrame section ignored\n?)+} $text {\1} text
|
||||
|
||||
+ # Skip warnings about the LTO plugin being needed.
|
||||
+ regsub -all "(^|\n)(\[^\n\]*:\[^\n\]*plugin needed to handle lto object\[^\n\]*\n?)+" $text "\\1" text
|
||||
+
|
||||
return $text
|
||||
}
|
||||
|
||||
--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2026-06-10 15:32:21.012274073 +0100
|
||||
+++ binutils-with-gold-2.46.50-48997323b0f/ld/testsuite/ld-elf/shared.exp 2026-06-10 15:34:41.397899263 +0100
|
||||
@@ -1859,6 +1859,10 @@ run_cc_link_tests [list \
|
||||
"pr29655.so" \
|
||||
] \
|
||||
]
|
||||
+
|
||||
+# FIXME: Find out why the Risc-V fails this test.
|
||||
+setup_xfail "riscv64-*-*"
|
||||
+
|
||||
# PR 29655 (cont.): Check that in PIC code linked as PDE taking the address
|
||||
# of a function defined in a DSO results in the function address (from GOT)
|
||||
# and not the "canonical PLT" address from the PDE.
|
||||
97
binutils-speed-up-objdump.patch
Normal file
97
binutils-speed-up-objdump.patch
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
--- binutils.orig/binutils/objdump.c 2018-03-05 17:04:19.901619738 +0000
|
||||
+++ binutils-2.29/binutils/objdump.c 2018-03-05 17:10:08.334643096 +0000
|
||||
@@ -664,9 +664,7 @@ slurp_dynamic_symtab (bfd *abfd)
|
||||
static bfd_boolean
|
||||
is_significant_symbol_name (const char * name)
|
||||
{
|
||||
- return strcmp (name, ".plt") == 0
|
||||
- || strcmp (name, ".got") == 0
|
||||
- || strcmp (name, ".plt.got") == 0;
|
||||
+ return strncmp (name, ".plt", 4) == 0 || strcmp (name, ".got") == 0;
|
||||
}
|
||||
|
||||
/* Filter out (in place) symbols that are useless for disassembly.
|
||||
@@ -937,6 +935,7 @@ find_symbol_for_address (bfd_vma vma,
|
||||
asection *sec;
|
||||
unsigned int opb;
|
||||
bfd_boolean want_section;
|
||||
+ long rel_count;
|
||||
|
||||
if (sorted_symcount < 1)
|
||||
return NULL;
|
||||
@@ -1065,33 +1064,59 @@ find_symbol_for_address (bfd_vma vma,
|
||||
and we have dynamic relocations available, then we can produce
|
||||
a better result by matching a relocation to the address and
|
||||
using the symbol associated with that relocation. */
|
||||
+ rel_count = aux->dynrelcount;
|
||||
if (!want_section
|
||||
- && aux->dynrelbuf != NULL
|
||||
&& sorted_syms[thisplace]->value != vma
|
||||
+ && rel_count > 0
|
||||
+ && aux->dynrelbuf != NULL
|
||||
+ && aux->dynrelbuf[0]->address <= vma
|
||||
+ && aux->dynrelbuf[rel_count - 1]->address >= vma
|
||||
/* If we have matched a synthetic symbol, then stick with that. */
|
||||
&& (sorted_syms[thisplace]->flags & BSF_SYNTHETIC) == 0)
|
||||
{
|
||||
- long rel_count;
|
||||
- arelent ** rel_pp;
|
||||
+ arelent ** rel_low;
|
||||
+ arelent ** rel_high;
|
||||
|
||||
- for (rel_count = aux->dynrelcount, rel_pp = aux->dynrelbuf;
|
||||
- rel_count--;)
|
||||
+ rel_low = aux->dynrelbuf;
|
||||
+ rel_high = rel_low + rel_count - 1;
|
||||
+ while (rel_low <= rel_high)
|
||||
{
|
||||
- arelent * rel = rel_pp[rel_count];
|
||||
+ arelent ** rel_mid = &rel_low[(rel_high - rel_low) / 2];
|
||||
+ arelent * rel = *rel_mid;
|
||||
|
||||
- if (rel->address == vma
|
||||
- && rel->sym_ptr_ptr != NULL
|
||||
- /* Absolute relocations do not provide a more helpful symbolic address. */
|
||||
- && ! bfd_is_abs_section ((* rel->sym_ptr_ptr)->section))
|
||||
+ if (rel->address == vma)
|
||||
{
|
||||
- if (place != NULL)
|
||||
- * place = thisplace;
|
||||
- return * rel->sym_ptr_ptr;
|
||||
+ /* Absolute relocations do not provide a more helpful
|
||||
+ symbolic address. Find a non-absolute relocation
|
||||
+ with the same address. */
|
||||
+
|
||||
+ arelent **rel_vma = rel_mid;
|
||||
+
|
||||
+ for (rel_mid--;
|
||||
+ rel_mid >= rel_low && rel_mid[0]->address == vma;
|
||||
+ rel_mid--)
|
||||
+ rel_vma = rel_mid;
|
||||
+
|
||||
+ for (; rel_vma <= rel_high && rel_vma[0]->address == vma;
|
||||
+ rel_vma++)
|
||||
+ {
|
||||
+ rel = *rel_vma;
|
||||
+ if (rel->sym_ptr_ptr != NULL
|
||||
+ && ! bfd_is_abs_section ((* rel->sym_ptr_ptr)->section))
|
||||
+ {
|
||||
+ if (place != NULL)
|
||||
+ * place = thisplace;
|
||||
+ return * rel->sym_ptr_ptr;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
}
|
||||
|
||||
- /* We are scanning backwards, so if we go below the target address
|
||||
- we have failed. */
|
||||
- if (rel_pp[rel_count]->address < vma)
|
||||
+ if (vma < rel->address)
|
||||
+ rel_high = rel_mid;
|
||||
+ else if (vma >= rel_mid[1]->address)
|
||||
+ rel_low = rel_mid + 1;
|
||||
+ else
|
||||
break;
|
||||
}
|
||||
}
|
||||
73
binutils-strip-delete-relocs.patch
Normal file
73
binutils-strip-delete-relocs.patch
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
diff -rup binutils.orig/bfd/elf64-sparc.c binutils-2.29.1/bfd/elf64-sparc.c
|
||||
--- binutils.orig/bfd/elf64-sparc.c 2017-12-07 17:23:06.764174312 +0000
|
||||
+++ binutils-2.29.1/bfd/elf64-sparc.c 2017-12-07 17:23:20.540009839 +0000
|
||||
@@ -287,6 +287,7 @@ elf64_sparc_set_reloc (bfd *abfd ATTRIBU
|
||||
unsigned int count)
|
||||
{
|
||||
asect->orelocation = location;
|
||||
+ asect->reloc_count = count / 2;
|
||||
canon_reloc_count (asect) = count;
|
||||
}
|
||||
|
||||
Only in binutils-2.29.1/bfd: elf64-sparc.c.orig
|
||||
diff -rup binutils.orig/bfd/elfcode.h binutils-2.29.1/bfd/elfcode.h
|
||||
--- binutils.orig/bfd/elfcode.h 2017-12-07 17:23:06.722174814 +0000
|
||||
+++ binutils-2.29.1/bfd/elfcode.h 2017-12-07 17:23:20.541009827 +0000
|
||||
@@ -958,6 +958,12 @@ elf_write_relocs (bfd *abfd, asection *s
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (ptr->howto == NULL)
|
||||
+ {
|
||||
+ *failedp = TRUE;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
src_rela.r_offset = ptr->address + addr_offset;
|
||||
src_rela.r_info = ELF_R_INFO (n, ptr->howto->type);
|
||||
src_rela.r_addend = ptr->addend;
|
||||
diff -rup binutils.orig/binutils/objcopy.c binutils-2.29.1/binutils/objcopy.c
|
||||
--- binutils.orig/binutils/objcopy.c 2017-12-07 17:23:06.769174253 +0000
|
||||
+++ binutils-2.29.1/binutils/objcopy.c 2017-12-07 17:23:20.542009815 +0000
|
||||
@@ -3785,14 +3785,24 @@ copy_relocations_in_section (bfd *ibfd,
|
||||
}
|
||||
else
|
||||
{
|
||||
- relpp = (arelent **) xmalloc (relsize);
|
||||
- relcount = bfd_canonicalize_reloc (ibfd, isection, relpp, isympp);
|
||||
- if (relcount < 0)
|
||||
+ if (isection->orelocation != NULL)
|
||||
{
|
||||
- status = 1;
|
||||
- bfd_nonfatal_message (NULL, ibfd, isection,
|
||||
- _("relocation count is negative"));
|
||||
- return;
|
||||
+ /* Some other function has already set up the output relocs
|
||||
+ for us, so scan those instead of the default relocs. */
|
||||
+ relcount = isection->reloc_count;
|
||||
+ relpp = isection->orelocation;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ relpp = (arelent **) xmalloc (relsize);
|
||||
+ relcount = bfd_canonicalize_reloc (ibfd, isection, relpp, isympp);
|
||||
+ if (relcount < 0)
|
||||
+ {
|
||||
+ status = 1;
|
||||
+ bfd_nonfatal_message (NULL, ibfd, isection,
|
||||
+ _("relocation count is negative"));
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (strip_symbols == STRIP_ALL)
|
||||
@@ -3815,7 +3825,8 @@ copy_relocations_in_section (bfd *ibfd,
|
||||
temp_relpp [temp_relcount++] = relpp [i];
|
||||
}
|
||||
relcount = temp_relcount;
|
||||
- free (relpp);
|
||||
+ if (isection->orelocation == NULL)
|
||||
+ free (relpp);
|
||||
relpp = temp_relpp;
|
||||
}
|
||||
|
||||
1337
binutils-support-v3-build-notes.patch
Normal file
1337
binutils-support-v3-build-notes.patch
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,13 +0,0 @@
|
|||
--- binutils.orig/ld/testsuite/ld-elf/linux-x86.exp 2024-01-24 11:52:35.288014542 +0000
|
||||
+++ binutils-2.41/ld/testsuite/ld-elf/linux-x86.exp 2024-01-24 17:31:39.356167357 +0000
|
||||
@@ -225,6 +225,10 @@ if { [check_ifunc_attribute_available] }
|
||||
# Old gcc silently ignores __attribute__ ((aligned())) with too big alignment.
|
||||
proc compiler_honours_aligned { } {
|
||||
global CC_FOR_TARGET READELF srcdir subdir
|
||||
+
|
||||
+ # Temporary fix for CentOS-10 kernel issue. (RHEL-22466)
|
||||
+ return 0
|
||||
+
|
||||
ld_compile $CC_FOR_TARGET $srcdir/$subdir/p_align-1.c tmpdir/p_align-1.o
|
||||
set output [run_host_cmd "$READELF" "-SW tmpdir/p_align-1.o"]
|
||||
if { [regexp { [.]data *PROGBITS .* 8388608[\n]} $output] } {
|
||||
File diff suppressed because it is too large
Load diff
71
binutils-z-undefs.patch
Normal file
71
binutils-z-undefs.patch
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
diff -rup binutils.orig/ld/emultempl/elf32.em binutils-2.29.1/ld/emultempl/elf32.em
|
||||
--- binutils.orig/ld/emultempl/elf32.em 2018-01-16 11:34:58.040749108 +0000
|
||||
+++ binutils-2.29.1/ld/emultempl/elf32.em 2018-01-16 11:35:35.697303875 +0000
|
||||
@@ -2666,6 +2666,8 @@ fragment <<EOF
|
||||
case 'z':
|
||||
if (strcmp (optarg, "defs") == 0)
|
||||
link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR;
|
||||
+ else if (strcmp (optarg, "undefs") == 0)
|
||||
+ link_info.unresolved_syms_in_objects = RM_IGNORE;
|
||||
else if (strcmp (optarg, "muldefs") == 0)
|
||||
link_info.allow_multiple_definition = TRUE;
|
||||
else if (CONST_STRNEQ (optarg, "max-page-size="))
|
||||
Only in binutils-2.29.1/ld/emultempl: elf32.em.orig
|
||||
diff -rup binutils.orig/ld/ld.texinfo binutils-2.29.1/ld/ld.texinfo
|
||||
--- binutils.orig/ld/ld.texinfo 2018-01-16 11:34:58.208747127 +0000
|
||||
+++ binutils-2.29.1/ld/ld.texinfo 2018-01-16 11:35:35.699303851 +0000
|
||||
@@ -1125,8 +1125,9 @@ Generate common symbols with the STT_COM
|
||||
link.
|
||||
|
||||
@item defs
|
||||
-Disallows undefined symbols in object files. Undefined symbols in
|
||||
-shared libraries are still allowed.
|
||||
+Report unresolved symbol references from regular object files. This
|
||||
+is done even if the linker is creating a non-symbolic shared library.
|
||||
+This option is the inverse of @samp{-z undefs}.
|
||||
|
||||
@item execstack
|
||||
Marks the object as requiring executable stack.
|
||||
@@ -1279,6 +1280,11 @@ Generate GNU_PROPERTY_X86_FEATURE_1_SHST
|
||||
to indicate compatibility with Intel Shadow Stack. Supported for
|
||||
Linux/i386 and Linux/x86_64.
|
||||
|
||||
+@item undefs
|
||||
+Do not report unresolved symbol references from regular object files,
|
||||
+either when creating an executable, or when creating a shared library.
|
||||
+This option is the inverse of @samp{-z defs}.
|
||||
+
|
||||
@end table
|
||||
|
||||
Other keywords are ignored for Solaris compatibility.
|
||||
@@ -1684,6 +1690,7 @@ while linking a large executable.
|
||||
|
||||
@kindex --no-undefined
|
||||
@kindex -z defs
|
||||
+@kindex -z undefs
|
||||
@item --no-undefined
|
||||
@itemx -z defs
|
||||
Report unresolved symbol references from regular object files. This
|
||||
@@ -1692,6 +1699,8 @@ The switch @option{--[no-]allow-shlib-un
|
||||
behaviour for reporting unresolved references found in shared
|
||||
libraries being linked in.
|
||||
|
||||
+The effects of this option can be reverted by using @code{-z undefs}.
|
||||
+
|
||||
@kindex --allow-multiple-definition
|
||||
@kindex -z muldefs
|
||||
@item --allow-multiple-definition
|
||||
Only in binutils-2.29.1/ld: ld.texinfo.orig
|
||||
diff -rup binutils.orig/ld/NEWS binutils-2.29.1/ld/NEWS
|
||||
--- binutils.orig/ld/NEWS 2018-01-16 11:34:58.209747115 +0000
|
||||
+++ binutils-2.29.1/ld/NEWS 2018-01-16 11:35:57.855041557 +0000
|
||||
@@ -1,5 +1,7 @@
|
||||
-*- text -*-
|
||||
|
||||
+* Add "-z undefs" command line option as the inverse of the "-z defs" option.
|
||||
+
|
||||
Changes in 2.29:
|
||||
|
||||
* Support for -z shstk in the x86 ELF linker to generate
|
||||
Only in binutils-2.29.1/ld: NEWS.orig
|
||||
Only in binutils-2.29.1/ld: NEWS.rej
|
||||
2991
binutils.spec
2991
binutils.spec
File diff suppressed because it is too large
Load diff
15
gating.yaml
15
gating.yaml
|
|
@ -1,15 +0,0 @@
|
|||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_stable
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation}
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-fast-lane.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-slow-lane.functional}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
#
|
||||
# Build/PR gating tests for binutils
|
||||
#
|
||||
|
||||
/common:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/binutils.git
|
||||
ref: main
|
||||
name: /plans/build-gating/common
|
||||
|
||||
/kernel-rebuild:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/binutils.git
|
||||
ref: main
|
||||
name: /plans/build-gating/kernel-rebuild
|
||||
|
||||
adjust+:
|
||||
- because: "Plan to be ran when executed locally, or executed by CI system to gate a build or PR."
|
||||
# `commit` is used by Fedora CI, CentOS Stream CI, `build` by BaseOS CI
|
||||
when: >-
|
||||
trigger is defined
|
||||
and trigger != commit
|
||||
and trigger != build
|
||||
enabled: false
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
#
|
||||
# Build/PR gating tests for binutils
|
||||
#
|
||||
|
||||
/common:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/binutils.git
|
||||
ref: main
|
||||
name: /plans/regression
|
||||
|
||||
adjust+:
|
||||
- because: "Plan to be ran when executed locally, or executed by CI system after updating an erratum/bodhi update."
|
||||
# `build` is used by Bodhi
|
||||
when: >-
|
||||
trigger is defined
|
||||
and trigger != build
|
||||
enabled: false
|
||||
2
sources
2
sources
|
|
@ -1,2 +1,2 @@
|
|||
SHA512 (binutils-with-gold-2.47.50-48c933a69a8.tar.xz) = c4300e4881227c431c0bbbb949a5ee5bc113701f993766418b152df7d46d9df378ebace9efffcb6e1f0b7e72ad716bbcccf5b6aa55851dc28216555b242d18a0
|
||||
SHA512 (binutils-2.29.1.tar.xz) = d748d22306477d60d921078804d21943248c23fca0707aac9b016a352c01c75ca69e82624ae37fb0bbd03af3b17088a94f60dfe1a86a7ff82e18ece3c24f0fd0
|
||||
SHA512 (binutils-2.19.50.0.1-output-format.sed) = 2f8686b0c8af13c98cda056824c2820416f6e2d003f70b78ccf5314525b9ee3684d421dfa83e638a2d42d06ea4d4bdaf5226b64d6ec26f7ff59c44ffb2a23dd2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue