update version to 2.34

This commit is contained in:
yinhongchang 2024-02-04 20:41:09 +08:00
parent 6f94e9a486
commit 49aaa2b3a3
38 changed files with 2293 additions and 1068 deletions

View File

@ -1,158 +0,0 @@
diff -rupN --no-dereference binutils-2.32/bfd/config.bfd binutils-2.32-new/bfd/config.bfd
--- binutils-2.32/bfd/config.bfd 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/config.bfd 2019-11-19 20:47:16.708676031 +0100
@@ -217,11 +217,6 @@ esac
# convention, else the table becomes a real mess to understand and maintain.
case "${targ}" in
- plugin)
- targ_defvec=plugin_vec
- targ_selvecs="plugin_vec"
- ;;
-
# START OF targmatch.h
#ifdef BFD64
aarch64-*-darwin*)
diff -rupN --no-dereference binutils-2.32/bfd/configure binutils-2.32-new/bfd/configure
--- binutils-2.32/bfd/configure 2019-02-02 16:47:56.000000000 +0100
+++ binutils-2.32-new/bfd/configure 2019-11-19 20:47:16.710676043 +0100
@@ -12409,10 +12409,6 @@ else
fi
-if test "$plugins" = "yes"; then
- enable_targets="$enable_targets plugin"
-fi
-
# Check whether --enable-64-bit-bfd was given.
if test "${enable_64_bit_bfd+set}" = set; then :
enableval=$enable_64_bit_bfd; case "${enableval}" in
@@ -14580,12 +14576,12 @@ selarchs=
TDEFINES=
for targ in $target $canon_targets
do
- if test "x$targ" = "xall"; then
+ if test $targ = all; then
all_targets=true
assocvecs="$assocvecs $targ_defvec $targ_selvecs"
- else
+ elif test $targ != plugin; then
. $srcdir/config.bfd
- if test "x$targ" = "x$target"; then
+ if test $targ = $target; then
defvec=$targ_defvec
fi
selvecs="$selvecs $targ_defvec $targ_selvecs"
@@ -14820,7 +14816,6 @@ do
pef_xlib_vec) tb="$tb pef.lo" ;;
pj_elf32_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;;
pj_elf32_le_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;;
- plugin_vec) tb="$tb plugin.lo" ;;
powerpc_boot_vec) tb="$tb ppcboot.lo" ;;
powerpc_elf32_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
powerpc_elf32_le_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
@@ -14947,6 +14942,10 @@ do
fi
done
+if test "$plugins" = "yes"; then
+ tb="$tb plugin.lo"
+fi
+
# Target architecture .o files.
# A couple of CPUs use shorter file names to avoid problems on DOS
# filesystems.
diff -rupN --no-dereference binutils-2.32/bfd/configure.ac binutils-2.32-new/bfd/configure.ac
--- binutils-2.32/bfd/configure.ac 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/configure.ac 2019-11-19 20:47:16.710676043 +0100
@@ -46,10 +46,6 @@ ACX_LARGEFILE
AM_CONDITIONAL(PLUGINS, test "$plugins" = "yes")
-if test "$plugins" = "yes"; then
- enable_targets="$enable_targets plugin"
-fi
-
AC_ARG_ENABLE(64-bit-bfd,
[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
[case "${enableval}" in
@@ -348,12 +344,12 @@ selarchs=
TDEFINES=
for targ in $target $canon_targets
do
- if test "x$targ" = "xall"; then
+ if test $targ = all; then
all_targets=true
assocvecs="$assocvecs $targ_defvec $targ_selvecs"
- else
+ elif test $targ != plugin; then
. $srcdir/config.bfd
- if test "x$targ" = "x$target"; then
+ if test $targ = $target; then
defvec=$targ_defvec
fi
selvecs="$selvecs $targ_defvec $targ_selvecs"
@@ -588,7 +584,6 @@ do
pef_xlib_vec) tb="$tb pef.lo" ;;
pj_elf32_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;;
pj_elf32_le_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;;
- plugin_vec) tb="$tb plugin.lo" ;;
powerpc_boot_vec) tb="$tb ppcboot.lo" ;;
powerpc_elf32_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
powerpc_elf32_le_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;;
@@ -715,6 +710,10 @@ do
fi
done
+if test "$plugins" = "yes"; then
+ tb="$tb plugin.lo"
+fi
+
# Target architecture .o files.
# A couple of CPUs use shorter file names to avoid problems on DOS
# filesystems.
diff -rupN --no-dereference binutils-2.32/bfd/format.c binutils-2.32-new/bfd/format.c
--- binutils-2.32/bfd/format.c 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/bfd/format.c 2019-11-19 20:47:16.710676043 +0100
@@ -290,8 +290,15 @@ bfd_check_format_matches (bfd *abfd, bfd
{
const bfd_target *temp;
- /* Don't check the default target twice. */
+ /* The binary target matches anything, so don't return it when
+ searching. Don't match the plugin target if we have another
+ alternative since we want to properly set the input format
+ before allowing a plugin to claim the file. Also, don't
+ check the default target twice. */
if (*target == &binary_vec
+#if BFD_SUPPORTS_PLUGINS
+ || (match_count != 0 && *target == &plugin_vec)
+#endif
|| (!abfd->target_defaulted && *target == save_targ))
continue;
diff -rupN --no-dereference binutils-2.32/bfd/targets.c binutils-2.32-new/bfd/targets.c
--- binutils-2.32/bfd/targets.c 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/bfd/targets.c 2019-11-19 20:47:16.711676049 +0100
@@ -1142,10 +1142,6 @@ static const bfd_target * const _bfd_tar
&pj_elf32_vec,
&pj_elf32_le_vec,
-#if BFD_SUPPORTS_PLUGINS
- &plugin_vec,
-#endif
-
&powerpc_boot_vec,
&powerpc_elf32_vec,
&powerpc_elf32_le_vec,
@@ -1298,6 +1294,10 @@ static const bfd_target * const _bfd_tar
/* Likewise for ihex. */
&ihex_vec,
+#if BFD_SUPPORTS_PLUGINS
+ &plugin_vec,
+#endif
+
/* Add any required traditional-core-file-handler. */
#ifdef AIX386_CORE

58
CVE-2021-3487.patch Normal file
View File

@ -0,0 +1,58 @@
diff -rupN --no-dereference binutils-2.34/bfd/dwarf2.c binutils-2.34-new/bfd/dwarf2.c
--- binutils-2.34/bfd/dwarf2.c 2020-01-18 14:55:47.000000000 +0100
+++ binutils-2.34-new/bfd/dwarf2.c 2021-04-12 11:40:29.676218279 +0200
@@ -523,22 +523,24 @@ read_section (bfd * abfd,
bfd_byte ** section_buffer,
bfd_size_type * section_size)
{
- asection *msec;
const char *section_name = sec->uncompressed_name;
bfd_byte *contents = *section_buffer;
- bfd_size_type amt;
/* The section may have already been read. */
if (contents == NULL)
{
+ bfd_size_type amt;
+ asection *msec;
+ ufile_ptr filesize;
+
msec = bfd_get_section_by_name (abfd, section_name);
- if (! msec)
+ if (msec == NULL)
{
section_name = sec->compressed_name;
if (section_name != NULL)
msec = bfd_get_section_by_name (abfd, section_name);
}
- if (! msec)
+ if (msec == NULL)
{
_bfd_error_handler (_("DWARF error: can't find %s section."),
sec->uncompressed_name);
@@ -546,12 +548,23 @@ read_section (bfd * abfd,
return FALSE;
}
- *section_size = msec->rawsize ? msec->rawsize : msec->size;
+ amt = bfd_get_section_limit_octets (abfd, msec);
+ filesize = bfd_get_file_size (abfd);
+ if (amt >= filesize)
+ {
+ /* PR 26946 */
+ _bfd_error_handler (_("DWARF error: section %s is larger than its filesize! (0x%lx vs 0x%lx)"),
+ section_name, (long) amt, (long) filesize);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ *section_size = amt;
/* Paranoia - alloc one extra so that we can make sure a string
section is NUL terminated. */
- amt = *section_size + 1;
+ amt += 1;
if (amt == 0)
{
+ /* Paranoia - this should never happen. */
bfd_set_error (bfd_error_no_memory);
return FALSE;
}

View File

@ -1,6 +1,6 @@
diff -rupN --no-dereference binutils-2.32/bfd/bfd-in2.h binutils-2.32-new/bfd/bfd-in2.h
--- binutils-2.32/bfd/bfd-in2.h 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/bfd-in2.h 2019-11-19 20:46:59.623577944 +0100
diff -rupN --no-dereference binutils-2.34/bfd/bfd-in2.h binutils-2.34-new/bfd/bfd-in2.h
--- binutils-2.34/bfd/bfd-in2.h 2020-01-18 14:55:47.000000000 +0100
+++ binutils-2.34-new/bfd/bfd-in2.h 2020-12-18 02:57:14.328056141 +0100
@@ -30,11 +30,6 @@
#ifndef __BFD_H_SEEN__
#define __BFD_H_SEEN__
@ -13,9 +13,9 @@ diff -rupN --no-dereference binutils-2.32/bfd/bfd-in2.h binutils-2.32-new/bfd/bf
#ifdef __cplusplus
extern "C" {
#endif
diff -rupN --no-dereference binutils-2.32/bfd/bfd-in.h binutils-2.32-new/bfd/bfd-in.h
--- binutils-2.32/bfd/bfd-in.h 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/bfd-in.h 2019-11-19 20:46:59.622577938 +0100
diff -rupN --no-dereference binutils-2.34/bfd/bfd-in.h binutils-2.34-new/bfd/bfd-in.h
--- binutils-2.34/bfd/bfd-in.h 2020-01-18 14:55:47.000000000 +0100
+++ binutils-2.34-new/bfd/bfd-in.h 2020-12-18 02:57:14.329056138 +0100
@@ -23,11 +23,6 @@
#ifndef __BFD_H_SEEN__
#define __BFD_H_SEEN__

View File

@ -1,7 +1,7 @@
diff -rupN --no-dereference binutils-2.32/bfd/Makefile.am binutils-2.32-new/bfd/Makefile.am
--- binutils-2.32/bfd/Makefile.am 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/Makefile.am 2019-11-19 20:46:58.072569411 +0100
@@ -953,8 +953,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
diff -rupN --no-dereference binutils-2.34/bfd/Makefile.am binutils-2.34-new/bfd/Makefile.am
--- binutils-2.34/bfd/Makefile.am 2020-01-18 14:55:47.000000000 +0100
+++ binutils-2.34-new/bfd/Makefile.am 2020-12-18 02:57:12.205063623 +0100
@@ -967,8 +967,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
@echo "creating $@"
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
@ -12,7 +12,7 @@ diff -rupN --no-dereference binutils-2.32/bfd/Makefile.am binutils-2.32-new/bfd/
bfd_version_package="\"$(PKGVERSION)\"" ;\
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
. $(srcdir)/development.sh ;\
@@ -965,7 +965,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
@@ -979,7 +979,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
fi ;\
$(SED) -e "s,@bfd_version@,$$bfd_version," \
-e "s,@bfd_version_string@,$$bfd_version_string," \
@ -21,10 +21,10 @@ diff -rupN --no-dereference binutils-2.32/bfd/Makefile.am binutils-2.32-new/bfd/
-e "s,@report_bugs_to@,$$report_bugs_to," \
< $(srcdir)/version.h > $@; \
echo "$${bfd_soversion}" > libtool-soversion
diff -rupN --no-dereference binutils-2.32/bfd/Makefile.in binutils-2.32-new/bfd/Makefile.in
--- binutils-2.32/bfd/Makefile.in 2019-02-02 16:47:56.000000000 +0100
+++ binutils-2.32-new/bfd/Makefile.in 2019-11-19 20:46:58.072569411 +0100
@@ -2068,8 +2068,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
diff -rupN --no-dereference binutils-2.34/bfd/Makefile.in binutils-2.34-new/bfd/Makefile.in
--- binutils-2.34/bfd/Makefile.in 2020-02-01 12:49:13.000000000 +0100
+++ binutils-2.34-new/bfd/Makefile.in 2020-12-18 02:57:12.205063623 +0100
@@ -2081,8 +2081,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
@echo "creating $@"
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
@ -35,7 +35,7 @@ diff -rupN --no-dereference binutils-2.32/bfd/Makefile.in binutils-2.32-new/bfd/
bfd_version_package="\"$(PKGVERSION)\"" ;\
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
. $(srcdir)/development.sh ;\
@@ -2080,7 +2080,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
@@ -2093,7 +2093,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
fi ;\
$(SED) -e "s,@bfd_version@,$$bfd_version," \
-e "s,@bfd_version_string@,$$bfd_version_string," \

View File

@ -1,7 +1,7 @@
diff -rupN --no-dereference binutils-2.32/binutils/readelf.c binutils-2.32-new/binutils/readelf.c
--- binutils-2.32/binutils/readelf.c 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/binutils/readelf.c 2019-11-19 20:47:00.396582218 +0100
@@ -19642,75 +19642,85 @@ process_file (char * file_name)
diff -rupN --no-dereference binutils-2.34/binutils/readelf.c binutils-2.34-new/binutils/readelf.c
--- binutils-2.34/binutils/readelf.c 2020-01-18 14:55:47.000000000 +0100
+++ binutils-2.34-new/binutils/readelf.c 2020-12-18 02:57:15.341052571 +0100
@@ -20350,75 +20350,85 @@ process_file (char * file_name)
Filedata * filedata = NULL;
struct stat statbuf;
char armag[SARMAG];

View File

@ -1,6 +1,6 @@
diff -rupN --no-dereference binutils-2.32/gold/fileread.cc binutils-2.32-new/gold/fileread.cc
--- binutils-2.32/gold/fileread.cc 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/gold/fileread.cc 2019-11-19 20:47:14.475662786 +0100
diff -rupN --no-dereference binutils-2.34/gold/fileread.cc binutils-2.34-new/gold/fileread.cc
--- binutils-2.34/gold/fileread.cc 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/gold/fileread.cc 2020-12-18 02:57:23.485023881 +0100
@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_
ssize_t bytes;
if (this->whole_file_view_ != NULL)

View File

@ -1,18 +0,0 @@
diff -rupN --no-dereference binutils-2.32/libiberty/simple-object-elf.c binutils-2.32-new/libiberty/simple-object-elf.c
--- binutils-2.32/libiberty/simple-object-elf.c 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/libiberty/simple-object-elf.c 2019-11-19 20:47:15.208667119 +0100
@@ -549,6 +549,14 @@ simple_object_elf_match (unsigned char h
return NULL;
}
+ if (eor->shstrndx == 0)
+ {
+ *errmsg = "invalid ELF shstrndx == 0";
+ *err = 0;
+ XDELETE (eor);
+ return NULL;
+ }
+
return (void *) eor;
}

View File

@ -1,12 +0,0 @@
diff -rupN --no-dereference binutils-2.32/binutils/readelf.c binutils-2.32-new/binutils/readelf.c
--- binutils-2.32/binutils/readelf.c 2019-11-19 20:47:07.833624139 +0100
+++ binutils-2.32-new/binutils/readelf.c 2019-11-19 20:47:15.941671465 +0100
@@ -13234,7 +13234,7 @@ apply_relocations (Filedata *
}
rloc = start + rp->r_offset;
- if ((rloc + reloc_size) > end || (rloc < start))
+ if (rloc >= end || (rloc + reloc_size) > end || (rloc < start))
{
warn (_("skipping invalid relocation offset 0x%lx in section %s\n"),
(unsigned long) rp->r_offset,

View File

@ -1,111 +0,0 @@
diff -rupN --no-dereference binutils-2.32/libiberty/cp-demangle.c binutils-2.32-new/libiberty/cp-demangle.c
--- binutils-2.32/libiberty/cp-demangle.c 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/libiberty/cp-demangle.c 2019-11-19 20:47:08.574628396 +0100
@@ -861,7 +861,7 @@ CP_STATIC_IF_GLIBCPP_V3
int
cplus_demangle_fill_name (struct demangle_component *p, const char *s, int len)
{
- if (p == NULL || s == NULL || len == 0)
+ if (p == NULL || s == NULL || len <= 0)
return 0;
p->d_printing = 0;
p->type = DEMANGLE_COMPONENT_NAME;
@@ -4055,7 +4055,7 @@ d_growable_string_callback_adapter (cons
are larger than the actual numbers encountered. */
static void
-d_count_templates_scopes (int *num_templates, int *num_scopes,
+d_count_templates_scopes (struct d_print_info *dpi,
const struct demangle_component *dc)
{
if (dc == NULL)
@@ -4075,13 +4075,13 @@ d_count_templates_scopes (int *num_templ
break;
case DEMANGLE_COMPONENT_TEMPLATE:
- (*num_templates)++;
+ dpi->num_copy_templates++;
goto recurse_left_right;
case DEMANGLE_COMPONENT_REFERENCE:
case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
if (d_left (dc)->type == DEMANGLE_COMPONENT_TEMPLATE_PARAM)
- (*num_scopes)++;
+ dpi->num_saved_scopes++;
goto recurse_left_right;
case DEMANGLE_COMPONENT_QUAL_NAME:
@@ -4146,42 +4146,42 @@ d_count_templates_scopes (int *num_templ
case DEMANGLE_COMPONENT_TAGGED_NAME:
case DEMANGLE_COMPONENT_CLONE:
recurse_left_right:
- d_count_templates_scopes (num_templates, num_scopes,
- d_left (dc));
- d_count_templates_scopes (num_templates, num_scopes,
- d_right (dc));
+ /* PR 89394 - Check for too much recursion. */
+ if (dpi->recursion > DEMANGLE_RECURSION_LIMIT)
+ /* FIXME: There ought to be a way to report to the
+ user that the recursion limit has been reached. */
+ return;
+
+ ++ dpi->recursion;
+ d_count_templates_scopes (dpi, d_left (dc));
+ d_count_templates_scopes (dpi, d_right (dc));
+ -- dpi->recursion;
break;
case DEMANGLE_COMPONENT_CTOR:
- d_count_templates_scopes (num_templates, num_scopes,
- dc->u.s_ctor.name);
+ d_count_templates_scopes (dpi, dc->u.s_ctor.name);
break;
case DEMANGLE_COMPONENT_DTOR:
- d_count_templates_scopes (num_templates, num_scopes,
- dc->u.s_dtor.name);
+ d_count_templates_scopes (dpi, dc->u.s_dtor.name);
break;
case DEMANGLE_COMPONENT_EXTENDED_OPERATOR:
- d_count_templates_scopes (num_templates, num_scopes,
- dc->u.s_extended_operator.name);
+ d_count_templates_scopes (dpi, dc->u.s_extended_operator.name);
break;
case DEMANGLE_COMPONENT_FIXED_TYPE:
- d_count_templates_scopes (num_templates, num_scopes,
- dc->u.s_fixed.length);
+ d_count_templates_scopes (dpi, dc->u.s_fixed.length);
break;
case DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS:
case DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS:
- d_count_templates_scopes (num_templates, num_scopes,
- d_left (dc));
+ d_count_templates_scopes (dpi, d_left (dc));
break;
case DEMANGLE_COMPONENT_LAMBDA:
case DEMANGLE_COMPONENT_DEFAULT_ARG:
- d_count_templates_scopes (num_templates, num_scopes,
- dc->u.s_unary_num.sub);
+ d_count_templates_scopes (dpi, dc->u.s_unary_num.sub);
break;
}
}
@@ -4216,8 +4216,12 @@ d_print_init (struct d_print_info *dpi,
dpi->next_copy_template = 0;
dpi->num_copy_templates = 0;
- d_count_templates_scopes (&dpi->num_copy_templates,
- &dpi->num_saved_scopes, dc);
+ d_count_templates_scopes (dpi, dc);
+ /* If we did not reach the recursion limit, then reset the
+ current recursion value back to 0, so that we can print
+ the templates. */
+ if (dpi->recursion < DEMANGLE_RECURSION_LIMIT)
+ dpi->recursion = 0;
dpi->num_copy_templates *= dpi->num_saved_scopes;
dpi->current_template = NULL;

View File

@ -1,14 +0,0 @@
diff -rupN --no-dereference binutils-2.32/binutils/objdump.c binutils-2.32-new/binutils/objdump.c
--- binutils-2.32/binutils/objdump.c 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/binutils/objdump.c 2019-11-19 20:47:04.839607089 +0100
@@ -3178,7 +3178,9 @@ dump_bfd_header (bfd *abfd)
static void
dump_bfd_private_header (bfd *abfd)
{
- bfd_print_private_bfd_data (abfd, stdout);
+ if (!bfd_print_private_bfd_data (abfd, stdout))
+ non_fatal (_("warning: private headers incomplete: %s"),
+ bfd_errmsg (bfd_get_error ()));
}
static void

View File

@ -1,33 +0,0 @@
diff -rupN --no-dereference binutils-2.32/bfd/pei-x86_64.c binutils-2.32-new/bfd/pei-x86_64.c
--- binutils-2.32/bfd/pei-x86_64.c 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/bfd/pei-x86_64.c 2019-11-19 20:47:05.573611249 +0100
@@ -541,7 +541,7 @@ pex64_bfd_print_pdata_section (bfd *abfd
/* virt_size might be zero for objects. */
if (stop == 0 && strcmp (abfd->xvec->name, "pe-x86-64") == 0)
{
- stop = (datasize / onaline) * onaline;
+ stop = datasize;
virt_size_is_zero = TRUE;
}
else if (datasize < stop)
@@ -551,8 +551,8 @@ pex64_bfd_print_pdata_section (bfd *abfd
_("Warning: %s section size (%ld) is smaller than virtual size (%ld)\n"),
pdata_section->name, (unsigned long) datasize,
(unsigned long) stop);
- /* Be sure not to read passed datasize. */
- stop = datasize / onaline;
+ /* Be sure not to read past datasize. */
+ stop = datasize;
}
/* Display functions table. */
@@ -724,8 +724,7 @@ pex64_bfd_print_pdata_section (bfd *abfd
altent += imagebase;
if (altent >= pdata_vma
- && (altent + PDATA_ROW_SIZE <= pdata_vma
- + pei_section_data (abfd, pdata_section)->virt_size))
+ && altent - pdata_vma + PDATA_ROW_SIZE <= stop)
{
pex64_get_runtime_function
(abfd, &arf, &pdata[altent - pdata_vma]);

View File

@ -1,73 +0,0 @@
diff -rupN --no-dereference binutils-2.32/bfd/archive64.c binutils-2.32-new/bfd/archive64.c
--- binutils-2.32/bfd/archive64.c 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/archive64.c 2019-11-19 20:47:06.349615660 +0100
@@ -100,8 +100,6 @@ _bfd_archive_64_bit_slurp_armap (bfd *ab
return FALSE;
carsyms = ardata->symdefs;
stringbase = ((char *) ardata->symdefs) + carsym_size;
- stringbase[stringsize] = 0;
- stringend = stringbase + stringsize;
raw_armap = (bfd_byte *) bfd_alloc (abfd, ptrsize);
if (raw_armap == NULL)
@@ -115,15 +113,17 @@ _bfd_archive_64_bit_slurp_armap (bfd *ab
goto release_raw_armap;
}
+ stringend = stringbase + stringsize;
+ *stringend = 0;
for (i = 0; i < nsymz; i++)
{
carsyms->file_offset = bfd_getb64 (raw_armap + i * 8);
carsyms->name = stringbase;
- if (stringbase < stringend)
- stringbase += strlen (stringbase) + 1;
+ stringbase += strlen (stringbase);
+ if (stringbase != stringend)
+ ++stringbase;
++carsyms;
}
- *stringbase = '\0';
ardata->symdef_count = nsymz;
ardata->first_file_filepos = bfd_tell (abfd);
diff -rupN --no-dereference binutils-2.32/bfd/archive.c binutils-2.32-new/bfd/archive.c
--- binutils-2.32/bfd/archive.c 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/archive.c 2019-11-19 20:47:06.350615666 +0100
@@ -1012,6 +1012,7 @@ do_slurp_coff_armap (bfd *abfd)
int *raw_armap, *rawptr;
struct artdata *ardata = bfd_ardata (abfd);
char *stringbase;
+ char *stringend;
bfd_size_type stringsize;
bfd_size_type parsed_size;
carsym *carsyms;
@@ -1071,22 +1072,20 @@ do_slurp_coff_armap (bfd *abfd)
}
/* OK, build the carsyms. */
- for (i = 0; i < nsymz && stringsize > 0; i++)
+ stringend = stringbase + stringsize;
+ *stringend = 0;
+ for (i = 0; i < nsymz; i++)
{
bfd_size_type len;
rawptr = raw_armap + i;
carsyms->file_offset = swap ((bfd_byte *) rawptr);
carsyms->name = stringbase;
- /* PR 17512: file: 4a1d50c1. */
- len = strnlen (stringbase, stringsize);
- if (len < stringsize)
- len ++;
- stringbase += len;
- stringsize -= len;
+ stringbase += strlen (stringbase);
+ if (stringbase != stringend)
+ ++stringbase;
carsyms++;
}
- *stringbase = 0;
ardata->symdef_count = nsymz;
ardata->first_file_filepos = bfd_tell (abfd);

View File

@ -1,17 +0,0 @@
diff -rupN --no-dereference binutils-2.32/binutils/readelf.c binutils-2.32-new/binutils/readelf.c
--- binutils-2.32/binutils/readelf.c 2019-11-19 20:47:01.883590484 +0100
+++ binutils-2.32-new/binutils/readelf.c 2019-11-19 20:47:07.105619971 +0100
@@ -16200,6 +16200,13 @@ process_mips_specific (Filedata * fileda
return FALSE;
}
+ /* PR 24243 */
+ if (sect->sh_size < sizeof (* eopt))
+ {
+ error (_("The MIPS options section is too small.\n"));
+ return FALSE;
+ }
+
eopt = (Elf_External_Options *) get_data (NULL, filedata, options_offset, 1,
sect->sh_size, _("options"));
if (eopt)

View File

@ -1,21 +0,0 @@
diff -rupN --no-dereference binutils-2.32/gold/aarch64.cc binutils-2.32-new/gold/aarch64.cc
--- binutils-2.32/gold/aarch64.cc 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/gold/aarch64.cc 2019-11-19 20:47:09.316632670 +0100
@@ -6496,6 +6496,17 @@ Target_aarch64<size, big_endian>::Scan::
gold_error(_("%s: unsupported reloc %u in pos independent link."),
object->name().c_str(), r_type);
}
+ // Make a PLT entry if necessary.
+ if (gsym->needs_plt_entry())
+ {
+ target->make_plt_entry(symtab, layout, gsym);
+ // Since this is not a PC-relative relocation, we may be
+ // taking the address of a function. In that case we need to
+ // set the entry in the dynamic symbol table to the address of
+ // the PLT entry.
+ if (gsym->is_from_dynobj() && !parameters->options().shared())
+ gsym->set_needs_dynsym_value();
+ }
break;
case elfcpp::R_AARCH64_LD_PREL_LO19: // 273

42
binutils-config.patch Normal file
View File

@ -0,0 +1,42 @@
diff -rupN --no-dereference binutils-2.34/config/intdiv0.m4 binutils-2.34-new/config/intdiv0.m4
--- binutils-2.34/config/intdiv0.m4 2020-01-18 14:55:47.000000000 +0100
+++ binutils-2.34-new/config/intdiv0.m4 2020-12-18 02:57:26.339013830 +0100
@@ -31,10 +31,10 @@ sigfpe_handler (sig) int sig;
exit (sig != SIGFPE);
}
-int x = 1;
-int y = 0;
-int z;
-int nan;
+volatile int x = 1;
+volatile int y = 0;
+volatile int z;
+volatile int nan;
int main ()
{
diff -rupN --no-dereference binutils-2.34/libiberty/aclocal.m4 binutils-2.34-new/libiberty/aclocal.m4
--- binutils-2.34/libiberty/aclocal.m4 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/libiberty/aclocal.m4 2020-12-18 02:57:26.339013830 +0100
@@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then
fi
AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
-[AC_TRY_RUN([find_stack_direction ()
+[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction ()
{
static char *addr = 0;
auto char dummy;
diff -rupN --no-dereference binutils-2.34/libiberty/configure.ac binutils-2.34-new/libiberty/configure.ac
--- binutils-2.34/libiberty/configure.ac 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/libiberty/configure.ac 2020-12-18 02:57:26.339013830 +0100
@@ -661,7 +661,7 @@ if test -z "${setobjs}"; then
for v in $vars; do
AC_MSG_CHECKING([for $v])
AC_CACHE_VAL(libiberty_cv_var_$v,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[__attribute__ ((used)) int *p;]],[[extern int $v []; p = $v;]])],
[eval "libiberty_cv_var_$v=yes"],
[eval "libiberty_cv_var_$v=no"])])
if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then

View File

@ -1,37 +0,0 @@
diff -rupN --no-dereference binutils-2.32/bfd/coffgen.c binutils-2.32-new/bfd/coffgen.c
--- binutils-2.32/bfd/coffgen.c 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/coffgen.c 2019-11-19 20:47:07.835624150 +0100
@@ -2294,7 +2294,7 @@ coff_find_nearest_line_with_names (bfd *
information. So try again, using a bias against the address sought. */
if (coff_data (abfd)->dwarf2_find_line_info != NULL)
{
- bfd_signed_vma bias;
+ bfd_signed_vma bias = 0;
/* Create a cache of the result for the next call. */
if (sec_data == NULL && section->owner == abfd)
@@ -2306,10 +2306,11 @@ coff_find_nearest_line_with_names (bfd *
if (sec_data != NULL && sec_data->saved_bias)
bias = sec_data->saved_bias;
- else
+ else if (symbols)
{
bias = _bfd_dwarf2_find_symbol_bias (symbols,
& coff_data (abfd)->dwarf2_find_line_info);
+
if (sec_data)
{
sec_data->saved_bias = TRUE;
diff -rupN --no-dereference binutils-2.32/bfd/dwarf2.c binutils-2.32-new/bfd/dwarf2.c
--- binutils-2.32/bfd/dwarf2.c 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/dwarf2.c 2019-11-19 20:47:07.836624156 +0100
@@ -4472,7 +4472,7 @@ _bfd_dwarf2_find_symbol_bias (asymbol **
stash = (struct dwarf2_debug *) *pinfo;
- if (stash == NULL)
+ if (stash == NULL || symbols == NULL)
return 0;
for (unit = stash->all_comp_units; unit; unit = unit->next_unit)

View File

@ -1,7 +1,7 @@
diff -rupN --no-dereference binutils-2.32/configure binutils-2.32-new/configure
--- binutils-2.32/configure 2019-01-19 17:10:54.000000000 +0100
+++ binutils-2.32-new/configure 2019-11-19 20:47:01.887590506 +0100
@@ -5049,49 +5049,6 @@ if test -z "$LD"; then
diff -rupN --no-dereference binutils-2.34/configure binutils-2.34-new/configure
--- binutils-2.34/configure 2020-01-18 15:01:13.000000000 +0100
+++ binutils-2.34-new/configure 2020-12-18 02:57:17.364045443 +0100
@@ -5103,49 +5103,6 @@ if test -z "$LD"; then
fi
fi
@ -51,10 +51,10 @@ diff -rupN --no-dereference binutils-2.32/configure binutils-2.32-new/configure
if test -n "$ac_tool_prefix"; then
diff -rupN --no-dereference binutils-2.32/configure.ac binutils-2.32-new/configure.ac
--- binutils-2.32/configure.ac 2019-02-02 17:15:43.000000000 +0100
+++ binutils-2.32-new/configure.ac 2019-11-19 20:47:01.887590506 +0100
@@ -1283,26 +1283,6 @@ if test -z "$LD"; then
diff -rupN --no-dereference binutils-2.34/configure.ac binutils-2.34-new/configure.ac
--- binutils-2.34/configure.ac 2020-02-01 13:02:56.000000000 +0100
+++ binutils-2.34-new/configure.ac 2020-12-18 02:57:17.364045443 +0100
@@ -1284,26 +1284,6 @@ if test -z "$LD"; then
fi
fi

View File

@ -1,19 +0,0 @@
diff -rupN --no-dereference binutils-2.32/ld/emultempl/elf32.em binutils-2.32-new/ld/emultempl/elf32.em
--- binutils-2.32/ld/emultempl/elf32.em 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/ld/emultempl/elf32.em 2019-11-19 20:47:12.267649813 +0100
@@ -2029,10 +2029,12 @@ elf_orphan_compatible (asection *in, ase
if (elf_section_data (out)->this_hdr.sh_info
!= elf_section_data (in)->this_hdr.sh_info)
return FALSE;
- /* We can't merge two sections with differing SHF_EXCLUDE when doing
- a relocatable link. */
+ /* We can't merge with member of output section group nor merge two
+ sections with differing SHF_EXCLUDE when doing a relocatable link. */
if (bfd_link_relocatable (&link_info)
- && ((elf_section_flags (out) ^ elf_section_flags (in)) & SHF_EXCLUDE) != 0)
+ && (elf_next_in_group (out) != NULL
+ || ((elf_section_flags (out) ^ elf_section_flags (in))
+ & SHF_EXCLUDE) != 0))
return FALSE;
return _bfd_elf_match_sections_by_type (link_info.output_bfd, out,
in->owner, in);

View File

@ -1,66 +0,0 @@
diff -rupN --no-dereference binutils-2.32/bfd/elf-bfd.h binutils-2.32-new/bfd/elf-bfd.h
--- binutils-2.32/bfd/elf-bfd.h 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/elf-bfd.h 2019-11-19 20:47:11.528645500 +0100
@@ -2749,6 +2749,8 @@ extern bfd_vma elf64_r_sym (bfd_vma);
extern bfd_vma elf32_r_info (bfd_vma, bfd_vma);
extern bfd_vma elf32_r_sym (bfd_vma);
+extern bfd_boolean is_debuginfo_file (bfd *);
+
/* Large common section. */
extern asection _bfd_elf_large_com_section;
diff -rupN --no-dereference binutils-2.32/bfd/elf.c binutils-2.32-new/bfd/elf.c
--- binutils-2.32/bfd/elf.c 2019-11-19 20:47:04.094602882 +0100
+++ binutils-2.32-new/bfd/elf.c 2019-11-19 20:47:11.530645511 +0100
@@ -5807,6 +5807,35 @@ assign_file_positions_for_load_sections
return TRUE;
}
+/* Determine if a bfd is a debuginfo file. Unfortunately there
+ is no defined method for detecting such files, so we have to
+ use heuristics instead. */
+
+bfd_boolean
+is_debuginfo_file (bfd *abfd)
+{
+ if (abfd == NULL || bfd_get_flavour (abfd) != bfd_target_elf_flavour)
+ return FALSE;
+
+ Elf_Internal_Shdr **start_headers = elf_elfsections (abfd);
+ Elf_Internal_Shdr **end_headers = start_headers + elf_numsections (abfd);
+ Elf_Internal_Shdr **headerp;
+
+ for (headerp = start_headers; headerp < end_headers; headerp ++)
+ {
+ Elf_Internal_Shdr *header = * headerp;
+
+ /* Debuginfo files do not have any allocated SHT_PROGBITS sections.
+ The only allocated sections are SHT_NOBITS or SHT_NOTES. */
+ if ((header->sh_flags & SHF_ALLOC) == SHF_ALLOC
+ && header->sh_type != SHT_NOBITS
+ && header->sh_type != SHT_NOTE)
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
/* Assign file positions for the other sections. */
static bfd_boolean
@@ -5840,7 +5869,13 @@ assign_file_positions_for_non_load_secti
BFD_ASSERT (hdr->sh_offset == hdr->bfd_section->filepos);
else if ((hdr->sh_flags & SHF_ALLOC) != 0)
{
- if (hdr->sh_size != 0)
+ if (hdr->sh_size != 0
+ /* PR 24717 - debuginfo files are known to be not strictly
+ compliant with the ELF standard. In particular they often
+ have .note.gnu.property sections that are outside of any
+ loadable segment. This is not a problem for such files,
+ so do not warn about them. */
+ && ! is_debuginfo_file (abfd))
_bfd_error_handler
/* xgettext:c-format */
(_("%pB: warning: allocated section `%s' not in segment"),

View File

@ -1,6 +1,6 @@
diff -rupN --no-dereference binutils-2.32/bfd/Makefile.am binutils-2.32-new/bfd/Makefile.am
--- binutils-2.32/bfd/Makefile.am 2019-11-19 20:46:58.862573749 +0100
+++ binutils-2.32-new/bfd/Makefile.am 2019-11-19 20:46:58.865573765 +0100
diff -rupN --no-dereference binutils-2.34/bfd/Makefile.am binutils-2.34-new/bfd/Makefile.am
--- binutils-2.34/bfd/Makefile.am 2020-12-18 02:57:13.290059799 +0100
+++ binutils-2.34-new/bfd/Makefile.am 2020-12-18 02:57:13.293059789 +0100
@@ -33,7 +33,7 @@ bfdlibdir = @bfdlibdir@
bfdincludedir = @bfdincludedir@
bfdlib_LTLIBRARIES = libbfd.la
@ -10,9 +10,9 @@ diff -rupN --no-dereference binutils-2.32/bfd/Makefile.am binutils-2.32-new/bfd/
else !INSTALL_LIBBFD
# Empty these so that the respective installation directories will not be created.
bfdlibdir =
diff -rupN --no-dereference binutils-2.32/bfd/Makefile.in binutils-2.32-new/bfd/Makefile.in
--- binutils-2.32/bfd/Makefile.in 2019-11-19 20:46:58.863573754 +0100
+++ binutils-2.32-new/bfd/Makefile.in 2019-11-19 20:46:58.866573771 +0100
diff -rupN --no-dereference binutils-2.34/bfd/Makefile.in binutils-2.34-new/bfd/Makefile.in
--- binutils-2.34/bfd/Makefile.in 2020-12-18 02:57:13.290059799 +0100
+++ binutils-2.34-new/bfd/Makefile.in 2020-12-18 02:57:13.294059785 +0100
@@ -249,7 +249,7 @@ am__can_run_installinfo = \
esac
am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \

View File

@ -1,6 +1,6 @@
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-10.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-10.d 2019-11-19 20:47:04.100602916 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-10.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-10.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-10.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-10.d 2020-12-18 02:57:20.370034853 +0100
@@ -32,7 +32,8 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/libtext.a \[@.* not claimed
#...
@ -11,9 +11,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d bin
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-11.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-11.d 2019-11-19 20:47:04.100602916 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-11.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-11.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-11.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-11.d 2020-12-18 02:57:20.371034849 +0100
@@ -35,8 +35,9 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED
#...
@ -26,32 +26,18 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d bin
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-12.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-12.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-12.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-12.d 2019-11-19 20:47:04.100602916 +0100
@@ -1,6 +1,6 @@
#...
-.*: symbol `func' definition: 0, visibility: 0, resolution: 2
-.*: symbol `func1' definition: 0, visibility: 1, resolution: 3
-.*: symbol `func2' definition: 0, visibility: 2, resolution: 3
-.*: symbol `func3' definition: 0, visibility: 3, resolution: 3
+.*: symbol `_?func' definition: 0, visibility: 0, resolution: .
+.*: symbol `_?func1' definition: 0, visibility: 1, resolution: 3
+.*: symbol `_?func2' definition: 0, visibility: 2, resolution: 3
+.*: symbol `_?func3' definition: 0, visibility: 3, resolution: 3
#pass
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-13.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-13.d 2019-11-19 20:47:04.097602899 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-13.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-13.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-13.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-13.d 2020-12-18 02:57:20.371034849 +0100
@@ -23,5 +23,3 @@ hook called: claim_file tmpdir/main.o \[
hook called: claim_file .*/ld/testsuite/ld-plugin/func.c \[@0/.* CLAIMED
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
-.*main.c.*: undefined reference to `\.?func'
-#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-14.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-14.d 2019-11-19 20:47:04.097602899 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-14.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-14.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-14.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-14.d 2020-12-18 02:57:20.371034849 +0100
@@ -27,7 +27,6 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
@ -61,9 +47,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d bin
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-15.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-15.d 2019-11-19 20:47:04.097602899 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-15.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-15.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-15.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-15.d 2020-12-18 02:57:20.371034849 +0100
@@ -28,7 +28,6 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
@ -73,9 +59,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d bin
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-16.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-16.d 2019-11-19 20:47:04.097602899 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-16.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-16.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-16.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-16.d 2020-12-18 02:57:20.372034846 +0100
@@ -30,9 +30,8 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
@ -88,9 +74,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d bin
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-17.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-17.d 2019-11-19 20:47:04.098602905 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-17.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-17.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-17.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-17.d 2020-12-18 02:57:20.372034846 +0100
@@ -31,7 +31,8 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
@ -101,9 +87,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d bin
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-18.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-18.d 2019-11-19 20:47:04.100602916 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-18.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-18.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-18.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-18.d 2020-12-18 02:57:20.372034846 +0100
@@ -32,7 +32,8 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/libtext.a \[@.* not claimed
#...
@ -114,9 +100,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d bin
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-19.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-19.d 2019-11-19 20:47:04.100602916 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-19.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-19.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-19.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-19.d 2020-12-18 02:57:20.372034846 +0100
@@ -35,8 +35,9 @@ hook called: claim_file .*/ld/testsuite/
hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED
#...
@ -129,9 +115,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d bin
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-20.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-20.d 2019-11-19 20:47:04.098602905 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-20.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-20.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-20.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-20.d 2020-12-18 02:57:20.372034846 +0100
@@ -2,6 +2,5 @@ hook called: all symbols read.
Input: func.c \(tmpdir/libfunc.a\)
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
@ -140,9 +126,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d bin
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-21.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-21.d 2019-11-19 20:47:04.098602905 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-21.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-21.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-21.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-21.d 2020-12-18 02:57:20.372034846 +0100
@@ -2,6 +2,5 @@ hook called: all symbols read.
Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\)
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
@ -151,9 +137,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d bin
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-22.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-22.d 2019-11-19 20:47:04.098602905 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-22.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-22.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-22.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-22.d 2020-12-18 02:57:20.373034842 +0100
@@ -2,6 +2,5 @@ Claimed: tmpdir/libfunc.a \[@.*
hook called: all symbols read.
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
@ -162,9 +148,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d bin
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-23.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-23.d 2019-11-19 20:47:04.098602905 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-23.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-23.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-23.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-23.d 2020-12-18 02:57:20.373034842 +0100
@@ -2,6 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func.
hook called: all symbols read.
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
@ -173,47 +159,47 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d bin
-.*main.c.*: undefined reference to `\.?func'
+#...
hook called: cleanup.
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-24.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-24.d 2019-11-19 20:47:04.098602905 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-24.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-24.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-24.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-24.d 2020-12-18 02:57:20.373034842 +0100
@@ -2,4 +2,5 @@ hook called: all symbols read.
Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\)
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
+#...
hook called: cleanup.
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-25.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-25.d 2019-11-19 20:47:04.098602905 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-25.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-25.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-25.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-25.d 2020-12-18 02:57:20.373034842 +0100
@@ -2,4 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func.
hook called: all symbols read.
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
+#...
hook called: cleanup.
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-28.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-28.d 2019-11-19 20:47:04.101602922 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-28.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-28.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-28.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-28.d 2020-12-18 02:57:20.373034842 +0100
@@ -1 +1,2 @@
.*: error: Error
+#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-29.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-29.d 2019-11-19 20:47:04.099602910 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-29.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-29.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-29.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-29.d 2020-12-18 02:57:20.373034842 +0100
@@ -1 +1,2 @@
.*: warning: Warning
+#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-30.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-30.d 2019-11-19 20:47:04.099602910 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-30.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-30.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-30.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-30.d 2020-12-18 02:57:20.373034842 +0100
@@ -24,3 +24,4 @@ hook called: claim_file tmpdir/main.o \[
hook called: claim_file tmpdir/func.o \[@0/.* not claimed
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
hook called: claim_file tmpdir/libempty.a \[@.* not claimed
+#pass
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-6.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-6.d 2019-11-19 20:47:04.099602910 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-6.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-6.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-6.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-6.d 2020-12-18 02:57:20.374034839 +0100
@@ -27,7 +27,6 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
@ -223,9 +209,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d binu
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-7.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-7.d 2019-11-19 20:47:04.099602910 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-7.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-7.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-7.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-7.d 2020-12-18 02:57:20.374034839 +0100
@@ -28,7 +28,6 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
@ -235,9 +221,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d binu
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-8.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-8.d 2019-11-19 20:47:04.101602922 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-8.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-8.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-8.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-8.d 2020-12-18 02:57:20.374034839 +0100
@@ -30,9 +30,8 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
@ -250,9 +236,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d binu
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d binutils-2.32-new/ld/testsuite/ld-plugin/plugin-9.d
--- binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/plugin-9.d 2019-11-19 20:47:04.099602910 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/plugin-9.d binutils-2.34-new/ld/testsuite/ld-plugin/plugin-9.d
--- binutils-2.34/ld/testsuite/ld-plugin/plugin-9.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/plugin-9.d 2020-12-18 02:57:20.374034839 +0100
@@ -31,7 +31,8 @@ hook called: claim_file tmpdir/func.o \[
hook called: claim_file tmpdir/text.o \[@0/.* not claimed
#...
@ -263,9 +249,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d binu
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/pr20070.d binutils-2.32-new/ld/testsuite/ld-plugin/pr20070.d
--- binutils-2.32/ld/testsuite/ld-plugin/pr20070.d 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-plugin/pr20070.d 2019-11-19 20:47:04.099602910 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-plugin/pr20070.d binutils-2.34-new/ld/testsuite/ld-plugin/pr20070.d
--- binutils-2.34/ld/testsuite/ld-plugin/pr20070.d 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-plugin/pr20070.d 2020-12-18 02:57:20.374034839 +0100
@@ -5,5 +5,6 @@ Sym: 'weakdef' Resolution: LDPR_PREVAILI
Sym: 'undef' Resolution: LDPR_UNDEF
Sym: 'weakundef' Resolution: LDPR_UNDEF
@ -273,9 +259,9 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-plugin/pr20070.d binut
+#...
hook called: cleanup.
#...
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-srec/srec.exp binutils-2.32-new/ld/testsuite/ld-srec/srec.exp
--- binutils-2.32/ld/testsuite/ld-srec/srec.exp 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-srec/srec.exp 2019-11-19 20:47:04.099602910 +0100
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-srec/srec.exp binutils-2.34-new/ld/testsuite/ld-srec/srec.exp
--- binutils-2.34/ld/testsuite/ld-srec/srec.exp 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-srec/srec.exp 2020-12-18 02:57:20.374034839 +0100
@@ -21,6 +21,8 @@
# Get the offset from an S-record line to the start of the data.
@ -285,10 +271,10 @@ diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-srec/srec.exp binutils
proc srec_off { l } {
if [string match "S1*" $l] {
return 8
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.32-new/ld/testsuite/ld-x86-64/x86-64.exp
--- binutils-2.32/ld/testsuite/ld-x86-64/x86-64.exp 2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-x86-64/x86-64.exp 2019-11-19 20:47:04.100602916 +0100
@@ -1275,25 +1275,6 @@ if { [isnative] && [which $CC] != 0 } {
diff -rupN --no-dereference binutils-2.34/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.34-new/ld/testsuite/ld-x86-64/x86-64.exp
--- binutils-2.34/ld/testsuite/ld-x86-64/x86-64.exp 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/ld/testsuite/ld-x86-64/x86-64.exp 2020-12-18 02:57:20.374034839 +0100
@@ -1322,25 +1322,6 @@ if { [isnative] && [check_compiler_avail
"$NOPIE_CFLAGS" \
] \
]

View File

@ -1,56 +0,0 @@
diff -rupN --no-dereference binutils-2.32/gas/write.c binutils-2.32-new/gas/write.c
--- binutils-2.32/gas/write.c 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/gas/write.c 2019-11-19 20:47:10.792641216 +0100
@@ -1891,7 +1891,8 @@ create_obj_attrs_section (void)
static void
create_note_reloc (segT sec,
symbolS * sym,
- bfd_size_type offset,
+ bfd_size_type note_offset,
+ bfd_size_type desc2_offset,
int reloc_type,
bfd_vma addend,
char * note)
@@ -1901,10 +1902,10 @@ create_note_reloc (segT sec,
reloc = XNEW (struct reloc_list);
/* We create a .b type reloc as resolve_reloc_expr_symbols() has already been called. */
- reloc->u.b.sec = sec;
- reloc->u.b.s = symbol_get_bfdsym (sym);
+ reloc->u.b.sec = sec;
+ reloc->u.b.s = symbol_get_bfdsym (sym);
reloc->u.b.r.sym_ptr_ptr = & reloc->u.b.s;
- reloc->u.b.r.address = offset;
+ reloc->u.b.r.address = note_offset + desc2_offset;
reloc->u.b.r.addend = addend;
reloc->u.b.r.howto = bfd_reloc_type_lookup (stdoutput, reloc_type);
@@ -1929,12 +1930,12 @@ create_note_reloc (segT sec,
if (target_big_endian)
{
if (bfd_arch_bits_per_address (stdoutput) <= 32)
- note[offset + 3] = addend;
+ note[desc2_offset + 3] = addend;
else
- note[offset + 7] = addend;
+ note[desc2_offset + 7] = addend;
}
else
- note[offset] = addend;
+ note[desc2_offset] = addend;
}
}
@@ -2037,10 +2038,10 @@ maybe_generate_build_notes (void)
memcpy (note + 12, "GA$3a1", 8);
/* Create a relocation to install the start address of the note... */
- create_note_reloc (sec, sym, total_size + 20, desc_reloc, 0, note);
+ create_note_reloc (sec, sym, total_size, 20, desc_reloc, 0, note);
/* ...and another one to install the end address. */
- create_note_reloc (sec, sym, total_size + desc2_offset, desc_reloc,
+ create_note_reloc (sec, sym, total_size, desc2_offset, desc_reloc,
bfd_get_section_size (bsym->section),
note);

View File

@ -0,0 +1,368 @@
From 014cc7f849e8209623fc99264814bce7b3b6faf2 Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@gotplt.org>
Date: Mon, 7 Dec 2020 20:48:33 +0530
Subject: [PATCH] binutils: Make smart_rename safe too
smart_rename is capable of handling symlinks by copying and it also
tries to preserve ownership and permissions of files when they're
overwritten during the rename. This is useful in objcopy where the
file properties need to be preserved.
However because smart_rename does this using file names, it leaves a
race window between renames and permission fixes. This change removes
this race window by using file descriptors from the original BFDs that
were used to manipulate these files wherever possible.
The file that is to be renamed is also passed as a file descriptor so
that we use fchown/fchmod on the file descriptor, thus making sure
that we only modify the file we have opened to write. Further, in
case the file is to be overwritten (as is the case in ar or objcopy),
the permissions that need to be restored are taken from the file
descriptor that was opened for input so that integrity of the file
status is maintained all the way through to the rename.
binutils/
* rename.c
* ar.c
(write_archive) [!defined (_WIN32) || defined (__CYGWIN32__)]:
Initialize TARGET_STAT and OFD to pass to SMART_RENAME.
* arsup.c
(ar_save) [defined (_WIN32) || defined (__CYGWIN32__)]:
Likewise.
* bucomm.h (smart_rename): Add new arguments to declaration.
* objcopy.c
(strip_main)[defined (_WIN32) || defined (__CYGWIN32__)]:
Initialize COPYFD and pass to SMART_RENAME.
(copy_main) [defined (_WIN32) || defined (__CYGWIN32__)]:
Likewise.
* rename.c (try_preserve_permissions): New function.
(smart_rename): Use it and add new arguments.
---
binutils/ChangeLog | 18 ++++++++
binutils/ar.c | 12 +++++-
binutils/arsup.c | 14 ++++++-
binutils/bucomm.h | 3 +-
binutils/objcopy.c | 42 +++++++++++++++----
binutils/rename.c | 101 +++++++++++++++++++++++++++++++--------------
6 files changed, 148 insertions(+), 42 deletions(-)
diff --git a/binutils/ar.c b/binutils/ar.c
index 225324208bd..6598dd9012c 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -1254,6 +1254,8 @@ write_archive (bfd *iarch)
char *old_name, *new_name;
bfd *contents_head = iarch->archive_next;
int ofd = -1;
+ struct stat target_stat;
+ bfd_boolean skip_stat = FALSE;
old_name = (char *) xmalloc (strlen (bfd_get_filename (iarch)) + 1);
strcpy (old_name, bfd_get_filename (iarch));
@@ -1299,6 +1301,14 @@ write_archive (bfd *iarch)
if (!bfd_set_archive_head (obfd, contents_head))
bfd_fatal (old_name);
+#if !defined (_WIN32) || defined (__CYGWIN32__)
+ ofd = dup (ofd);
+ if (iarch == NULL || iarch->iostream == NULL)
+ skip_stat = TRUE;
+ else if (ofd == -1 || fstat (fileno (iarch->iostream), &target_stat) != 0)
+ bfd_fatal (old_name);
+#endif
+
if (!bfd_close (obfd))
bfd_fatal (old_name);
@@ -1308,7 +1318,7 @@ write_archive (bfd *iarch)
/* We don't care if this fails; we might be creating the archive. */
bfd_close (iarch);
- if (smart_rename (new_name, old_name, 0) != 0)
+ if (smart_rename (new_name, old_name, ofd, skip_stat ? NULL : &target_stat, 0) != 0)
xexit (1);
free (old_name);
free (new_name);
diff --git a/binutils/arsup.c b/binutils/arsup.c
index a668f270f1a..8b4437ff417 100644
--- a/binutils/arsup.c
+++ b/binutils/arsup.c
@@ -345,13 +345,25 @@ ar_save (void)
else
{
char *ofilename = xstrdup (bfd_get_filename (obfd));
+ bfd_boolean skip_stat = FALSE;
+ struct stat target_stat;
+ int ofd = -1;
if (deterministic > 0)
obfd->flags |= BFD_DETERMINISTIC_OUTPUT;
+#if !defined (_WIN32) || defined (__CYGWIN32__)
+ /* It's OK to fail; at worst it will result in SMART_RENAME using a slow
+ copy fallback to write the output. */
+ ofd = dup (fileno (obfd->iostream));
+ if (lstat (real_name, &target_stat) != 0)
+ skip_stat = TRUE;
+#endif
+
bfd_close (obfd);
- smart_rename (ofilename, real_name, 0);
+ smart_rename (ofilename, real_name, ofd,
+ skip_stat ? NULL : &target_stat, 0);
obfd = 0;
free (ofilename);
}
diff --git a/binutils/bucomm.h b/binutils/bucomm.h
index afb8e09c2fd..9613b922d5d 100644
--- a/binutils/bucomm.h
+++ b/binutils/bucomm.h
@@ -71,7 +71,8 @@ extern void print_version (const char *);
/* In rename.c. */
extern void set_times (const char *, const struct stat *);
-extern int smart_rename (const char *, const char *, int);
+extern int smart_rename (const char *, const char *, int, struct stat *, int);
+
/* In libiberty. */
void *xmalloc (size_t);
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index b6cf6ea4baa..04ba95ec140 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -4815,6 +4815,7 @@ strip_main (int argc, char *argv[])
struct stat statbuf;
char *tmpname;
int tmpfd = -1;
+ int copyfd = -1;
if (get_file_size (argv[i]) < 1)
{
@@ -4828,7 +4829,12 @@ strip_main (int argc, char *argv[])
else
tmpname = output_file;
- if (tmpname == NULL)
+ if (tmpname == NULL
+#if !defined (_WIN32) || defined (__CYGWIN32__)
+ /* Retain a copy of TMPFD since we will need it for SMART_RENAME. */
+ || (tmpfd >= 0 && (copyfd = dup (tmpfd)) == -1)
+#endif
+ )
{
bfd_nonfatal_message (argv[i], NULL, NULL,
_("could not create temporary file to hold stripped copy"));
@@ -4846,12 +4852,18 @@ strip_main (int argc, char *argv[])
if (output_file != tmpname)
status = (smart_rename (tmpname,
output_file ? output_file : argv[i],
- preserve_dates) != 0);
+ copyfd, &statbuf, preserve_dates) != 0);
if (status == 0)
status = hold_status;
}
else
- unlink_if_ordinary (tmpname);
+ {
+#if !defined (_WIN32) || defined (__CYGWIN32__)
+ if (copyfd >= 0)
+ close (copyfd);
+#endif
+ unlink_if_ordinary (tmpname);
+ }
if (output_file != tmpname)
free (tmpname);
}
@@ -5059,6 +5071,7 @@ copy_main (int argc, char *argv[])
bfd_boolean use_globalize = FALSE;
bfd_boolean use_keep_global = FALSE;
int c, tmpfd = -1;
+ int copyfd = -1;
struct stat statbuf;
const bfd_arch_info_type *input_arch = NULL;
@@ -5903,9 +5916,16 @@ copy_main (int argc, char *argv[])
else
tmpname = output_filename;
- if (tmpname == NULL)
- fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"),
- input_filename, strerror (errno));
+ if (tmpname == NULL
+#if !defined (_WIN32) || defined (__CYGWIN32__)
+ /* Retain a copy of TMPFD since we will need it for SMART_RENAME. */
+ || (tmpfd >= 0 && (copyfd = dup (tmpfd)) == -1)
+#endif
+ )
+ {
+ fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"),
+ input_filename, strerror (errno));
+ }
copy_file (input_filename, tmpname, tmpfd, &statbuf, input_target,
output_target, input_arch);
@@ -5914,11 +5934,17 @@ copy_main (int argc, char *argv[])
if (preserve_dates)
set_times (tmpname, &statbuf);
if (tmpname != output_filename)
- status = (smart_rename (tmpname, input_filename,
+ status = (smart_rename (tmpname, input_filename, copyfd, &statbuf,
preserve_dates) != 0);
}
else
- unlink_if_ordinary (tmpname);
+ {
+#if !defined (_WIN32) || defined (__CYGWIN32__)
+ if (copyfd >= 0)
+ close (copyfd);
+#endif
+ unlink_if_ordinary (tmpname);
+ }
if (tmpname != output_filename)
free (tmpname);
diff --git a/binutils/rename.c b/binutils/rename.c
index bf3b68d0462..6b9165ea1c9 100644
--- a/binutils/rename.c
+++ b/binutils/rename.c
@@ -131,17 +131,55 @@ set_times (const char *destination, const struct stat *statbuf)
#endif
#endif
-/* Rename FROM to TO, copying if TO is a link.
- Return 0 if ok, -1 if error. */
+#if !defined (_WIN32) || defined (__CYGWIN32__)
+/* Try to preserve the permission bits and ownership of an existing file when
+ rename overwrites it. FD is the file being renamed and TARGET_STAT has the
+ status of the file that was overwritten. */
+static void
+try_preserve_permissions (int fd, struct stat *target_stat)
+{
+ struct stat from_stat;
+ int ret = 0;
+
+ if (fstat (fd, &from_stat) != 0)
+ return;
+
+ int from_mode = from_stat.st_mode & 0777;
+ int to_mode = target_stat->st_mode & 0777;
+
+ /* Fix up permissions before we potentially lose ownership with fchown.
+ Clear the setxid bits because in case the fchown below fails then we don't
+ want to end up with a sxid file owned by the invoking user. If the user
+ hasn't changed or if fchown succeeded, we add back the sxid bits at the
+ end. */
+ if (from_mode != to_mode)
+ fchmod (fd, to_mode);
+
+ /* Fix up ownership, this will clear the setxid bits. */
+ if (from_stat.st_uid != target_stat->st_uid
+ || from_stat.st_gid != target_stat->st_gid)
+ ret = fchown (fd, target_stat->st_uid, target_stat->st_gid);
+
+ /* Fix up the sxid bits if either the fchown wasn't needed or it
+ succeeded. */
+ if (ret == 0)
+ fchmod (fd, target_stat->st_mode & 07777);
+}
+#endif
+
+/* Rename FROM to TO, copying if TO is either a link or is not a regular file.
+ FD is an open file descriptor pointing to FROM that we can use to safely fix
+ up permissions of the file after renaming. TARGET_STAT has the file status
+ that is used to fix up permissions and timestamps after rename. Return 0 if
+ ok, -1 if error and FD is closed before returning. */
int
-smart_rename (const char *from, const char *to, int preserve_dates ATTRIBUTE_UNUSED)
+smart_rename (const char *from, const char *to, int fd ATTRIBUTE_UNUSED,
+ struct stat *target_stat ATTRIBUTE_UNUSED,
+ int preserve_dates ATTRIBUTE_UNUSED)
{
- bfd_boolean exists;
- struct stat s;
int ret = 0;
-
- exists = lstat (to, &s) == 0;
+ bfd_boolean exists = target_stat != NULL;
#if defined (_WIN32) && !defined (__CYGWIN32__)
/* Win32, unlike unix, will not erase `to' in `rename(from, to)' but
@@ -158,36 +196,35 @@ smart_rename (const char *from, const char *to, int preserve_dates ATTRIBUTE_UNU
unlink (from);
}
#else
- /* Use rename only if TO is not a symbolic link and has
- only one hard link, and we have permission to write to it. */
+ /* Avoid a full copy and use rename if we can fix up permissions of the
+ file after renaming, i.e.:
+
+ - TO is not a symbolic link
+ - TO is a regular file with only one hard link
+ - We have permission to write to TO
+ - FD is available to safely fix up permissions to be the same as the file
+ we overwrote with the rename.
+
+ Note though that the actual file on disk that TARGET_STAT describes may
+ have changed and we're only trying to preserve the status we know about.
+ At no point do we try to interact with the new file changes, so there can
+ only be two outcomes, i.e. either the external file change survives
+ without knowledge of our change (if it happens after the rename syscall)
+ or our rename and permissions fixup survive without any knowledge of the
+ external change. */
if (! exists
- || (!S_ISLNK (s.st_mode)
- && S_ISREG (s.st_mode)
- && (s.st_mode & S_IWUSR)
- && s.st_nlink == 1)
+ || (fd >= 0
+ && !S_ISLNK (target_stat->st_mode)
+ && S_ISREG (target_stat->st_mode)
+ && (target_stat->st_mode & S_IWUSR)
+ && target_stat->st_nlink == 1)
)
{
ret = rename (from, to);
if (ret == 0)
{
if (exists)
- {
- /* Try to preserve the permission bits and ownership of
- TO. First get the mode right except for the setuid
- bit. Then change the ownership. Then fix the setuid
- bit. We do the chmod before the chown because if the
- chown succeeds, and we are a normal user, we won't be
- able to do the chmod afterward. We don't bother to
- fix the setuid bit first because that might introduce
- a fleeting security problem, and because the chown
- will clear the setuid bit anyhow. We only fix the
- setuid bit if the chown succeeds, because we don't
- want to introduce an unexpected setuid file owned by
- the user running objcopy. */
- chmod (to, s.st_mode & 0777);
- if (chown (to, s.st_uid, s.st_gid) >= 0)
- chmod (to, s.st_mode & 07777);
- }
+ try_preserve_permissions (fd, target_stat);
}
else
{
@@ -203,9 +240,11 @@ smart_rename (const char *from, const char *to, int preserve_dates ATTRIBUTE_UNU
non_fatal (_("unable to copy file '%s'; reason: %s"), to, strerror (errno));
if (preserve_dates)
- set_times (to, &s);
+ set_times (to, target_stat);
unlink (from);
}
+ if (fd >= 0)
+ close (fd);
#endif /* _WIN32 && !__CYGWIN32__ */
return ret;
--
2.27.0

View File

@ -0,0 +1,96 @@
From 1a1c3b4cc17687091cff5a368bd6f13742bcfdf8 Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@gotplt.org>
Date: Mon, 7 Dec 2020 20:48:28 +0530
Subject: [PATCH] objcopy: Get input file stat after BFD open
Get file state from the descriptor opened by copy_file for the input
BFD. This ensures continuity in the view of the input file through
the descriptor. At the moment it is only to preserve timestamps
recorded at the point that we opened the file for input but in the
next patch this state will also be used to preserve ownership and
permissions wherever applicable.
binutils/
* objcopy.c (copy_file): New argument IN_STAT. Return stat of
ibfd through it.
(strip_main): Remove redundant stat calls. adjust copy_file
calls.
(copy_main): Likewise.
---
binutils/ChangeLog | 9 +++++++++
binutils/objcopy.c | 23 +++++++----------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 2eb083c3769..b6cf6ea4baa 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -3729,8 +3729,8 @@ set_long_section_mode (bfd *output_bfd, bfd *input_bfd, enum long_section_name_h
static void
copy_file (const char *input_filename, const char *output_filename, int ofd,
- const char *input_target, const char *output_target,
- const bfd_arch_info_type *input_arch)
+ struct stat *in_stat, const char *input_target,
+ const char *output_target, const bfd_arch_info_type *input_arch)
{
bfd *ibfd;
char **obj_matching;
@@ -3749,7 +3749,7 @@ copy_file (const char *input_filename, const char *output_filename, int ofd,
/* To allow us to do "strip *" without dying on the first
non-object file, failures are nonfatal. */
ibfd = bfd_openr (input_filename, input_target);
- if (ibfd == NULL)
+ if (ibfd == NULL || fstat (fileno (ibfd->iostream), in_stat) != 0)
{
bfd_nonfatal_message (input_filename, NULL, NULL, NULL);
status = 1;
@@ -4822,11 +4822,6 @@ strip_main (int argc, char *argv[])
continue;
}
- if (preserve_dates)
- /* No need to check the return value of stat().
- It has already been checked in get_file_size(). */
- stat (argv[i], &statbuf);
-
if (output_file == NULL
|| filename_cmp (argv[i], output_file) == 0)
tmpname = make_tempname (argv[i], &tmpfd);
@@ -4842,7 +4837,8 @@ strip_main (int argc, char *argv[])
}
status = 0;
- copy_file (argv[i], tmpname, tmpfd, input_target, output_target, NULL);
+ copy_file (argv[i], tmpname, tmpfd, &statbuf, input_target,
+ output_target, NULL);
if (status == 0)
{
if (preserve_dates)
@@ -5899,11 +5895,6 @@ copy_main (int argc, char *argv[])
convert_efi_target (efi);
}
- if (preserve_dates)
- if (stat (input_filename, & statbuf) < 0)
- fatal (_("warning: could not locate '%s'. System error message: %s"),
- input_filename, strerror (errno));
-
/* If there is no destination file, or the source and destination files
are the same, then create a temp and rename the result into the input. */
if (output_filename == NULL
@@ -5916,8 +5907,8 @@ copy_main (int argc, char *argv[])
fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"),
input_filename, strerror (errno));
- copy_file (input_filename, tmpname, tmpfd, input_target, output_target,
- input_arch);
+ copy_file (input_filename, tmpname, tmpfd, &statbuf, input_target,
+ output_target, input_arch);
if (status == 0)
{
if (preserve_dates)
--
2.27.0

View File

@ -0,0 +1,287 @@
From 365f5fb6d0f0da83817431a275e99e6f6babbe04 Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@gotplt.org>
Date: Mon, 7 Dec 2020 20:48:23 +0530
Subject: [PATCH] binutils: Use file descriptors from make_tempname
The purpose of creating a temporary file securely using mkstemp is
defeated if it is closed in make_tempname and reopened later for use;
it is as good as using mktemp. Get the file descriptor instead and
then use it to create the BFD object.
bfd/
* opncls.c (bfd_fdopenw): New function.
* bfd-in2.h: Regenerate.
binutils/
* bucomm.c (make_tempname): Add argument to return file
descriptor.
* bucomm.h (make_tempname): Likewise.
* ar.c: Include libbfd.h.
(write_archive): Adjust for change in make_tempname. Call
bfd_fdopenw instead of bfd_openw.
* objcopy.c: Include libbfd.h.
(copy_file): New argument OFD. Use bfd_fdopenw instead of
bfd_openw.
(strip_main): Adjust for change in make_tempname and
copy_file.
(copy_main): Likewise.
---
bfd/ChangeLog | 6 ++++++
bfd/bfd-in2.h | 2 ++
bfd/opncls.c | 33 +++++++++++++++++++++++++++++++++
binutils/ChangeLog | 17 +++++++++++++++++
binutils/ar.c | 11 ++++++++---
binutils/bucomm.c | 4 ++--
binutils/bucomm.h | 2 +-
binutils/objcopy.c | 30 ++++++++++++++++++++++--------
8 files changed, 91 insertions(+), 14 deletions(-)
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 935ba535b54..48e3d9b6647 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -588,6 +588,8 @@ bfd *bfd_openr (const char *filename, const char *target);
bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
+bfd *bfd_fdopenw (const char *filename, const char *target, int fd);
+
bfd *bfd_openstreamr (const char * filename, const char * target,
void * stream);
diff --git a/bfd/opncls.c b/bfd/opncls.c
index c2a1d2fa4df..f7696b658ca 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -393,6 +393,39 @@ bfd_fdopenr (const char *filename, const char *target, int fd)
return bfd_fopen (filename, target, mode, fd);
}
+/*
+FUNCTION
+ bfd_fdopenw
+
+SYNOPSIS
+ bfd *bfd_fdopenw (const char *filename, const char *target, int fd);
+
+DESCRIPTION
+ <<bfd_fdopenw>> is exactly like <<bfd_fdopenr>> with the exception that
+ the resulting BFD is suitable for output.
+*/
+
+bfd *
+bfd_fdopenw (const char *filename, const char *target, int fd)
+{
+ bfd *out = bfd_fdopenr (filename, target, fd);
+
+ if (out != NULL)
+ {
+ if (!bfd_write_p (out))
+ {
+ close (fd);
+ _bfd_delete_bfd (out);
+ out = NULL;
+ bfd_set_error (bfd_error_invalid_operation);
+ }
+ else
+ out->direction = write_direction;
+ }
+
+ return out;
+}
+
/*
FUNCTION
bfd_openstreamr
diff --git a/binutils/ar.c b/binutils/ar.c
index 7d279d6722a..225324208bd 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -25,6 +25,7 @@
#include "sysdep.h"
#include "bfd.h"
+#include "libbfd.h"
#include "libiberty.h"
#include "progress.h"
#include "getopt.h"
@@ -1252,20 +1253,24 @@ write_archive (bfd *iarch)
bfd *obfd;
char *old_name, *new_name;
bfd *contents_head = iarch->archive_next;
+ int ofd = -1;
old_name = (char *) xmalloc (strlen (bfd_get_filename (iarch)) + 1);
strcpy (old_name, bfd_get_filename (iarch));
- new_name = make_tempname (old_name);
+ new_name = make_tempname (old_name, &ofd);
if (new_name == NULL)
bfd_fatal (_("could not create temporary file whilst writing archive"));
output_filename = new_name;
- obfd = bfd_openw (new_name, bfd_get_target (iarch));
+ obfd = bfd_fdopenw (new_name, bfd_get_target (iarch), ofd);
if (obfd == NULL)
- bfd_fatal (old_name);
+ {
+ close (ofd);
+ bfd_fatal (old_name);
+ }
output_bfd = obfd;
diff --git a/binutils/bucomm.c b/binutils/bucomm.c
index 9e6a02843e6..53244201f89 100644
--- a/binutils/bucomm.c
+++ b/binutils/bucomm.c
@@ -532,7 +532,7 @@ template_in_dir (const char *path)
as FILENAME. */
char *
-make_tempname (const char *filename)
+make_tempname (const char *filename, int *ofd)
{
char *tmpname = template_in_dir (filename);
int fd;
@@ -550,7 +550,7 @@ make_tempname (const char *filename)
free (tmpname);
return NULL;
}
- close (fd);
+ *ofd = fd;
return tmpname;
}
diff --git a/binutils/bucomm.h b/binutils/bucomm.h
index d8318343f78..afb8e09c2fd 100644
--- a/binutils/bucomm.h
+++ b/binutils/bucomm.h
@@ -51,7 +51,7 @@ int display_info (void);
void print_arelt_descr (FILE *, bfd *, bfd_boolean, bfd_boolean);
-char *make_tempname (const char *);
+char *make_tempname (const char *, int *);
char *make_tempdir (const char *);
bfd_vma parse_vma (const char *, const char *);
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index ca35df03b66..2eb083c3769 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -20,6 +20,7 @@
#include "sysdep.h"
#include "bfd.h"
+#include "libbfd.h"
#include "progress.h"
#include "getopt.h"
#include "libiberty.h"
@@ -3727,7 +3728,7 @@ set_long_section_mode (bfd *output_bfd, bfd *input_bfd, enum long_section_name_h
/* The top-level control. */
static void
-copy_file (const char *input_filename, const char *output_filename,
+copy_file (const char *input_filename, const char *output_filename, int ofd,
const char *input_target, const char *output_target,
const bfd_arch_info_type *input_arch)
{
@@ -3802,9 +3803,14 @@ copy_file (const char *input_filename, const char *output_filename,
else
force_output_target = TRUE;
- obfd = bfd_openw (output_filename, output_target);
+ if (ofd >= 0)
+ obfd = bfd_fdopenw (output_filename, output_target, ofd);
+ else
+ obfd = bfd_openw (output_filename, output_target);
+
if (obfd == NULL)
{
+ close (ofd);
bfd_nonfatal_message (output_filename, NULL, NULL, NULL);
status = 1;
return;
@@ -3832,13 +3838,19 @@ copy_file (const char *input_filename, const char *output_filename,
if (output_target == NULL)
output_target = bfd_get_target (ibfd);
- obfd = bfd_openw (output_filename, output_target);
+ if (ofd >= 0)
+ obfd = bfd_fdopenw (output_filename, output_target, ofd);
+ else
+ obfd = bfd_openw (output_filename, output_target);
+
if (obfd == NULL)
{
+ close (ofd);
bfd_nonfatal_message (output_filename, NULL, NULL, NULL);
status = 1;
return;
}
+
/* This is a no-op on non-Coff targets. */
set_long_section_mode (obfd, ibfd, long_section_names);
@@ -4802,6 +4814,7 @@ strip_main (int argc, char *argv[])
int hold_status = status;
struct stat statbuf;
char *tmpname;
+ int tmpfd = -1;
if (get_file_size (argv[i]) < 1)
{
@@ -4816,7 +4829,7 @@ strip_main (int argc, char *argv[])
if (output_file == NULL
|| filename_cmp (argv[i], output_file) == 0)
- tmpname = make_tempname (argv[i]);
+ tmpname = make_tempname (argv[i], &tmpfd);
else
tmpname = output_file;
@@ -4829,7 +4842,7 @@ strip_main (int argc, char *argv[])
}
status = 0;
- copy_file (argv[i], tmpname, input_target, output_target, NULL);
+ copy_file (argv[i], tmpname, tmpfd, input_target, output_target, NULL);
if (status == 0)
{
if (preserve_dates)
@@ -5049,7 +5062,7 @@ copy_main (int argc, char *argv[])
bfd_boolean formats_info = FALSE;
bfd_boolean use_globalize = FALSE;
bfd_boolean use_keep_global = FALSE;
- int c;
+ int c, tmpfd = -1;
struct stat statbuf;
const bfd_arch_info_type *input_arch = NULL;
@@ -5895,7 +5908,7 @@ copy_main (int argc, char *argv[])
are the same, then create a temp and rename the result into the input. */
if (output_filename == NULL
|| filename_cmp (input_filename, output_filename) == 0)
- tmpname = make_tempname (input_filename);
+ tmpname = make_tempname (input_filename, &tmpfd);
else
tmpname = output_filename;
@@ -5903,7 +5916,8 @@ copy_main (int argc, char *argv[])
fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"),
input_filename, strerror (errno));
- copy_file (input_filename, tmpname, input_target, output_target, input_arch);
+ copy_file (input_filename, tmpname, tmpfd, input_target, output_target,
+ input_arch);
if (status == 0)
{
if (preserve_dates)
--
2.27.0

View File

@ -1,6 +1,6 @@
diff -rupN --no-dereference binutils-2.32/gold/target-reloc.h binutils-2.32-new/gold/target-reloc.h
--- binutils-2.32/gold/target-reloc.h 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/gold/target-reloc.h 2019-11-19 20:47:02.632594671 +0100
diff -rupN --no-dereference binutils-2.34/gold/target-reloc.h binutils-2.34-new/gold/target-reloc.h
--- binutils-2.34/gold/target-reloc.h 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/gold/target-reloc.h 2020-12-18 02:57:18.369041902 +0100
@@ -136,6 +136,7 @@ class Default_comdat_behavior
if (Layout::is_debug_info_section(name))
return CB_PRETEND;

View File

@ -1,7 +1,7 @@
diff -rupN --no-dereference binutils-2.32/gold/layout.cc binutils-2.32-new/gold/layout.cc
--- binutils-2.32/gold/layout.cc 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/gold/layout.cc 2019-11-19 20:47:10.054636935 +0100
@@ -868,6 +868,7 @@ Layout::get_output_section(const char* n
diff -rupN --no-dereference binutils-2.34/gold/layout.cc binutils-2.34-new/gold/layout.cc
--- binutils-2.34/gold/layout.cc 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/gold/layout.cc 2020-12-18 02:57:21.401031221 +0100
@@ -869,6 +869,7 @@ Layout::get_output_section(const char* n
&& (same_name->flags() & elfcpp::SHF_TLS) == 0)
os = same_name;
}
@ -9,7 +9,7 @@ diff -rupN --no-dereference binutils-2.32/gold/layout.cc binutils-2.32-new/gold/
else if ((flags & elfcpp::SHF_TLS) == 0)
{
elfcpp::Elf_Xword zero_flags = 0;
@@ -878,6 +879,7 @@ Layout::get_output_section(const char* n
@@ -879,6 +880,7 @@ Layout::get_output_section(const char* n
if (p != this->section_name_map_.end())
os = p->second;
}
@ -17,10 +17,10 @@ diff -rupN --no-dereference binutils-2.32/gold/layout.cc binutils-2.32-new/gold/
}
if (os == NULL)
diff -rupN --no-dereference binutils-2.32/gold/object.cc binutils-2.32-new/gold/object.cc
--- binutils-2.32/gold/object.cc 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/gold/object.cc 2019-11-19 20:47:10.054636935 +0100
@@ -1644,6 +1644,13 @@ Sized_relobj_file<size, big_endian>::do_
diff -rupN --no-dereference binutils-2.34/gold/object.cc binutils-2.34-new/gold/object.cc
--- binutils-2.34/gold/object.cc 2020-01-18 14:55:48.000000000 +0100
+++ binutils-2.34-new/gold/object.cc 2020-12-18 02:57:21.402031218 +0100
@@ -1656,6 +1656,13 @@ Sized_relobj_file<size, big_endian>::do_
omit[i] = true;
}

View File

@ -1,58 +0,0 @@
diff -rupN --no-dereference binutils-2.32/binutils/objcopy.c binutils-2.32-new/binutils/objcopy.c
--- binutils-2.32/binutils/objcopy.c 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-new/binutils/objcopy.c 2019-11-19 20:47:13.738658442 +0100
@@ -1988,7 +1988,6 @@ merge_gnu_build_notes (bfd * abfd, asect
unsigned long previous_open_end = 0;
long relsize;
-
relsize = bfd_get_reloc_upper_bound (abfd, sec);
if (relsize > 0)
{
@@ -2005,7 +2004,8 @@ merge_gnu_build_notes (bfd * abfd, asect
}
/* Make a copy of the notes and convert to our internal format.
- Minimum size of a note is 12 bytes. */
+ Minimum size of a note is 12 bytes. Also locate the version
+ notes and check them. */
pnote = pnotes = (objcopy_internal_note *) xcalloc ((size / 12), sizeof (* pnote));
while (remain >= 12)
{
@@ -2174,12 +2174,10 @@ merge_gnu_build_notes (bfd * abfd, asect
attribute_type_byte = version_1_seen ? 1 : 3;
val_start = attribute_type_byte + 1;
- /* The first note should be the first version note. */
- if (pnotes[0].note.namedata[attribute_type_byte] != GNU_BUILD_ATTRIBUTE_VERSION)
- {
- err = _("bad GNU build attribute notes: first note not version note");
- goto done;
- }
+ /* We used to require that the first note be a version note,
+ but this is no longer enforced. Due to the problems with
+ linking sections with the same name (eg .gnu.build.note.hot)
+ we cannot guarantee that the first note will be a version note. */
/* Now merge the notes. The rules are:
1. Preserve the ordering of the notes.
@@ -2196,8 +2194,9 @@ merge_gnu_build_notes (bfd * abfd, asect
with a non-empty description field must also be preserved *OR* the
description field of the note must be changed to contain the starting
address to which it refers.
- 6. Notes with the same start and end address can be deleted. */
- for (pnote = pnotes + 1; pnote < pnotes_end; pnote ++)
+ 6. Notes with the same start and end address can be deleted.
+ 7. FIXME: Elminate duplicate version notes - even function specific ones ? */
+ for (pnote = pnotes; pnote < pnotes_end; pnote ++)
{
int note_type;
objcopy_internal_note * back;
@@ -2225,7 +2224,6 @@ merge_gnu_build_notes (bfd * abfd, asect
&& back->note.namesz == pnote->note.namesz
&& memcmp (back->note.namedata, pnote->note.namedata, pnote->note.namesz) == 0)
{
- fprintf (stderr, "DUP FUNXC\n");
duplicate_found = TRUE;
pnote->note.type = 0;
break;

View File

@ -0,0 +1,126 @@
diff -rupN --no-dereference binutils-2.34/binutils/readelf.c binutils-2.34-new/binutils/readelf.c
--- binutils-2.34/binutils/readelf.c 2020-12-18 02:57:17.359045461 +0100
+++ binutils-2.34-new/binutils/readelf.c 2020-12-18 02:57:22.432027590 +0100
@@ -6714,15 +6714,18 @@ process_section_headers (Filedata * file
{
Elf_Internal_Chdr chdr;
- (void) get_compression_header (&chdr, buf, sizeof (buf));
-
- if (chdr.ch_type == ELFCOMPRESS_ZLIB)
- printf (" ZLIB, ");
+ if (get_compression_header (&chdr, buf, sizeof (buf)) == 0)
+ printf (_(" [<corrupt>]\n"));
else
- printf (_(" [<unknown>: 0x%x], "),
- chdr.ch_type);
- print_vma (chdr.ch_size, LONG_HEX);
- printf (", %lu\n", (unsigned long) chdr.ch_addralign);
+ {
+ if (chdr.ch_type == ELFCOMPRESS_ZLIB)
+ printf (" ZLIB, ");
+ else
+ printf (_(" [<unknown>: 0x%x], "),
+ chdr.ch_type);
+ print_vma (chdr.ch_size, LONG_HEX);
+ printf (", %lu\n", (unsigned long) chdr.ch_addralign);
+ }
}
}
}
@@ -13679,11 +13682,16 @@ dump_section_as_strings (Elf_Internal_Sh
= get_compression_header (& chdr, (unsigned char *) start,
num_bytes);
+ if (compression_header_size == 0)
+ /* An error message will have already been generated
+ by get_compression_header. */
+ goto error_out;
+
if (chdr.ch_type != ELFCOMPRESS_ZLIB)
{
warn (_("section '%s' has unsupported compress type: %d\n"),
printable_section_name (filedata, section), chdr.ch_type);
- return FALSE;
+ goto error_out;
}
uncompressed_size = chdr.ch_size;
start += compression_header_size;
@@ -13715,7 +13723,7 @@ dump_section_as_strings (Elf_Internal_Sh
{
error (_("Unable to decompress section %s\n"),
printable_section_name (filedata, section));
- return FALSE;
+ goto error_out;
}
}
else
@@ -13785,6 +13793,10 @@ dump_section_as_strings (Elf_Internal_Sh
putchar ('\n');
return TRUE;
+
+ error_out:
+ free (real_start);
+ return FALSE;
}
static bfd_boolean
@@ -13797,7 +13809,7 @@ dump_section_as_bytes (Elf_Internal_Shdr
bfd_size_type section_size;
bfd_vma addr;
unsigned char * data;
- unsigned char * real_start;
+ unsigned char * real_start = NULL;
unsigned char * start;
real_start = start = (unsigned char *) get_section_contents (section, filedata);
@@ -13820,11 +13832,16 @@ dump_section_as_bytes (Elf_Internal_Shdr
unsigned int compression_header_size
= get_compression_header (& chdr, start, section_size);
+ if (compression_header_size == 0)
+ /* An error message will have already been generated
+ by get_compression_header. */
+ goto error_out;
+
if (chdr.ch_type != ELFCOMPRESS_ZLIB)
{
warn (_("section '%s' has unsupported compress type: %d\n"),
printable_section_name (filedata, section), chdr.ch_type);
- return FALSE;
+ goto error_out;
}
uncompressed_size = chdr.ch_size;
start += compression_header_size;
@@ -13859,7 +13876,7 @@ dump_section_as_bytes (Elf_Internal_Shdr
error (_("Unable to decompress section %s\n"),
printable_section_name (filedata, section));
/* FIXME: Print the section anyway ? */
- return FALSE;
+ goto error_out;
}
}
else
@@ -13939,6 +13956,10 @@ dump_section_as_bytes (Elf_Internal_Shdr
putchar ('\n');
return TRUE;
+
+ error_out:
+ free (real_start);
+ return FALSE;
}
static ctf_sect_t *
@@ -14149,6 +14170,10 @@ load_specific_debug_section (enum dwarf_
}
compression_header_size = get_compression_header (&chdr, start, size);
+ if (compression_header_size == 0)
+ /* An error message will have already been generated
+ by get_compression_header. */
+ return FALSE;
if (chdr.ch_type != ELFCOMPRESS_ZLIB)
{

View File

@ -1,7 +1,7 @@
diff -rupN --no-dereference binutils-2.32/binutils/readelf.c binutils-2.32-new/binutils/readelf.c
--- binutils-2.32/binutils/readelf.c 2019-11-19 20:47:01.146586379 +0100
+++ binutils-2.32-new/binutils/readelf.c 2019-11-19 20:47:01.152586412 +0100
@@ -11321,12 +11321,14 @@ print_dynamic_symbol (Filedata * filedat
diff -rupN --no-dereference binutils-2.34/binutils/readelf.c binutils-2.34-new/binutils/readelf.c
--- binutils-2.34/binutils/readelf.c 2020-12-18 02:57:16.348049023 +0100
+++ binutils-2.34-new/binutils/readelf.c 2020-12-18 02:57:16.353049005 +0100
@@ -11496,12 +11496,14 @@ print_dynamic_symbol (Filedata * filedat
unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
printf (" %-7s", get_symbol_visibility (vis));
@ -16,7 +16,7 @@ diff -rupN --no-dereference binutils-2.32/binutils/readelf.c binutils-2.32-new/b
}
printf (" %3.3s ", get_symbol_index_type (filedata, psym->st_shndx));
@@ -11334,6 +11336,15 @@ print_dynamic_symbol (Filedata * filedat
@@ -11509,6 +11511,15 @@ print_dynamic_symbol (Filedata * filedat
print_symbol (25, GET_DYNAMIC_NAME (psym->st_name));
else
printf (_(" <corrupt: %14ld>"), psym->st_name);
@ -32,7 +32,7 @@ diff -rupN --no-dereference binutils-2.32/binutils/readelf.c binutils-2.32-new/b
putchar ('\n');
}
@@ -11842,11 +11853,13 @@ process_symbol_table (Filedata * filedat
@@ -12043,11 +12054,13 @@ process_symbol_table (Filedata * filedat
unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
printf (" %-7s", get_symbol_visibility (vis));
@ -46,7 +46,7 @@ diff -rupN --no-dereference binutils-2.32/binutils/readelf.c binutils-2.32-new/b
}
printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx));
print_symbol (25, psym->st_name < strtab_size
@@ -11865,7 +11878,15 @@ process_symbol_table (Filedata * filedat
@@ -12066,7 +12079,15 @@ process_symbol_table (Filedata * filedat
printf (sym_info == symbol_hidden ? "@%s" : "@@%s",
version_string);
}

View File

@ -1,107 +0,0 @@
diff -rupN --no-dereference binutils-2.32/bfd/elf-properties.c binutils-2.32-new/bfd/elf-properties.c
--- binutils-2.32/bfd/elf-properties.c 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/elf-properties.c 2019-11-19 20:47:13.003654121 +0100
@@ -322,12 +322,10 @@ elf_merge_gnu_property_list (struct bfd_
(bfd_vma) p->property.pr_type, first_pbfd, abfd);
}
}
- else
- {
- /* Remove this property. */
- *lastp = p->next;
- continue;
- }
+
+ /* Remove this property. */
+ *lastp = p->next;
+ continue;
}
else if (number_p)
{
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/pr24721a.s binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721a.s
--- binutils-2.32/ld/testsuite/ld-x86-64/pr24721a.s 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721a.s 2019-11-19 20:47:13.004654127 +0100
@@ -0,0 +1,34 @@
+ .text
+ .globl foo
+ .type foo,@function
+ .p2align 4
+foo:
+ ret
+
+ .section ".note.gnu.property", "a"
+.ifdef __64_bit__
+ .p2align 3
+.else
+ .p2align 2
+.endif
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long 5 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+.ifdef __64_bit__
+ .p2align 3
+.else
+ .p2align 2
+.endif
+2: .long 0xc0000002 /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long 0x1
+4:
+.ifdef __64_bit__
+ .p2align 3
+.else
+ .p2align 2
+.endif
+5:
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/pr24721b.s binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721b.s
--- binutils-2.32/ld/testsuite/ld-x86-64/pr24721b.s 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721b.s 2019-11-19 20:47:13.004654127 +0100
@@ -0,0 +1,6 @@
+ .text
+ .globl bar
+ .type bar,@function
+ .p2align 4
+bar:
+ ret
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/pr24721.d binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721.d
--- binutils-2.32/ld/testsuite/ld-x86-64/pr24721.d 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721.d 2019-11-19 20:47:13.004654127 +0100
@@ -0,0 +1,6 @@
+#source: pr24721a.s
+#source: pr24721b.s
+#as: --64 -defsym __64_bit__=1 -mx86-used-note=no
+#ld: -r -melf_x86_64 -Map tmpdir/pr24721.map
+#readelf: -n
+#map: pr24721.map
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/pr24721.map binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721.map
--- binutils-2.32/ld/testsuite/ld-x86-64/pr24721.map 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721.map 2019-11-19 20:47:13.004654127 +0100
@@ -0,0 +1,3 @@
+#...
+Removed property 0xc0000002 to merge tmpdir/pr24721a.o \(0x1\) and tmpdir/pr24721b.o \(not found\)
+#pass
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/pr24721-x32.d binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721-x32.d
--- binutils-2.32/ld/testsuite/ld-x86-64/pr24721-x32.d 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.32-new/ld/testsuite/ld-x86-64/pr24721-x32.d 2019-11-19 20:47:13.003654121 +0100
@@ -0,0 +1,6 @@
+#source: pr24721a.s
+#source: pr24721b.s
+#as: --x32 -mx86-used-note=no
+#ld: -r -m elf32_x86_64 -Map tmpdir/pr24721.map
+#readelf: -n
+#map: pr24721.map
diff -rupN --no-dereference binutils-2.32/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.32-new/ld/testsuite/ld-x86-64/x86-64.exp
--- binutils-2.32/ld/testsuite/ld-x86-64/x86-64.exp 2019-11-19 20:47:04.837607078 +0100
+++ binutils-2.32-new/ld/testsuite/ld-x86-64/x86-64.exp 2019-11-19 20:47:13.004654127 +0100
@@ -424,6 +424,8 @@ run_dump_test "pr23486d-x32"
run_dump_test "pr23854"
run_dump_test "pr23930"
run_dump_test "pr23930-x32"
+run_dump_test "pr24721"
+run_dump_test "pr24721-x32"
if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} {
return

View File

@ -1,7 +1,7 @@
diff -rupN --no-dereference binutils-2.32/bfd/elf.c binutils-2.32-new/bfd/elf.c
--- binutils-2.32/bfd/elf.c 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/elf.c 2019-11-19 20:47:03.372598821 +0100
@@ -831,7 +831,13 @@ setup_group (bfd *abfd, Elf_Internal_Shd
diff -rupN --no-dereference binutils-2.34/bfd/elf.c binutils-2.34-new/bfd/elf.c
--- binutils-2.34/bfd/elf.c 2020-01-30 08:15:56.000000000 +0100
+++ binutils-2.34-new/bfd/elf.c 2020-12-18 02:57:19.376038355 +0100
@@ -838,7 +838,13 @@ setup_group (bfd *abfd, Elf_Internal_Shd
}
}
@ -16,7 +16,7 @@ diff -rupN --no-dereference binutils-2.32/bfd/elf.c binutils-2.32-new/bfd/elf.c
{
/* xgettext:c-format */
_bfd_error_handler (_("%pB: no group info for section '%pA'"),
@@ -937,7 +943,8 @@ _bfd_elf_setup_sections (bfd *abfd)
@@ -944,7 +950,8 @@ _bfd_elf_setup_sections (bfd *abfd)
else if (idx->shdr->bfd_section)
elf_sec_group (idx->shdr->bfd_section) = shdr->bfd_section;
else if (idx->shdr->sh_type != SHT_RELA

View File

@ -0,0 +1,834 @@
From f09382330535adbc565b49ed1844cfeaeadb8b7c Mon Sep 17 00:00:00 2001
From: yinhongchang <yinhongchang@kylinsec.com.cn>
Date: Sun, 4 Feb 2024 15:56:46 +0800
Subject: [PATCH] binutils update autoconf version to 2.71
---
README-maintainer-mode | 2 +-
bfd/aclocal.m4 | 4 ++--
bfd/configure | 10 +++++-----
binutils/aclocal.m4 | 4 ++--
binutils/configure | 10 +++++-----
config/ChangeLog | 2 +-
config/override.m4 | 2 +-
configure | 10 +++++-----
etc/configure | 10 +++++-----
gas/aclocal.m4 | 4 ++--
gas/configure | 10 +++++-----
gold/aclocal.m4 | 4 ++--
gold/configure | 10 +++++-----
gprof/aclocal.m4 | 4 ++--
gprof/configure | 10 +++++-----
intl/configure | 10 +++++-----
ld/aclocal.m4 | 4 ++--
ld/configure | 10 +++++-----
libctf/aclocal.m4 | 4 ++--
libctf/configure | 10 +++++-----
libiberty/configure | 10 +++++-----
opcodes/aclocal.m4 | 4 ++--
opcodes/configure | 10 +++++-----
zlib/aclocal.m4 | 4 ++--
zlib/configure | 10 +++++-----
25 files changed, 86 insertions(+), 86 deletions(-)
diff --git a/README-maintainer-mode b/README-maintainer-mode
index 54c370db..bc0c520d 100644
--- a/README-maintainer-mode
+++ b/README-maintainer-mode
@@ -11,7 +11,7 @@ find the sources for these in the respective upstream directories:
ftp://ftp.gnu.org/gnu/gettext
The required versions of the tools for this tree are
- autoconf 2.69
+ autoconf 2.71
automake 1.15.1
libtool 2.2.6
gettext 0.14.5
diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4
index 4a6a47ca..f55d3eb2 100644
--- a/bfd/aclocal.m4
+++ b/bfd/aclocal.m4
@@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
diff --git a/bfd/configure b/bfd/configure
index 9cba0719..fa362606 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for bfd 2.34.
+# Generated by GNU Autoconf 2.71 for bfd 2.34.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1590,7 +1590,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bfd configure 2.34
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -2238,7 +2238,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bfd $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -16954,7 +16954,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by bfd $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -17020,7 +17020,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
bfd config.status 2.34
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/binutils/aclocal.m4 b/binutils/aclocal.m4
index 4fa32fff..837e590f 100644
--- a/binutils/aclocal.m4
+++ b/binutils/aclocal.m4
@@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
diff --git a/binutils/configure b/binutils/configure
index 7880de68..c352d656 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for binutils 2.34.
+# Generated by GNU Autoconf 2.71 for binutils 2.34.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1575,7 +1575,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
binutils configure 2.34
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -2223,7 +2223,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by binutils $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -15802,7 +15802,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by binutils $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -15868,7 +15868,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
binutils config.status 2.34
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/config/ChangeLog b/config/ChangeLog
index 19fc6cd5..788ede19 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -33,7 +33,7 @@
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
- * override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.
+ * override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.71.
2018-06-18 Simon Marchi <simon.marchi@ericsson.com>
diff --git a/config/override.m4 b/config/override.m4
index d3e815bb..7b4a47ba 100644
--- a/config/override.m4
+++ b/config/override.m4
@@ -29,7 +29,7 @@ m4_copy_force([_AC_PREREQ], [AC_PREREQ])
dnl Ensure exactly this Autoconf version is used
m4_ifndef([_GCC_AUTOCONF_VERSION],
- [m4_define([_GCC_AUTOCONF_VERSION], [2.69])])
+ [m4_define([_GCC_AUTOCONF_VERSION], [2.71])])
dnl Test for the exact version when AC_INIT is expanded.
dnl This allows to update the tree in steps (for testing)
diff --git a/configure b/configure
index 9f4d0b91..407ae27a 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69.
+# Generated by GNU Autoconf 2.71.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1745,7 +1745,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
configure
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1976,7 +1976,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -15370,7 +15370,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -15423,7 +15423,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/etc/configure b/etc/configure
index 60a8fecc..9beca587 100755
--- a/etc/configure
+++ b/etc/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69.
+# Generated by GNU Autoconf 2.71.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1309,7 +1309,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
configure
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1326,7 +1326,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -2362,7 +2362,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -2415,7 +2415,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/gas/aclocal.m4 b/gas/aclocal.m4
index a9f9f5cc..2c63a648 100644
--- a/gas/aclocal.m4
+++ b/gas/aclocal.m4
@@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
diff --git a/gas/configure b/gas/configure
index 148af892..e13306b0 100755
--- a/gas/configure
+++ b/gas/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gas 2.34.
+# Generated by GNU Autoconf 2.71 for gas 2.34.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1577,7 +1577,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gas configure 2.34
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -2042,7 +2042,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by gas $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -15706,7 +15706,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by gas $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -15772,7 +15772,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
gas config.status 2.34
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/gold/aclocal.m4 b/gold/aclocal.m4
index 303c4cc5..1f183026 100644
--- a/gold/aclocal.m4
+++ b/gold/aclocal.m4
@@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
diff --git a/gold/configure b/gold/configure
index 474c69a1..c8418e4d 100755
--- a/gold/configure
+++ b/gold/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gold 0.1.
+# Generated by GNU Autoconf 2.71 for gold 0.1.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1598,7 +1598,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gold configure 0.1
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -2330,7 +2330,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by gold $as_me 0.1, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -10851,7 +10851,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by gold $as_me 0.1, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -10917,7 +10917,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
gold config.status 0.1
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/gprof/aclocal.m4 b/gprof/aclocal.m4
index 957655a8..92a3626e 100644
--- a/gprof/aclocal.m4
+++ b/gprof/aclocal.m4
@@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
diff --git a/gprof/configure b/gprof/configure
index 727cd725..f09af2f1 100755
--- a/gprof/configure
+++ b/gprof/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gprof 2.34.
+# Generated by GNU Autoconf 2.71 for gprof 2.34.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1520,7 +1520,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gprof configure 2.34
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1885,7 +1885,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by gprof $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -13087,7 +13087,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by gprof $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -13153,7 +13153,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
gprof config.status 2.34
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/intl/configure b/intl/configure
index 2f359931..412498b3 100755
--- a/intl/configure
+++ b/intl/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69.
+# Generated by GNU Autoconf 2.71.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1434,7 +1434,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
configure
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1853,7 +1853,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -7266,7 +7266,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -7332,7 +7332,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/ld/aclocal.m4 b/ld/aclocal.m4
index 7df8bf68..4c81116c 100644
--- a/ld/aclocal.m4
+++ b/ld/aclocal.m4
@@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
diff --git a/ld/configure b/ld/configure
index 27b43415..1b66413c 100755
--- a/ld/configure
+++ b/ld/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ld 2.34.
+# Generated by GNU Autoconf 2.71 for ld 2.34.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1602,7 +1602,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
ld configure 2.34
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -2317,7 +2317,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ld $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -18255,7 +18255,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by ld $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -18321,7 +18321,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
ld config.status 2.34
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/libctf/aclocal.m4 b/libctf/aclocal.m4
index 15d96cd6..9a3441a1 100644
--- a/libctf/aclocal.m4
+++ b/libctf/aclocal.m4
@@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
diff --git a/libctf/configure b/libctf/configure
index e5493b31..5d2f3623 100755
--- a/libctf/configure
+++ b/libctf/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libctf library 1.2.0-pre.
+# Generated by GNU Autoconf 2.71 for libctf library 1.2.0-pre.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1515,7 +1515,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libctf library configure 1.2.0-pre
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1926,7 +1926,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libctf library $as_me 1.2.0-pre, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -13772,7 +13772,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by libctf library $as_me 1.2.0-pre, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -13838,7 +13838,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libctf library config.status 1.2.0-pre
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/libiberty/configure b/libiberty/configure
index 7a34dabe..80230b0a 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69.
+# Generated by GNU Autoconf 2.71.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1423,7 +1423,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
configure
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -2103,7 +2103,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -7983,7 +7983,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -8049,7 +8049,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/opcodes/aclocal.m4 b/opcodes/aclocal.m4
index 36b13275..9b42574b 100644
--- a/opcodes/aclocal.m4
+++ b/opcodes/aclocal.m4
@@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
diff --git a/opcodes/configure b/opcodes/configure
index 6bae87d2..87084d18 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for opcodes 2.34.
+# Generated by GNU Autoconf 2.71 for opcodes 2.34.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1540,7 +1540,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
opcodes configure 2.34
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1951,7 +1951,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by opcodes $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -13534,7 +13534,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by opcodes $as_me 2.34, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -13600,7 +13600,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
opcodes config.status 2.34
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/zlib/aclocal.m4 b/zlib/aclocal.m4
index e5eed57b..fde016f6 100644
--- a/zlib/aclocal.m4
+++ b/zlib/aclocal.m4
@@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
diff --git a/zlib/configure b/zlib/configure
index 041cbdbf..67f6cc55 100755
--- a/zlib/configure
+++ b/zlib/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for zlib 1.1.4.
+# Generated by GNU Autoconf 2.71 for zlib 1.1.4.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -1506,7 +1506,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
zlib configure 1.1.4
-generated by GNU Autoconf 2.69
+generated by GNU Autoconf 2.71
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1874,7 +1874,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by zlib $as_me 1.1.4, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
$ $0 $@
@@ -12051,7 +12051,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by zlib $as_me 1.1.4, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -12108,7 +12108,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
zlib config.status 1.1.4
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
--
2.27.0

View File

@ -1,36 +0,0 @@
diff -rupN --no-dereference binutils-2.32/bfd/coffgen.c binutils-2.32-new/bfd/coffgen.c
--- binutils-2.32/bfd/coffgen.c 2019-11-19 20:47:08.571628378 +0100
+++ binutils-2.32-new/bfd/coffgen.c 2019-11-19 20:47:17.460680520 +0100
@@ -2639,6 +2639,9 @@ _bfd_coff_section_already_linked (bfd *a
struct bfd_section_already_linked_hash_entry *already_linked_list;
struct coff_comdat_info *s_comdat;
+ if (sec->output_section == bfd_abs_section_ptr)
+ return FALSE;
+
flags = sec->flags;
if ((flags & SEC_LINK_ONCE) == 0)
return FALSE;
diff -rupN --no-dereference binutils-2.32/bfd/cofflink.c binutils-2.32-new/bfd/cofflink.c
--- binutils-2.32/bfd/cofflink.c 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-new/bfd/cofflink.c 2019-11-19 20:47:17.460680520 +0100
@@ -310,7 +310,9 @@ coff_link_add_symbols (bfd *abfd,
case COFF_SYMBOL_GLOBAL:
flags = BSF_EXPORT | BSF_GLOBAL;
section = coff_section_from_bfd_index (abfd, sym.n_scnum);
- if (! obj_pe (abfd))
+ if (discarded_section (section))
+ section = bfd_und_section_ptr;
+ else if (! obj_pe (abfd))
value -= section->vma;
break;
@@ -327,6 +329,8 @@ coff_link_add_symbols (bfd *abfd,
case COFF_SYMBOL_PE_SECTION:
flags = BSF_SECTION_SYM | BSF_GLOBAL;
section = coff_section_from_bfd_index (abfd, sym.n_scnum);
+ if (discarded_section (section))
+ section = bfd_und_section_ptr;
break;
}

View File

@ -0,0 +1,39 @@
diff -rupN --no-dereference binutils-2.34/bfd/peXXigen.c binutils-2.34-new/bfd/peXXigen.c
--- binutils-2.34/bfd/peXXigen.c 2020-01-18 14:55:47.000000000 +0100
+++ binutils-2.34-new/bfd/peXXigen.c 2020-12-18 02:57:24.508020278 +0100
@@ -177,25 +177,25 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void *
int unused_section_number = 0;
asection *sec;
flagword flags;
+ size_t name_len;
+ char *sec_name;
for (sec = abfd->sections; sec; sec = sec->next)
if (unused_section_number <= sec->target_index)
unused_section_number = sec->target_index + 1;
- if (name == namebuf)
+ name_len = strlen (name) + 1;
+ sec_name = bfd_alloc (abfd, name_len);
+ if (sec_name == NULL)
{
- name = (const char *) bfd_alloc (abfd, strlen (namebuf) + 1);
- if (name == NULL)
- {
- _bfd_error_handler (_("%pB: out of memory creating name for empty section"),
- abfd);
- return;
- }
- strcpy ((char *) name, namebuf);
+ _bfd_error_handler (_("%pB: out of memory creating name "
+ "for empty section"), abfd);
+ return;
}
+ memcpy (sec_name, name, name_len);
flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_DATA | SEC_LOAD;
- sec = bfd_make_section_anyway_with_flags (abfd, name, flags);
+ sec = bfd_make_section_anyway_with_flags (abfd, sec_name, flags);
if (sec == NULL)
{
_bfd_error_handler (_("%pB: unable to create fake empty section"),

View File

@ -0,0 +1,12 @@
diff -rupN --no-dereference binutils-2.34/binutils/debug.c binutils-2.34-new/binutils/debug.c
--- binutils-2.34/binutils/debug.c 2020-01-18 14:55:47.000000000 +0100
+++ binutils-2.34-new/binutils/debug.c 2020-12-18 02:57:25.423017056 +0100
@@ -3277,6 +3277,8 @@ debug_class_type_samep (struct debug_han
names, since that sometimes fails in the presence of
typedefs and we really don't care. */
if (strcmp (f1->name, f2->name) != 0
+ || f1->type == NULL
+ || f2->type == NULL
|| ! debug_type_samep (info,
debug_get_real_type ((void *) info,
f1->type, NULL),

View File

@ -1,8 +1,8 @@
%global run_testsuite 1
Name: mingw-binutils
Version: 2.32
Release: 7%{?dist}
Version: 2.34
Release: 9
Summary: Cross-compiled version of binutils for Win32 and Win64 environments
License: GPLv2+ and LGPLv2+ and GPLv3+ and LGPLv3+
@ -79,86 +79,42 @@ Patch12: binutils-special-sections-in-groups.patch
# Lifetime: Fixed in 2.33 (possibly)
Patch13: binutils-fix-testsuite-failures.patch
# Purpose: Improve objdump's handling of corrupt input files.
# Lifetime: Fixed in 2.33
Patch14: binutils-CVE-2019-9073.patch
# Purpose: Stop illegal memory access parsing corrupt PE files.
# Lifetime: Fixed in 2.33
Patch15: binutils-CVE-2019-9074.patch
# Purpose: Stop illegal memory access parsing corrupt archives.
# Lifetime: Fixed in 2.33
Patch16: binutils-CVE-2019-9075.patch
# Purpose: Stop illegal memory access parsing a corrupt MIPS binary.
# Lifetime: Fixed in 2.33
Patch17: binutils-CVE-2019-9077.patch
# Purpose: Stop a seg-fault when disassembling an EFI binary.
# Lifetime: Fixed in 2.33
Patch18: binutils-disassembling-efi-files.patch
# Purpose: Fix a stack exhaustion problem in libiberty's name demangling code.
# Lifetime: Fixed in 2.33
Patch19: binutils-CVE-2019-9071.patch
# Purpose: Have the GOLD linker for AArch64 generate PLT entries for MOVW_ABS
# relocations if necessary.
# Lifetime: Fixed in 2.33
Patch20: binutils-aarch64-gold-PLT-for-MOVW_ABS.patch
# Purpose: Stop gold from aborting when input sections with the same name
# have different flags.
# Lifetime: Fixed in 2.33 (probably)
Patch21: binutils-gold-mismatched-section-flags.patch
# Lifetime: Fixed in 2.35 (maybe)
Patch14: binutils-gold-mismatched-section-flags.patch
# Purpose: Corrcect a memory corruption when generating relocs for build
# notes in the assembler.
# Lifetime: Fixed in 2.33
Patch22: binutils-gas-build-note-relocs.patch
# Purpose: Fix a potential use of an initialised field by readelf.
# Lifetime: Fixed in 2.35
Patch15: binutils-readelf-compression-header-size.patch
# Purpose: Stop the BFD library from issueing warning messages about allocated
# sections being found outside of loadable segments, if they are
# found inside debuginfo files.
# Lifetime: Fixed in 2.33
Patch23: binutils-do-not-warn-about-debuginfo-files.patch
# Purpose: Add a check to the GOLD linker for a corrupt input file
# with a fuzzed section offset.
# Lifetime: Fixed in 2.35 (maybe)
Patch16: binutils-CVE-2019-1010204.patch
# Backport fix for CVE-2020-16592
# https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7ecb51549ab1ec22aba5aaf34b70323cf0b8509a
Patch17: binutils_CVE-2020-16592.patch
# Backport fix for CVE-2020-16598
# https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ca3f923f82a079dcf441419f4a50a50f8b4b33c2
Patch18: binutils_CVE-2020-16598.patch
# Purpose: Stops the linker from merging section groups with different exclusion flags.
# Lifetime: Fixed in 2.33
Patch24: binutils-do-not-merge-differing-SHF_EXCLUDE-groups.patch
# Backport fixes for CVE-2021-20197
Patch19: binutils-gdb.git-365f5fb6d0f0da83817431a275e99e6f6babbe04.patch
Patch20: binutils-gdb.git-1a1c3b4cc17687091cff5a368bd6f13742bcfdf8.patch
Patch21: binutils-gdb.git-014cc7f849e8209623fc99264814bce7b3b6faf2.patch
# Purpose: Fix -Map and property merging
# Lifetime: Fixed in 2.33
Patch25: binutils-rh1736114.patch
# Purpose: Change objcopy/strip so that they do not complain if the
# first note in a sequence of build notes is not a version note.
# Lifetime: Fixed in 2.33
Patch26: binutils-objcopy-gnu-build-version-notes.patch
# Purpose: Add a check to the GOLD linker for a corrupt input file
# with a fuzzed section offset.
# Lifetime: Fixed in 2.33
Patch27: binutils-CVE-2019-1010204.patch
# Purpose: Add check to libiberty library in order to prevent an integer overflow in the gold linker.
# Lifetime: Fixed in 2.33
Patch28: binutils-CVE-2019-14250.patch
# Purpose: Add check to readelf in order to prevent an integer overflow.
# Lifetime: Fixed in 2.33
Patch29: binutils-CVE-2019-14444.patch
# Backport fix for CVE-2021-3487
# https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=647cebce12a6b0a26960220caff96ff38978cf24
Patch22: CVE-2021-3487.patch
# update Autoconf version to 2.71
Patch23: binutils-update-autoconf-version-to-2.71.patch
### MINGW specific patches
# Backport https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=999d6dff80fab12d22c2a8d91923db6bde7fb3e5
# Fixes "too many open files" when linking libLLVM.dll
Patch100: 0001-Plugin-target-handling.patch
# Backport https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=patch;h=2219ae0b0ebe14373850b000c2abaa31dab1d741
# Fixes an LTO issue (#1475237)
Patch101: binutils_24267.patch
Patch102: binutils-config.patch
BuildRequires: make
BuildRequires: gcc
BuildRequires: flex
BuildRequires: bison
@ -171,6 +127,7 @@ BuildRequires: dejagnu
BuildRequires: sharutils
%endif
Provides: bundled(libiberty)
BuildRequires: autoconf, automake
%description
@ -210,11 +167,30 @@ understand Windows executables and DLLs.
%prep
%autosetup -p1 -n binutils-%{version}
# See Patch02
sed -i -e 's/%''{release}/%{release}/g' bfd/Makefile{.am,.in}
%build
# Dependencies are not set up to rebuild the configure files
# in the subdirectories. So we just rebuild the ones we care
# about
pushd libiberty
autoconf
popd
pushd intl
autoconf
popd
# We call configure directly rather than via macros, thus if
# we are using LTO, we have to manually fix the broken configure
# scripts
#[ %{_lto_cflags}x != x ] && %{_fix_broken_configure_for_lto}
mkdir build_win32
pushd build_win32
CFLAGS="$RPM_OPT_FLAGS" \
CFLAGS="%{optflags}" \
../configure \
--build=%_build --host=%_host \
--target=%{mingw32_target} \
@ -227,12 +203,12 @@ CFLAGS="$RPM_OPT_FLAGS" \
--mandir=%{_mandir} \
--infodir=%{_infodir}
make all %{?_smp_mflags}
%make_build
popd
mkdir build_win64
pushd build_win64
CFLAGS="$RPM_OPT_FLAGS" \
CFLAGS="%{optflags}" \
../configure \
--build=%_build --host=%_host \
--target=%{mingw64_target} \
@ -245,13 +221,13 @@ CFLAGS="$RPM_OPT_FLAGS" \
--mandir=%{_mandir} \
--infodir=%{_infodir}
make all %{?_smp_mflags}
%make_build
popd
# Create multilib versions for the tools strip, objdump nm, and objcopy
mkdir build_multilib
pushd build_multilib
CFLAGS="$RPM_OPT_FLAGS" \
CFLAGS="%{optflags}" \
../configure \
--build=%_build --host=%_host \
--target=%{mingw64_target} \
@ -265,7 +241,7 @@ CFLAGS="$RPM_OPT_FLAGS" \
--mandir=%{_mandir} \
--infodir=%{_infodir}
make %{?_smp_mflags}
%make_build
popd
@ -322,7 +298,7 @@ rm -rf $RPM_BUILD_ROOT/multilib
%files -n mingw-binutils-generic
%doc COPYING
%license COPYING
%{_mandir}/man1/*
%{_bindir}/%{mingw_strip}
%{_bindir}/%{mingw_objdump}
@ -399,5 +375,242 @@ rm -rf $RPM_BUILD_ROOT/multilib
%changelog
* Thu Oct 08 2020 Zhiyi Weng <zhiyi@iscas.ac.cn> - 2.32-7
- Initial version
* Sun Feb 4 2024 yinhongchang <yinhongchang@kylinsec.com.cn> - 2.34-9
- update version to 2.34-9
* Mon Apr 12 2021 Sandro Mani <manisandro@gmail.com> - 2.34-8
- Backport fix for CVE-2021-3487
* Thu Jan 28 2021 Richard W.M. Jones <rjones@redhat.com> - 2.34-7
- Backport fixes for CVE-2021-20197.
- Bump and rebuild for s390.
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.34-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Dec 18 2020 Sandro Mani <manisandro@gmail.com> - 2.34-4
- Backport patches for CVE-2020-16592, CVE-2020-16598
* Wed Jul 29 2020 Sandro Mani <manisandro@gmail.com> - 2.34-3
- Fix ld --version output
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.34-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 20 2020 Jeff Law <law@redhat.com> - 2.34.0-2
- Fix configure tests compromised by LTO
* Fri Jun 19 2020 Sandro Mani <manisandro@gmail.com> - 2.34.0-1
- Update to 2.34.0
- Modernize spec
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.32-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Nov 19 2019 Sandro Mani <manisandro@gmail.com> - 2.32-6
- Add binutils_24267.patch
- Drop non-relevant patches from native binutils package
* Tue Aug 13 2019 Fabiano Fidêncio <fidencio@redhat.com> - 3.32-5
- Backport all patches from native binutils package, rhbz#1740709
* Wed Aug 07 2019 Sandro Mani <manisandro@gmail.com> - 2.32-4
- Backport patch to fix "too many open files" when linking libLLVM.dll
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.32-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue May 07 2019 Sandro Mani <manisandro@gmail.com> - 2.32-1
- Update to 2.32
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.30-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Aug 22 2018 Sandro Mani <manisandro@gmail.com> - 2.30-5
- Refresh patch for binutils bug #23061
* Wed Aug 08 2018 Sandro Mani <manisandro@gmail.com> - 2.30-4
- Backport patch for binutils bug #23061
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.30-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Jun 14 2018 Sandro Mani <manisandro@gmail.com> - 2.30-2
- Backport patch for binutils bug #22762
* Thu Jun 14 2018 Sandro Mani <manisandro@gmail.com> - 2.30-1
- Update to 2.30
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.29.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sun Oct 08 2017 Kalev Lember <klember@redhat.com> - 2.29.1-1
- Update to 2.29.1
* Tue Sep 19 2017 Sandro Mani <manisandro@gmail.com> - 2.29-4
- Rebuild for mingw-filesystem (for %%mingw_nm macro)
* Fri Aug 25 2017 Sandro Mani <manisandro@gmail.com> - 2.29-3
- Also build multilib version of nm
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.29-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Kalev Lember <klember@redhat.com> - 2.29-1
- Update to 2.29
* Mon Mar 06 2017 Kalev Lember <klember@redhat.com> - 2.28-1
- Update to 2.28
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.27-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Wed Aug 10 2016 Kalev Lember <klember@redhat.com> - 2.27-1
- Update to 2.27
* Tue May 10 2016 Kalev Lember <klember@redhat.com> - 2.26-1
- Update to 2.26
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.25-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.25-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Tue Dec 23 2014 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.25-1
- Update to 2.25
* Tue Dec 23 2014 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.24-5
- Fix CVE-2014-8501 (RHBZ #1162578 #1162583)
- Fix CVE-2014-8502 (RHBZ #1162602)
- Fix CVE-2014-8503 (RHBZ #1162612)
- Fix CVE-2014-8504 (RHBZ #1162626)
- Fix CVE-2014-8737 (RHBZ #1162660)
- Fix CVE-2014-8738 (RHBZ #1162673)
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.24-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.24-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri May 30 2014 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.24-2
- Fix FTBFS against gcc 4.9
* Sat Jan 11 2014 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.24-1
- Update to 2.24
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.23.52.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Apr 3 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.23.52.0.1-1
- Update to 2.23.52.0.1
- Fixes FTBFS against latest texinfo
- Resolve build failure on PPC
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.23.51.0.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Tue Jan 22 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.23.51.0.5-3
- Backported patch to fix 'unexpected version string length' error in windres (RHBZ #902960)
* Tue Nov 27 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.23.51.0.5-2
- Added BR: zlib-devel to enable support for compressed debug sections
* Wed Nov 21 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.23.51.0.5-1
- Update to 2.23.51.0.5 release
* Mon Oct 15 2012 Jon Ciesla <limburgher@gmail.com> - 2.22.52.0.4-2
- Provides: bundled(libiberty)
* Wed Jul 18 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52.0.4-1
- Update to 2.22.52.0.4 release
* Sat Jun 2 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52.0.3-1
- Update to 2.22.52.0.3 release
* Sun Apr 8 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52-4
- Cleaned up unneeded %%global tags
* Tue Mar 6 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52-3
- Made the package compliant with the new MinGW packaging guidelines
- Added win64 support
- Added a mingw-binutils-generic package containing toolchain
utilities which can be used by both the win32 and win64 toolchains
- Enable the testsuite
- Package the license
- Fix source URL
* Tue Mar 6 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52-2
- Renamed the source package to mingw-binutils (RHBZ #673786)
- Use mingw macros without leading underscore
* Sat Feb 25 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52-1
- Update to 2.22.52 20120225 snapshot
- Bump the BR/R: mingw32-filesystem to >= 95
- Rebuild using the i686-w64-mingw32 triplet
- Dropped some obsolete configure arguments
- Temporary provide mingw-strip, mingw-objdump and mingw-objcopy
in preparation for win32+win64 support
* Tue Jan 10 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22-1
- Update to 2.22
- Dropped unneeded RPM tags
- Use parallel make
* Tue May 10 2011 Kalev Lember <kalev@smartlink.ee> - 2.21-2
- Default to runtime pseudo reloc v2 now that mingw32-runtime 3.18 is in
* Thu Mar 17 2011 Kalev Lember <kalev@smartlink.ee> - 2.21-1
- Update to 2.21
- Added a patch to use runtime pseudo reloc v1 by default as the version of
mingw32-runtime we have does not support v2.
- Don't own the /usr/i686-pc-mingw32/bin/ directory
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.20.51.0.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Tue Sep 7 2010 Richard W.M. Jones <rjones@redhat.com> - 2.20.51.0.10-1
- Synchronize with Fedora native version (2.20.51.0.10).
- Note however that we are not using any Fedora patches.
* Thu May 13 2010 Kalev Lember <kalev@smartlink.ee> - 2.20.1-1
- Update to 2.20.1
* Wed Sep 16 2009 Kalev Lember <kalev@smartlink.ee> - 2.19.51.0.14-1
- Update to 2.19.51.0.14
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.19.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Tue Mar 10 2009 Richard W.M. Jones <rjones@redhat.com> - 2.19.1-4
- Switch to using upstream (GNU) binutils 2.19.1. It's exactly the
same as the MinGW version now.
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.19.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 2.19.1-2
- Rebuild for mingw32-gcc 4.4
* Tue Feb 10 2009 Richard W.M. Jones <rjones@redhat.com> - 2.19.1-1
- New upstream version 2.19.1.
* Mon Dec 15 2008 Richard W.M. Jones <rjones@redhat.com> - 2.19-1
- New upstream version 2.19.
* Sat Nov 29 2008 Richard W.M. Jones <rjones@redhat.com> - 2.18.50_20080109_2-10
- Must runtime-require mingw32-filesystem.
* Fri Nov 21 2008 Levente Farkas <lfarkas@lfarkas.org> - 2.18.50_20080109_2-9
- BR mingw32-filesystem >= 38
* Wed Sep 24 2008 Richard W.M. Jones <rjones@redhat.com> - 2.18.50_20080109_2-8
- Rename mingw -> mingw32.
- BR mingw32-filesystem >= 26.
* Thu Sep 4 2008 Richard W.M. Jones <rjones@redhat.com> - 2.18.50_20080109_2-7
- Use mingw-filesystem.
* Mon Jul 7 2008 Richard W.M. Jones <rjones@redhat.com> - 2.18.50_20080109_2-5
- Initial RPM release, largely based on earlier work from several sources.