Rebase to GNU Binutils 2.32

This commit is contained in:
Nick Clifton 2019-02-20 11:24:25 +00:00
parent 2aa9183617
commit 68e3eaebed
20 changed files with 71 additions and 4725 deletions

1
.gitignore vendored
View File

@ -16,3 +16,4 @@ build-sources
/binutils-2.30.90.tar.xz
/binutils-2.31.1.tar.xz
/binutils-special-sections-in-groups.patch
/binutils-2.32.tar.xz

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
diff -rup binutils.orig/ld/ldmain.c binutils-2.28/ld/ldmain.c
--- binutils.orig/ld/ldmain.c 2017-06-09 09:08:26.954016429 +0100
+++ binutils-2.28/ld/ldmain.c 2017-06-09 09:09:11.307490976 +0100
@@ -923,6 +923,10 @@ multiple_definition (struct bfd_link_inf
obfd = h->u.def.section->owner;
break;
case bfd_link_hash_indirect:
+ /* PR 21074: The GOLD linker can produce multiple indirect
+ refences to the same symbol. These can be ignored. */
+ if (bfd_is_ind_section (nsec))
+ return;
osec = bfd_ind_section_ptr;
oval = 0;
obfd = NULL;

View File

@ -1,33 +0,0 @@
diff -rup binutils.orig/bfd/Makefile.am binutils-2.30.90/bfd/Makefile.am
--- binutils.orig/bfd/Makefile.am 2018-07-09 09:49:43.378323137 +0100
+++ binutils-2.30.90/bfd/Makefile.am 2018-07-09 09:50:40.252723495 +0100
@@ -33,7 +33,7 @@ bfdlibdir = @bfdlibdir@
bfdincludedir = @bfdincludedir@
bfdlib_LTLIBRARIES = libbfd.la
bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/diagnostics.h
+ $(INCDIR)/bfdlink.h $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h
else !INSTALL_LIBBFD
# Empty these so that the respective installation directories will not be created.
bfdlibdir =
diff -rup binutils.orig/bfd/Makefile.in binutils-2.30.90/bfd/Makefile.in
--- binutils.orig/bfd/Makefile.in 2018-07-09 09:49:42.757329685 +0100
+++ binutils-2.30.90/bfd/Makefile.in 2018-07-09 09:51:16.145345812 +0100
@@ -248,7 +248,7 @@ am__can_run_installinfo = \
esac
am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h \
- $(INCDIR)/diagnostics.h
+ $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h
HEADERS = $(bfdinclude_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
@@ -467,7 +467,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel
@INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2)
@INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
-@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h \
+@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h \
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h $(am__append_2)
@INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@
@INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la

View File

@ -1,101 +0,0 @@
diff -rup binutils.orig/bfd/dwarf2.c binutils-2.30/bfd/dwarf2.c
--- binutils.orig/bfd/dwarf2.c 2018-09-26 15:07:47.162863937 +0100
+++ binutils-2.30/bfd/dwarf2.c 2018-09-26 15:08:50.868368183 +0100
@@ -527,6 +527,7 @@ read_section (bfd * abfd,
asection *msec;
const char *section_name = sec->uncompressed_name;
bfd_byte *contents = *section_buffer;
+ bfd_size_type amt;
/* The section may have already been read. */
if (contents == NULL)
@@ -549,7 +550,14 @@ read_section (bfd * abfd,
*section_size = msec->rawsize ? msec->rawsize : msec->size;
/* Paranoia - alloc one extra so that we can make sure a string
section is NUL terminated. */
- contents = (bfd_byte *) bfd_malloc (*section_size + 1);
+ amt = *section_size + 1;
+ if (amt == 0)
+ {
+ bfd_set_error (bfd_error_no_memory);
+ return FALSE;
+ }
+ contents = (bfd_byte *) bfd_malloc (amt);
+
if (contents == NULL)
return FALSE;
if (syms
diff -rup binutils.orig/bfd/syms.c binutils-2.30/bfd/syms.c
--- binutils.orig/bfd/syms.c 2018-09-26 15:07:47.162863937 +0100
+++ binutils-2.30/bfd/syms.c 2018-09-26 15:11:41.671038993 +0100
@@ -1035,6 +1035,10 @@ _bfd_stab_section_find_nearest_line (bfd
0, strsize))
return FALSE;
+ /* Stab strings ought to be nul terminated. Ensure the last one
+ is, to prevent running off the end of the buffer. */
+ info->strs[strsize - 1] = 0;
+
/* If this is a relocatable object file, we have to relocate
the entries in .stab. This should always be simple 32 bit
relocations against symbols defined in this object file, so
@@ -1073,7 +1077,8 @@ _bfd_stab_section_find_nearest_line (bfd
|| r->howto->bitsize != 32
|| r->howto->pc_relative
|| r->howto->bitpos != 0
- || r->howto->dst_mask != 0xffffffff)
+ || r->howto->dst_mask != 0xffffffff
+ || r->address * bfd_octets_per_byte (abfd) + 4 > stabsize)
{
_bfd_error_handler
(_("unsupported .stab relocation"));
@@ -1195,7 +1200,8 @@ _bfd_stab_section_find_nearest_line (bfd
{
nul_fun = stab;
nul_str = str;
- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
+ if (file_name >= (char *) info->strs + strsize
+ || file_name < (char *) str)
file_name = NULL;
if (stab + STABSIZE + TYPEOFF < info->stabs + stabsize
&& *(stab + STABSIZE + TYPEOFF) == (bfd_byte) N_SO)
@@ -1206,7 +1212,8 @@ _bfd_stab_section_find_nearest_line (bfd
directory_name = file_name;
file_name = ((char *) str
+ bfd_get_32 (abfd, stab + STRDXOFF));
- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
+ if (file_name >= (char *) info->strs + strsize
+ || file_name < (char *) str)
file_name = NULL;
}
}
@@ -1217,7 +1224,8 @@ _bfd_stab_section_find_nearest_line (bfd
file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
/* PR 17512: file: 0c680a1f. */
/* PR 17512: file: 5da8aec4. */
- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
+ if (file_name >= (char *) info->strs + strsize
+ || file_name < (char *) str)
file_name = NULL;
break;
@@ -1226,7 +1234,8 @@ _bfd_stab_section_find_nearest_line (bfd
function_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
if (function_name == (char *) str)
continue;
- if (function_name >= (char *) info->strs + strsize)
+ if (function_name >= (char *) info->strs + strsize
+ || function_name < (char *) str)
function_name = NULL;
nul_fun = NULL;
@@ -1335,7 +1344,8 @@ _bfd_stab_section_find_nearest_line (bfd
if (val <= offset)
{
file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
+ if (file_name >= (char *) info->strs + strsize
+ || file_name < (char *) str)
file_name = NULL;
*pline = 0;
}

View File

@ -1,56 +0,0 @@
diff -rup binutils.ori/bfd/syms.c binutils-2.31.1/bfd/syms.c
--- binutils.ori/bfd/syms.c 2019-01-03 13:51:05.784005438 +0000
+++ binutils-2.31.1/bfd/syms.c 2019-01-03 13:53:43.238815129 +0000
@@ -822,10 +822,18 @@ _bfd_generic_read_minisymbols (bfd *abfd
if (symcount < 0)
goto error_return;
- *minisymsp = syms;
- *sizep = sizeof (asymbol *);
+ if (symcount == 0)
+ /* We return 0 above when storage is 0. Exit in the same state
+ here, so as to not complicate callers with having to deal with
+ freeing memory for zero symcount. */
+ free (syms);
+ else
+ {
+ *minisymsp = syms;
+ *sizep = sizeof (asymbol *);
+ }
- return symcount;
+ return symcount;
error_return:
bfd_set_error (bfd_error_no_symbols);
diff -rup binutils.ori/binutils/nm.c binutils-2.31.1/binutils/nm.c
--- binutils.ori/binutils/nm.c 2019-01-03 13:51:06.337001258 +0000
+++ binutils-2.31.1/binutils/nm.c 2019-01-03 13:52:37.542311774 +0000
@@ -1162,13 +1162,11 @@ display_rel_file (bfd *abfd, bfd *archiv
if (synth_count > 0)
{
asymbol **symp;
- void *new_mini;
long i;
- new_mini = xmalloc ((symcount + synth_count + 1) * sizeof (*symp));
- symp = (asymbol **) new_mini;
- memcpy (symp, minisyms, symcount * sizeof (*symp));
- symp += symcount;
+ minisyms = xrealloc (minisyms,
+ (symcount + synth_count + 1) * sizeof (*symp));
+ symp = (asymbol **) minisyms + symcount;
for (i = 0; i < synth_count; i++)
*symp++ = synthsyms + i;
*symp = 0;
diff -rup binutils.orig/binutils/nm.c binutils-2.31.1/binutils/nm.c
--- binutils.orig/binutils/nm.c 2019-01-03 14:18:21.086458519 +0000
+++ binutils-2.31.1/binutils/nm.c 2019-01-03 14:18:23.642438853 +0000
@@ -1170,7 +1170,6 @@ display_rel_file (bfd *abfd, bfd *archiv
for (i = 0; i < synth_count; i++)
*symp++ = synthsyms + i;
*symp = 0;
- minisyms = new_mini;
symcount += synth_count;
}
}

View File

@ -1,21 +0,0 @@
--- binutils.orig/bfd/elflink.c 2018-08-14 10:25:09.108322746 +0100
+++ binutils-2.31.1/bfd/elflink.c 2018-08-14 10:28:45.617780256 +0100
@@ -686,13 +686,11 @@ bfd_elf_record_link_assignment (bfd *out
&& !h->def_regular)
h->root.type = bfd_link_hash_undefined;
- /* If this symbol is not being provided by the linker script, and it is
- currently defined by a dynamic object, but not by a regular object,
- then clear out any version information because the symbol will not be
- associated with the dynamic object any more. */
- if (!provide
- && h->def_dynamic
- && !h->def_regular)
+ /* If this symbol is currently defined by a dynamic object, but not
+ by a regular object, then clear out any version information because
+ the symbol will not be associated with the dynamic object any
+ more. */
+ if (h->def_dynamic && !h->def_regular)
h->verinfo.verdef = NULL;
/* Make sure this symbol is not garbage collected. */

View File

@ -1,196 +0,0 @@
diff -rup binutils.orig/ld/emultempl/pe.em binutils-2.31.1/ld/emultempl/pe.em
--- binutils.orig/ld/emultempl/pe.em 2018-09-04 11:00:05.546667021 +0100
+++ binutils-2.31.1/ld/emultempl/pe.em 2018-09-04 11:00:58.427292612 +0100
@@ -2165,7 +2165,7 @@ gld_${EMULATION_NAME}_place_orphan (asec
&add_child);
if (bfd_link_relocatable (&link_info))
{
- os->section_alignment = s->alignment_power;
+ os->section_alignment = exp_intop (1U << s->alignment_power);
os->bfd_section->alignment_power = s->alignment_power;
}
}
diff -rup binutils.orig/ld/emultempl/pep.em binutils-2.31.1/ld/emultempl/pep.em
--- binutils.orig/ld/emultempl/pep.em 2018-09-04 11:00:05.545667029 +0100
+++ binutils-2.31.1/ld/emultempl/pep.em 2018-09-04 11:01:29.340073740 +0100
@@ -1962,7 +1962,7 @@ gld_${EMULATION_NAME}_place_orphan (asec
&add_child);
if (bfd_link_relocatable (&link_info))
{
- os->section_alignment = s->alignment_power;
+ os->section_alignment = exp_intop (1U << s->alignment_power);
os->bfd_section->alignment_power = s->alignment_power;
}
}
diff -rup binutils.orig/ld/ldexp.c binutils-2.31.1/ld/ldexp.c
--- binutils.orig/ld/ldexp.c 2018-09-04 11:00:05.535667100 +0100
+++ binutils-2.31.1/ld/ldexp.c 2018-09-04 11:03:29.179225246 +0100
@@ -1528,6 +1528,28 @@ exp_get_value_int (etree_type *tree, int
return exp_get_vma (tree, def, name);
}
+/* Return the smallest non-negative integer such that two raised to
+ that power is at least as large as the vma evaluated at TREE, if
+ TREE is a non-NULL expression that can be resolved. If TREE is
+ NULL or cannot be resolved, return -1. */
+
+signed int
+exp_get_power (etree_type *tree, char *name)
+{
+ bfd_vma x = exp_get_vma (tree, -1, name);
+ bfd_vma p2;
+ int n;
+
+ if (x == (bfd_vma) -1)
+ return -1;
+
+ for (n = 0, p2 = 1; p2 < x; ++n, p2 <<= 1)
+ if (p2 == 0)
+ break;
+
+ return n;
+}
+
fill_type *
exp_get_fill (etree_type *tree, fill_type *def, char *name)
{
diff -rup binutils.orig/ld/ldexp.h binutils-2.31.1/ld/ldexp.h
--- binutils.orig/ld/ldexp.h 2018-09-04 11:00:05.536667092 +0100
+++ binutils-2.31.1/ld/ldexp.h 2018-09-04 11:04:12.937915422 +0100
@@ -231,6 +231,8 @@ bfd_vma exp_get_vma
(etree_type *, bfd_vma, char *);
int exp_get_value_int
(etree_type *, int, char *);
+signed int exp_get_power
+ (etree_type *, char *);
fill_type *exp_get_fill
(etree_type *, fill_type *, char *);
bfd_vma exp_get_abs_int
diff -rup binutils.orig/ld/ldlang.c binutils-2.31.1/ld/ldlang.c
--- binutils.orig/ld/ldlang.c 2018-09-04 11:00:05.536667092 +0100
+++ binutils-2.31.1/ld/ldlang.c 2018-09-04 11:07:42.249433438 +0100
@@ -1199,8 +1199,8 @@ output_section_statement_newfunc (struct
ret = (struct out_section_hash_entry *) entry;
memset (&ret->s, 0, sizeof (ret->s));
ret->s.header.type = lang_output_section_statement_enum;
- ret->s.output_section_statement.subsection_alignment = -1;
- ret->s.output_section_statement.section_alignment = -1;
+ ret->s.output_section_statement.subsection_alignment = NULL;
+ ret->s.output_section_statement.section_alignment = NULL;
ret->s.output_section_statement.block_value = 1;
lang_list_init (&ret->s.output_section_statement.children);
lang_statement_append (stat_ptr, &ret->s, &ret->s.header.next);
@@ -2193,8 +2193,9 @@ init_os (lang_output_section_statement_t
exp_init_os (s->load_base);
/* If supplied an alignment, set it. */
- if (s->section_alignment != -1)
- s->bfd_section->alignment_power = s->section_alignment;
+ if (s->section_alignment != NULL)
+ s->bfd_section->alignment_power = exp_get_power (s->section_alignment,
+ "section alignment");
}
/* Make sure that all output sections mentioned in an expression are
@@ -4706,8 +4707,10 @@ size_input_section
is greater than any seen before, then record it too. Perform
the alignment by inserting a magic 'padding' statement. */
- if (output_section_statement->subsection_alignment != -1)
- i->alignment_power = output_section_statement->subsection_alignment;
+ if (output_section_statement->subsection_alignment != NULL)
+ i->alignment_power
+ = exp_get_power (output_section_statement->subsection_alignment,
+ "subsection alignment");
if (o->alignment_power < i->alignment_power)
o->alignment_power = i->alignment_power;
@@ -5147,7 +5150,8 @@ lang_size_sections_1
section_alignment = os->bfd_section->alignment_power;
}
else
- section_alignment = os->section_alignment;
+ section_alignment = exp_get_power (os->section_alignment,
+ "section alignment");
/* Align to what the section needs. */
if (section_alignment > 0)
@@ -5225,7 +5229,8 @@ lang_size_sections_1
only align according to the value in the output
statement. */
if (os->lma_region != os->region)
- section_alignment = os->section_alignment;
+ section_alignment = exp_get_power (os->section_alignment,
+ "section alignment");
if (section_alignment > 0)
lma = align_power (lma, section_alignment);
}
@@ -6673,25 +6678,6 @@ lang_add_output (const char *name, int f
}
}
-static int
-topower (int x)
-{
- unsigned int i = 1;
- int l;
-
- if (x < 0)
- return -1;
-
- for (l = 0; l < 32; l++)
- {
- if (i >= (unsigned int) x)
- return l;
- i <<= 1;
- }
-
- return 0;
-}
-
lang_output_section_statement_type *
lang_enter_output_section_statement (const char *output_section_statement_name,
etree_type *address_exp,
@@ -6727,10 +6713,8 @@ lang_enter_output_section_statement (con
einfo (_("%F%P:%pS: error: align with input and explicit align specified\n"),
NULL);
- os->subsection_alignment =
- topower (exp_get_value_int (subalign, -1, "subsection alignment"));
- os->section_alignment =
- topower (exp_get_value_int (align, -1, "section alignment"));
+ os->subsection_alignment = subalign;
+ os->section_alignment = align;
os->load_base = ebase;
return os;
@@ -7748,7 +7732,7 @@ lang_new_phdr (const char *name,
n = (struct lang_phdr *) stat_alloc (sizeof (struct lang_phdr));
n->next = NULL;
n->name = name;
- n->type = exp_get_value_int (type, 0, "program header type");
+ n->type = exp_get_vma (type, 0, "program header type");
n->filehdr = filehdr;
n->phdrs = phdrs;
n->at = at;
diff -rup binutils.orig/ld/ldlang.h binutils-2.31.1/ld/ldlang.h
--- binutils.orig/ld/ldlang.h 2018-09-04 11:00:05.533667114 +0100
+++ binutils-2.31.1/ld/ldlang.h 2018-09-04 11:08:29.224100845 +0100
@@ -143,6 +143,8 @@ typedef struct lang_output_section_state
fill_type *fill;
union etree_union *addr_tree;
union etree_union *load_base;
+ union etree_union *section_alignment;
+ union etree_union *subsection_alignment;
/* If non-null, an expression to evaluate after setting the section's
size. The expression is evaluated inside REGION (above) with '.'
@@ -153,8 +155,6 @@ typedef struct lang_output_section_state
lang_output_section_phdr_list *phdrs;
unsigned int block_value;
- int subsection_alignment; /* Alignment of components. */
- int section_alignment; /* Alignment of start of section. */
int constraint;
flagword flags;
enum section_type sectype;

View File

@ -1,52 +0,0 @@
diff -rup binutils,orig/bfd/elf.c binutils-2.31.1/bfd/elf.c
--- binutils,orig/bfd/elf.c 2018-08-28 12:38:29.987511521 +0100
+++ binutils-2.31.1/bfd/elf.c 2018-08-28 12:39:35.010036349 +0100
@@ -1877,7 +1877,7 @@ _bfd_elf_get_symbol_version_string (bfd
{
Elf_Internal_Verneed *t;
- version_string = "";
+ version_string = _("<corrupt>");
for (t = elf_tdata (abfd)->verref;
t != NULL;
t = t->vn_nextref)
diff -rup binutils,orig/binutils/readelf.c binutils-2.31.1/binutils/readelf.c
--- binutils,orig/binutils/readelf.c 2018-08-28 12:38:30.552507392 +0100
+++ binutils-2.31.1/binutils/readelf.c 2018-08-28 12:42:04.625942967 +0100
@@ -11263,6 +11263,7 @@ get_symbol_version_string (Filedata *
unsigned char data[2];
unsigned short vers_data;
unsigned long offset;
+ unsigned short max_vd_ndx;
if (!is_dynsym
|| version_info[DT_VERSIONTAGIDX (DT_VERSYM)] == 0)
@@ -11280,6 +11281,8 @@ get_symbol_version_string (Filedata *
if ((vers_data & VERSYM_HIDDEN) == 0 && vers_data == 0)
return NULL;
+ max_vd_ndx = 0;
+
/* Usually we'd only see verdef for defined symbols, and verneed for
undefined symbols. However, symbols defined by the linker in
.dynbss for variables copied from a shared library in order to
@@ -11322,6 +11325,9 @@ get_symbol_version_string (Filedata *
ivd.vd_flags = BYTE_GET (evd.vd_flags);
}
+ if ((ivd.vd_ndx & VERSYM_VERSION) > max_vd_ndx)
+ max_vd_ndx = ivd.vd_ndx & VERSYM_VERSION;
+
off += ivd.vd_next;
}
while (ivd.vd_ndx != (vers_data & VERSYM_VERSION) && ivd.vd_next != 0);
@@ -11413,6 +11419,9 @@ get_symbol_version_string (Filedata *
return (ivna.vna_name < strtab_size
? strtab + ivna.vna_name : _("<corrupt>"));
}
+ else if ((max_vd_ndx || (vers_data & VERSYM_VERSION) != 1)
+ && (vers_data & VERSYM_VERSION) > max_vd_ndx)
+ return _("<corrupt>");
}
return NULL;
}

View File

@ -1,16 +0,0 @@
--- binutils.orig/binutils/readelf.c 2018-09-05 14:08:22.733186922 +0100
+++ binutils-2.30/binutils/readelf.c 2018-09-05 15:35:38.009749485 +0100
@@ -17634,11 +17634,12 @@ print_gnu_build_attribute_description (E
if (is_open_attr)
{
+#if 0
/* FIXME: Need to properly allow for section alignment. 16 is just the alignment used on x86_64. */
if (global_end > 0 && start > BFD_ALIGN (global_end, 16))
warn (_("Gap in build notes detected from %#lx to %#lx\n"),
global_end + 1, start - 1);
-
+#endif
printf (_(" Applies to region from %#lx"), start);
global_offset = start;

View File

@ -1,25 +0,0 @@
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index 444aef2942..8a3858d32b 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -637,9 +637,9 @@ cat <<EOF
${SDATA_GOT+${OTHER_GOT_SECTIONS}}
${DATA_SDATA-${SDATA}}
${DATA_SDATA-${OTHER_SDATA_SECTIONS}}
- ${RELOCATING+${DATA_END_SYMBOLS-${CREATE_SHLIB+PROVIDE (}${USER_LABEL_PREFIX}_edata = .${CREATE_SHLIB+)}; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
+ ${RELOCATING+${DATA_END_SYMBOLS-${USER_LABEL_PREFIX}_edata = .; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
${RELOCATING+. = .;}
- ${RELOCATING+${CREATE_SHLIB+PROVIDE (}${USER_LABEL_PREFIX}__bss_start = .${CREATE_SHLIB+)};}
+ ${RELOCATING+${USER_LABEL_PREFIX}__bss_start = .;}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${DATA_SDATA-${SBSS}}
${BSS_PLT+${PLT}}
@@ -672,7 +672,7 @@ cat <<EOF
${LARGE_BSS_AFTER_BSS-${LARGE_BSS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});}
${RELOCATING+${OTHER_END_SYMBOLS}}
- ${RELOCATING+${END_SYMBOLS-${CREATE_SHLIB+PROVIDE (}${USER_LABEL_PREFIX}_end = .${CREATE_SHLIB+)}; PROVIDE (${USER_LABEL_PREFIX}end = .);}}
+ ${RELOCATING+${END_SYMBOLS-${USER_LABEL_PREFIX}_end = .; PROVIDE (${USER_LABEL_PREFIX}end = .);}}
${RELOCATING+${DATA_SEGMENT_END}}
${TINY_DATA_SECTION}
${TINY_BSS_SECTION}

View File

@ -0,0 +1,33 @@
diff -rup binutils.orig/bfd/Makefile.am binutils-2.32/bfd/Makefile.am
--- binutils.orig/bfd/Makefile.am 2019-02-08 12:22:51.395684251 +0000
+++ binutils-2.32/bfd/Makefile.am 2019-02-08 12:22:53.970664973 +0000
@@ -33,7 +33,7 @@ bfdlibdir = @bfdlibdir@
bfdincludedir = @bfdincludedir@
bfdlib_LTLIBRARIES = libbfd.la
bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
+ bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
else !INSTALL_LIBBFD
# Empty these so that the respective installation directories will not be created.
bfdlibdir =
diff -rup binutils.orig/bfd/Makefile.in binutils-2.32/bfd/Makefile.in
--- binutils.orig/bfd/Makefile.in 2019-02-08 12:21:35.291254044 +0000
+++ binutils-2.32/bfd/Makefile.in 2019-02-08 12:22:10.163992947 +0000
@@ -249,7 +249,7 @@ am__can_run_installinfo = \
esac
am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bfd_stdint.h \
- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
+ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
HEADERS = $(bfdinclude_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
@@ -468,7 +468,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel
@INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2)
@INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
-@INSTALL_LIBBFD_TRUE@ bfd_stdint.h $(INCDIR)/diagnostics.h \
+@INSTALL_LIBBFD_TRUE@ bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h \
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2)
@INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@
@INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la

View File

@ -1,657 +0,0 @@
diff -rup binutils.orig/gold/testsuite/Makefile.am binutils-2.30/gold/testsuite/Makefile.am
--- binutils.orig/gold/testsuite/Makefile.am 2018-05-31 16:14:12.736538727 +0100
+++ binutils-2.30/gold/testsuite/Makefile.am 2018-06-01 10:15:00.936103521 +0100
@@ -393,7 +393,7 @@ icf_sht_rel_addend_test: icf_sht_rel_add
icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test
$(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout
-check_PROGRAMS += large_symbol_alignment
+# check_PROGRAMS += large_symbol_alignment
large_symbol_alignment_SOURCES = large_symbol_alignment.cc
large_symbol_alignment_DEPENDENCIES = gcctestdir/ld
large_symbol_alignment_LDFLAGS = -Bgcctestdir/
@@ -783,7 +783,7 @@ weak_test_DEPENDENCIES = gcctestdir/ld
weak_test_LDFLAGS = -Bgcctestdir/
weak_test_LDADD =
-check_PROGRAMS += weak_undef_test
+# check_PROGRAMS += weak_undef_test
MOSTLYCLEANFILES += alt/weak_undef_lib.so
weak_undef_test_SOURCES = weak_undef_test.cc
weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
@@ -1409,7 +1409,7 @@ initpri2_DEPENDENCIES = gcctestdir/ld
initpri2_LDFLAGS = -Bgcctestdir/ -Wl,--ctors-in-init-array
initpri2_LDADD =
-check_PROGRAMS += initpri3a
+# check_PROGRAMS += initpri3a
initpri3a_SOURCES = initpri3.c
initpri3a_DEPENDENCIES = gcctestdir/ld
initpri3a_LDFLAGS = -Bgcctestdir/
@@ -1897,19 +1897,19 @@ relro_script_test_LDADD = relro_script_t
relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o
$(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-T,$(srcdir)/relro_script_test.t relro_test_pic.o
-check_PROGRAMS += script_test_1
+# check_PROGRAMS += script_test_1
script_test_1_SOURCES = script_test_1a.cc script_test_1b.cc
script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t
script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_1.t
script_test_1_LDADD =
-check_PROGRAMS += script_test_2
+# check_PROGRAMS += script_test_2
script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc
script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t
script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_2.t
script_test_2_LDADD =
-check_PROGRAMS += justsyms
+# check_PROGRAMS += justsyms
justsyms_SOURCES = justsyms_1.cc
justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o
@@ -1919,7 +1919,7 @@ justsyms_2.o: justsyms_2.cc
justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
-check_PROGRAMS += justsyms_exec
+# check_PROGRAMS += justsyms_exec
justsyms_exec_SOURCES = justsyms_exec.c
justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib
justsyms_exec_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_lib
@@ -1930,7 +1930,7 @@ justsyms_lib.o: justsyms_lib.c
justsyms_lib: justsyms_lib.o gcctestdir/ld
gcctestdir/ld -o $@ -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o
-check_PROGRAMS += binary_test
+# check_PROGRAMS += binary_test
MOSTLYCLEANFILES += binary.txt
binary_test_SOURCES = binary_test.cc
binary_test_DEPENDENCIES = gcctestdir/ld binary.txt
@@ -1952,7 +1952,7 @@ ver_matching_def_pic.o: ver_matching_def
ver_matching_test.stdout: ver_matching_def.so
$(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
-check_PROGRAMS += script_test_3
+# check_PROGRAMS += script_test_3
check_SCRIPTS += script_test_3.sh
check_DATA += script_test_3.stdout
MOSTLYCLEANFILES += script_test_3.stdout
@@ -1961,7 +1961,7 @@ script_test_3: basic_test.o gcctestdir/l
script_test_3.stdout: script_test_3
$(TEST_READELF) -SlW script_test_3 > script_test_3.stdout
-check_PROGRAMS += tls_phdrs_script_test
+# check_PROGRAMS += tls_phdrs_script_test
tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES)
tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t
tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -Wl,-T,$(srcdir)/script_test_3.t
@@ -2043,7 +2043,7 @@ check_PROGRAMS += script_test_12
script_test_12: gcctestdir/ld $(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o
$(LINK) -Bgcctestdir/ -Wl,-T,$(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o
-check_PROGRAMS += script_test_12i
+# check_PROGRAMS += script_test_12i
script_test_12i: gcctestdir/ld $(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o
$(LINK) -Bgcctestdir/ -Wl,-T,$(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o
script_test_12a.o: script_test_12a.c
@@ -3023,7 +3023,7 @@ two_file_test_2_ndebug.o: two_file_test_
two_file_test_main_ndebug.o: two_file_test_main.cc
$(CXXCOMPILE) -O0 -g0 -c -o $@ $<
-check_PROGRAMS += incremental_test_2
+# check_PROGRAMS += incremental_test_2
MOSTLYCLEANFILES += two_file_test_tmp_2.o
incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \
two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld
@@ -3033,7 +3033,7 @@ incremental_test_2: two_file_test_1_v1_n
cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o
$(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
-check_PROGRAMS += incremental_test_3
+# check_PROGRAMS += incremental_test_3
MOSTLYCLEANFILES += two_file_test_tmp_3.o
incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
two_file_test_2.o two_file_test_main.o gcctestdir/ld
@@ -3043,7 +3043,7 @@ incremental_test_3: two_file_test_1.o tw
cp -f two_file_test_1b.o two_file_test_tmp_3.o
$(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
-check_PROGRAMS += incremental_test_4
+# check_PROGRAMS += incremental_test_4
MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o
incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \
two_file_test_2.o two_file_test_main.o gcctestdir/ld
@@ -3054,7 +3054,7 @@ incremental_test_4: two_file_test_1.o tw
cp -f two_file_test_2.o two_file_test_tmp_4.o
$(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
-check_PROGRAMS += incremental_test_5
+# check_PROGRAMS += incremental_test_5
MOSTLYCLEANFILES += two_file_test_5.a
incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
two_file_test_2.o two_file_test_main.o gcctestdir/ld
@@ -3068,7 +3068,7 @@ incremental_test_5: two_file_test_1.o tw
# Test the --incremental-unchanged flag with an archive library.
# The second link should not update the library.
-check_PROGRAMS += incremental_test_6
+# check_PROGRAMS += incremental_test_6
MOSTLYCLEANFILES += two_file_test_6.a
incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
two_file_test_2.o two_file_test_main.o gcctestdir/ld
@@ -3080,7 +3080,7 @@ incremental_test_6: two_file_test_1.o tw
$(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
$(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown
-check_PROGRAMS += incremental_copy_test
+# check_PROGRAMS += incremental_copy_test
incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
cp -f copy_test_v1.o copy_test_tmp.o
$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so
@@ -3088,7 +3088,7 @@ incremental_copy_test: copy_test_v1.o co
cp -f copy_test.o copy_test_tmp.o
$(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so
-check_PROGRAMS += incremental_common_test_1
+# check_PROGRAMS += incremental_common_test_1
incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld
cp -f common_test_1_v1.o common_test_1_tmp.o
$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ common_test_1_tmp.o
@@ -3096,7 +3096,7 @@ incremental_common_test_1: common_test_1
cp -f common_test_1_v2.o common_test_1_tmp.o
$(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ common_test_1_tmp.o
-check_PROGRAMS += incremental_comdat_test_1
+# check_PROGRAMS += incremental_comdat_test_1
incremental_comdat_test_1: incr_comdat_test_1.o incr_comdat_test_2_v1.o incr_comdat_test_2_v2.o incr_comdat_test_2_v3.o gcctestdir/ld
cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o
$(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
diff -rup binutils.orig/gold/testsuite/Makefile.in binutils-2.30/gold/testsuite/Makefile.in
--- binutils.orig/gold/testsuite/Makefile.in 2018-05-31 16:14:12.729538804 +0100
+++ binutils-2.30/gold/testsuite/Makefile.in 2018-06-01 10:15:13.070965094 +0100
@@ -166,7 +166,6 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
@GCC_TRUE@@NATIVE_LINKER_TRUE@ alt/weak_undef_lib.so \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ libweak_undef_2.a
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_5 = icf_virtual_function_folding_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ large_symbol_alignment \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_test basic_pic_test \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ eh_test
@GCC_FALSE@large_symbol_alignment_DEPENDENCIES =
@@ -220,7 +219,6 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
@NATIVE_LINKER_FALSE@exception_test_DEPENDENCIES =
@GCC_TRUE@@HAVE_STATIC_TRUE@@NATIVE_LINKER_TRUE@am__append_14 = exception_static_test
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_15 = weak_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test_2
@GCC_FALSE@weak_test_DEPENDENCIES =
@NATIVE_LINKER_FALSE@weak_test_DEPENDENCIES =
@@ -334,7 +332,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
# Test difference between "*(a b)" and "*(a) *(b)" in input section spec.
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_39 = many_sections_test \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_r_test initpri1 \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2 initpri3a \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2 \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections_none \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections \
@@ -348,13 +346,9 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_12 protected_1 \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_2 relro_test \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_now_test relro_strip_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_script_test script_test_1 \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2 justsyms \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms_exec binary_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3 \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_phdrs_script_test \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_script_test \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_script_test script_test_11 \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12 script_test_12i \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12 \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ dynamic_list_2 \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_1 \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_2
@@ -813,15 +807,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E
# Test the --incremental-unchanged flag with an archive library.
# The second link should not update the library.
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_82 = incremental_test_2 \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_3 \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4 \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_5 \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_6 \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_copy_test \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_common_test_1 \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_comdat_test_1 \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_x86_64_bnd_test
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_82 =
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_83 = two_file_test_tmp_2.o \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_tmp_3.o \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4.base \
@@ -1082,7 +1068,6 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest
@NATIVE_OR_CROSS_LINKER_TRUE@ leb128_unittest$(EXEEXT) \
@NATIVE_OR_CROSS_LINKER_TRUE@ overflow_unittest$(EXEEXT)
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_2 = icf_virtual_function_folding_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ large_symbol_alignment$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_test$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_pic_test$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ eh_test$(EXEEXT)
@@ -1127,7 +1112,6 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest
@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_separate_shared_21_test$(EXEEXT)
@GCC_TRUE@@HAVE_STATIC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_11 = exception_static_test$(EXEEXT)
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_12 = weak_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test_2$(EXEEXT)
@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_13 = weak_undef_nonpic_test$(EXEEXT)
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_14 = \
@@ -1164,7 +1148,6 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest
@GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_r_test$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri1$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri3a$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections_none$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections$(EXEEXT) \
@@ -1186,17 +1169,9 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest
@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_now_test$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_strip_test$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_script_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_1$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms_exec$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ binary_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_phdrs_script_test$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_script_test$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_11$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12i$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ dynamic_list_2$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_1$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_2$(EXEEXT)
@@ -1263,14 +1238,7 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest
@GCC_TRUE@@NATIVE_LINKER_TRUE@ ehdr_start_test_3$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ ehdr_start_test_5$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ pr20976$(EXEEXT)
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_40 = incremental_test_2$(EXEEXT) \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_3$(EXEEXT) \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4$(EXEEXT) \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_5$(EXEEXT) \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_6$(EXEEXT) \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_copy_test$(EXEEXT) \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_common_test_1$(EXEEXT) \
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_comdat_test_1$(EXEEXT) \
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_40 = \
@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_x86_64_bnd_test$(EXEEXT)
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_41 = pr22266$(EXEEXT)
basic_pic_test_SOURCES = basic_pic_test.c
--- binutils.orig/ld/testsuite/ld-elf/pr22269-1.c 2018-05-31 16:14:12.648539694 +0100
+++ binutils-2.30/ld/testsuite/ld-elf/pr22269-1.c 2018-06-01 10:55:24.284977908 +0100
@@ -5,4 +5,5 @@ _start (void)
{
if (&foo)
return foo;
+ return 0;
}
--- binutils.orig/ld/testsuite/ld-scripts/cross3.t 2018-05-31 16:14:12.679539354 +0100
+++ binutils-2.30/ld/testsuite/ld-scripts/cross3.t 2018-06-01 10:59:46.109996654 +0100
@@ -6,5 +6,6 @@ SECTIONS
.nocrossrefs : { *(.nocrossrefs) }
.data : { *(.data) *(.data.*) *(.sdata) *(.opd) *(.toc) }
.bss : { *(.bss) *(COMMON) }
+ .got.plt : { *(.got) *(.plt) *(.got.plt) }
/DISCARD/ : { *(*) }
}
--- binutils.orig/ld/testsuite/ld-srec/srec.exp 2018-05-31 16:14:12.570540551 +0100
+++ binutils-2.30/ld/testsuite/ld-srec/srec.exp 2018-06-01 11:01:15.443979458 +0100
@@ -19,6 +19,14 @@
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
+if [istarget x86_64-*-*] {
+ # The S-record tests are failing for some configurations
+ # of x86_64-linux builds, but not others. Not worth
+ # investigating however as S-record conversion can always
+ # be done outside of the linker.
+ return
+}
+
# Get the offset from an S-record line to the start of the data.
proc srec_off { l } {
--- binutils.orig/ld/testsuite/ld-x86-64/pr22001-1b.err 2018-05-31 16:14:12.621539991 +0100
+++ binutils-2.30/ld/testsuite/ld-x86-64/pr22001-1b.err 2018-06-01 11:02:58.554805393 +0100
@@ -1,2 +1,2 @@
-.*relocation R_X86_64_32S against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIC
+.*relocation R_X86_64_(PC32|32S) against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIC
#...
--- binutils.orig/ld/testsuite/ld-x86-64/pr21997-1b.err 2018-05-31 16:14:12.620540002 +0100
+++ binutils-2.30/ld/testsuite/ld-x86-64/pr21997-1b.err 2018-06-01 11:04:01.535088273 +0100
@@ -1,2 +1,2 @@
-.*relocation R_X86_64_32S against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIC
+.*relocation R_X86_64_(PC32|32S) against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIC
#...
--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2018-05-31 16:14:12.617540035 +0100
+++ binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp 2018-06-01 11:05:46.005912951 +0100
@@ -1792,7 +1792,7 @@ if { [isnative] && [which $CC] != 0 } {
}
}
- undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS"
+ # undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS"
undefined_weak "-fPIE" ""
undefined_weak "-fPIE" "-pie"
undefined_weak "-fPIE" "-Wl,-z,nodynamic-undefined-weak"
--- binutils.orig/ld/testsuite/ld-size/size-7a.c 2018-05-31 16:14:12.569540562 +0100
+++ binutils-2.30/ld/testsuite/ld-size/size-7a.c 2018-06-01 11:06:44.106265741 +0100
@@ -1,11 +1,12 @@
#include <stdio.h>
-extern char size_of_bar asm ("bar@SIZE");
+extern char size_of_bar asm ("bar@SIZE");
+char * bar_size = & size_of_bar;
int
-main ()
+main (void)
{
- if (10 == (long) &size_of_bar)
+ if (10L == (long) bar_size)
printf ("OK\n");
return 0;
--- binutils.orig/ld/testsuite/ld-size/size-8a.c 2018-05-31 16:14:12.568540573 +0100
+++ binutils-2.30/ld/testsuite/ld-size/size-8a.c 2018-06-01 11:07:54.926476839 +0100
@@ -1,14 +1,15 @@
#include <stdio.h>
extern __thread char bar[];
-extern char size_of_bar asm ("bar@SIZE");
-extern void set_bar (int, int);
+extern char size_of_bar asm ("bar@SIZE");
+extern void set_bar (int, int);
+char * bar_size = & size_of_bar;
int
-main ()
+main (void)
{
set_bar (1, 20);
- if (10 == (long) &size_of_bar && bar[1] == 20)
+ if (10L == (long) bar_size && bar[1] == 20)
printf ("OK\n");
return 0;
--- binutils.orig/ld/testsuite/ld-size/size-4b.c 2018-05-31 16:14:12.569540562 +0100
+++ binutils-2.30/ld/testsuite/ld-size/size-4b.c 2018-06-01 11:09:00.979741038 +0100
@@ -2,7 +2,7 @@ extern char bar[];
extern char size_of_bar asm ("bar@SIZE");
char *bar_size_1 = &size_of_bar;
-static char *bar_size_2 = &size_of_bar;
+char *bar_size_2 = &size_of_bar;
char *
bar_size1 (void)
@@ -20,7 +20,7 @@ extern char foo[];
extern char size_of_foo asm ("foo@SIZE");
char *foo_size_1 = &size_of_foo;
-static char *foo_size_2 = &size_of_foo;
+char *foo_size_2 = &size_of_foo;
char *
foo_size1 (void)
--- binutils.orig/ld/testsuite/ld-size/size-5b.c 2018-05-31 16:14:12.569540562 +0100
+++ binutils-2.30/ld/testsuite/ld-size/size-5b.c 2018-06-01 11:09:42.134282596 +0100
@@ -2,7 +2,7 @@ extern __thread char bar[];
extern char size_of_bar asm ("bar@SIZE");
char *bar_size_1 = &size_of_bar;
-static char *bar_size_2 = &size_of_bar;
+char *bar_size_2 = &size_of_bar;
char *
bar_size1 (void)
@@ -21,7 +21,7 @@ extern __thread char foo[];
extern char size_of_foo asm ("foo@SIZE");
char *foo_size_1 = &size_of_foo;
-static char *foo_size_2 = &size_of_foo;
+char *foo_size_2 = &size_of_foo;
char *
foo_size1 (void)
--- binutils.orig/ld/testsuite/ld-size/size-6a.c 2018-05-31 16:14:12.568540573 +0100
+++ binutils-2.30/ld/testsuite/ld-size/size-6a.c 2018-06-01 11:11:42.478942015 +0100
@@ -1,14 +1,15 @@
#include <stdio.h>
-extern char bar[];
-extern char size_of_bar asm ("bar@SIZE");
-extern void set_bar (int, int);
+extern char bar[];
+extern char size_of_bar asm ("bar@SIZE");
+extern void set_bar (int, int);
+char * bar_size = & size_of_bar;
int
-main ()
+main (void)
{
set_bar (1, 20);
- if (10 == (long) &size_of_bar && bar[1] == 20)
+ if (10 == (long) bar_size && bar[1] == 20)
printf ("OK\n");
return 0;
--- binutils.orig/ld/testsuite/ld-s390/tlspic_64.dd 2018-05-31 16:14:12.579540452 +0100
+++ binutils-2.30/ld/testsuite/ld-s390/tlspic_64.dd 2018-06-01 13:20:16.509595466 +0100
@@ -78,7 +78,7 @@ Disassembly of section .text:
+[0-9a-f]+: 00 00 00 60 .long 0x00000060
# function prolog
+[0-9a-f]+: b9 04 00 ef lgr %r14,%r15
- +[0-9a-f]+: c0 c0 [0-9a-f ]+ larl %r12,[0-9a-f]+ <_GLOBAL_OFFSET_TABLE_>
+ +[0-9a-f]+: c0 c0 [0-9a-f ]+ larl %r12,[0-9a-f]+ <.*>
+[0-9a-f]+: a7 fb ff 60 aghi %r15,-160
+[0-9a-f]+: e3 e0 e0 00 00 24 stg %r14,0\(%r14\)
# extract TCB
--- binutils.orig/ld/testsuite/ld-srec/srec.exp 2018-05-31 16:14:12.570540551 +0100
+++ binutils-2.30/ld/testsuite/ld-srec/srec.exp 2018-06-01 13:24:35.262758291 +0100
@@ -420,6 +420,8 @@ setup_xfail "bfin-*-linux-uclibc"
# generate the format if need be).
setup_xfail "tile*-*-*"
+setup_xfail "s390*-*-*"
+
run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o"
# Now try linking a C++ program with global constructors and
--- binutils.orig/ld/testsuite/ld-elf/indirect.exp 2018-05-31 16:14:12.649539683 +0100
+++ binutils-2.30/ld/testsuite/ld-elf/indirect.exp 2018-06-01 14:32:22.949232924 +0100
@@ -156,12 +156,26 @@ set run_tests {
{"Run with libindirect4c.so 4"
"-Wl,--no-as-needed tmpdir/libindirect4c.so tmpdir/indirect4b.o tmpdir/indirect4a.o" ""
{dummy.c} "indirect4d" "indirect4.out"}
- {"Run indirect5 1"
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" ""
- {indirect5a.c} "indirect5a" "indirect5.out" "$NOPIE_CFLAGS"}
- {"Run indirect5 2"
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" ""
- {dummy.c} "indirect5b" "indirect5.out" "$NOPIE_CFLAGS"}
+}
+
+run_ld_link_exec_tests $run_tests
+
+# The s390x system compiler miscompiles these tests.
+if { ! [istarget s390x-*-*] } {
+
+ set run_tests {
+ {"Run indirect5 1"
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" ""
+ {indirect5a.c} "indirect5a" "indirect5.out" "$NOPIE_CFLAGS"}
+ {"Run indirect5 2"
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" ""
+ {dummy.c} "indirect5b" "indirect5.out" "$NOPIE_CFLAGS"}
+ }
+
+ run_ld_link_exec_tests $run_tests
+}
+
+set run_tests {
{"Run indirect6 1"
"$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" ""
{indirect6a.c} "indirect6a" "indirect5.out" "$NOPIE_CFLAGS"}
@@ -213,12 +227,15 @@ proc check_dynamic_syms { test } {
return 1
}
-foreach t [list indirect5a indirect5b indirect6a indirect6b] {
- set testname [concat $t "dynsym"]
- if { [check_dynamic_syms tmpdir/$t] } {
- pass $testname
- } else {
- fail $testname
+# The s390x system compiler miscompiles indirect5 tests.
+if { ! [istarget s390x-*-*] } {
+ foreach t [list indirect5a indirect5b indirect6a indirect6b] {
+ set testname [concat $t "dynsym"]
+ if { [check_dynamic_syms tmpdir/$t] } {
+ pass $testname
+ } else {
+ fail $testname
+ }
}
}
@@ -229,13 +246,22 @@ if { ! [string match "" $exec_output] }
return
}
+
+# The s390x system compiler miscompiles these tests.
+if { ! [istarget s390x-*-*] } {
+ set pie_tests {
+ {"Run indirect5 3"
+ "-pie -Wl,--no-as-needed tmpdir/libindirect5.so" ""
+ {indirect5a.c} "indirect5c" "indirect5.out" "-fPIE"}
+ {"Run indirect5 4"
+ "-pie -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" ""
+ {dummy.c} "indirect5d" "indirect5.out" "-fPIE"}
+ }
+
+ run_ld_link_exec_tests $pie_tests
+}
+
set pie_tests {
- {"Run indirect5 3"
- "-pie -Wl,--no-as-needed tmpdir/libindirect5.so" ""
- {indirect5a.c} "indirect5c" "indirect5.out" "-fPIE"}
- {"Run indirect5 4"
- "-pie -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" ""
- {dummy.c} "indirect5d" "indirect5.out" "-fPIE"}
{"Run indirect6 3"
"-pie -Wl,--no-as-needed tmpdir/libindirect5.so" ""
{indirect6a.c} "indirect6c" "indirect5.out" "-fPIE"}
@@ -246,11 +272,14 @@ set pie_tests {
run_ld_link_exec_tests $pie_tests
-foreach t [list indirect5c indirect5d indirect6c indirect6d] {
- set testname [concat $t "dynsym"]
- if { [check_dynamic_syms tmpdir/$t] } {
- pass $testname
- } else {
- fail $testname
+# The s390x system compiler miscompiles indirect5 tests.
+if { ! [istarget s390x-*-*] } {
+ foreach t [list indirect5c indirect5d indirect6c indirect6d] {
+ set testname [concat $t "dynsym"]
+ if { [check_dynamic_syms tmpdir/$t] } {
+ pass $testname
+ } else {
+ fail $testname
+ }
}
}
--- binutils.orig/ld/testsuite/ld-elfvers/vers.exp 2018-05-31 16:14:12.572540529 +0100
+++ binutils-2.30/ld/testsuite/ld-elfvers/vers.exp 2018-06-01 15:23:36.518815276 +0100
@@ -938,6 +938,7 @@ if [string match "yes" $pic] then {
build_exec "vers23" vers23.c vers23 "-Wl,--no-as-needed tmpdir/vers23a.so tmpdir/vers23b.o tmpdir/vers23b.so" "" vers23.ver vers23.dsym ""
}
+if {! [istarget ppc64*-*-*] } {
# Test .symver x,x@VERS.0
set as_pic_flags ""
if [istarget sparc*-*-*] {
@@ -955,6 +956,7 @@ run_ld_link_tests [list "\"vers24c\"
\"-shared --version-script $srcdir/$subdir/vers24.map\" \"\"
\"$as_pic_flags $as_options\" {vers24c.c} { { readelf -Wrs vers24.rd } }
\"libvers24c.so\" \"-fpic\""]
+}
# Test versioned definition vs. normal definition in different files.
if [string match "yes" $pic] then {
--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2018-05-31 16:14:12.573540519 +0100
+++ binutils-2.30/ld/testsuite/ld-ifunc/ifunc.exp 2018-06-01 15:26:52.020691739 +0100
@@ -284,11 +284,14 @@ if {! [check_osabi tmpdir/static_nonifun
# The linked ifunc using executables and the shared library containing
# ifunc should contain an IFUNC symbol. The non-ifunc using executable
# should not.
-
+if { ![istarget "ppc*-*-*"] } {
if {[contains_ifunc_symbol tmpdir/libshared_ifunc.so] != 1} {
fail "Shared libraries containing ifunc does not contain an IFUNC symbol"
set fails [expr $fails + 1]
}
+}
+
+if { ![istarget "ppc*-*-*"] } {
if {[contains_ifunc_symbol tmpdir/local_prog] != 1} {
fail "Local ifunc-using executable does not contain an IFUNC symbol"
set fails [expr $fails + 1]
@@ -297,6 +300,7 @@ if {[contains_ifunc_symbol tmpdir/static
fail "Static ifunc-using executable does not contain an IFUNC symbol"
set fails [expr $fails + 1]
}
+}
if {[contains_ifunc_symbol tmpdir/dynamic_prog] != 0} {
fail "Dynamic ifunc-using executable contains an IFUNC symbol"
set fails [expr $fails + 1]
--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2018-05-31 16:14:12.580540442 +0100
+++ binutils-2.30/ld/testsuite/ld-plugin/plugin.exp 2018-06-01 15:29:44.048823172 +0100
@@ -293,12 +293,14 @@ if { !$can_compile || $failed_compile }
run_ld_link_tests $plugin_tests
+if { ! [istarget "ppc*-*-*"] } {
if { [is_elf_format] \
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func1p.c tmpdir/func1p.o] \
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func2i.c tmpdir/func2i.o] \
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func3h.c tmpdir/func3h.o] } {
run_ld_link_tests $plugin_extra_elf_tests
}
+}
if {![ar_simple_create $ar "" "tmpdir/libtext.a" "tmpdir/text.o"] || \
![ar_simple_create $ar "" "tmpdir/libempty.a" ""]} {
--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2018-07-09 09:49:50.488248175 +0100
+++ binutils-2.30.90/ld/testsuite/ld-elf/tls.exp 2018-07-09 10:46:26.449688046 +0100
@@ -39,7 +39,9 @@ if [istarget "sparc*-*-*"] {
append AFLAGS_PIC " -K PIC"
}
-run_ld_link_tests [list \
+# The s390x system compiler miscompiles these tests.
+if { ! [istarget s390x-*-*] } {
+ run_ld_link_tests [list \
[list \
"Build pr22263-1" \
"-pie -e _start -z text" \
@@ -51,3 +53,4 @@ run_ld_link_tests [list \
"-fPIE -O2" \
] \
]
+}

View File

@ -1,37 +0,0 @@
--- binutils.orig/gas/as.c 2019-01-30 11:02:04.055574300 +0000
+++ binutils-2.31.1/gas/as.c 2019-01-30 11:03:12.212050935 +0000
@@ -1254,14 +1254,27 @@ main (int argc, char ** argv)
{
struct stat sib;
- if (stat (argv[i], &sib) == 0)
+ /* Check that the input file and output file are different. */
+ if (stat (argv[i], &sib) == 0
+ && sib.st_ino == sob.st_ino
+ /* POSIX emulating systems may support stat() but if the
+ underlying file system does not support a file serial number
+ of some kind then they will return 0 for the inode. So
+ two files with an inode of 0 may not actually be the same.
+ On real POSIX systems no ordinary file will ever have an
+ inode of 0. */
+ && sib.st_ino != 0
+ /* Different files may have the same inode number if they
+ reside on different devices, so check the st_dev field as
+ well. */
+ && sib.st_dev == sob.st_dev)
{
- if (sib.st_ino == sob.st_ino && sib.st_ino != 0)
- {
- /* Don't let as_fatal remove the output file! */
- out_file_name = NULL;
- as_fatal (_("The input and output files must be distinct"));
- }
+ const char *saved_out_file_name = out_file_name;
+
+ /* Don't let as_fatal remove the output file! */
+ out_file_name = NULL;
+ as_fatal (_("The input '%s' and output '%s' files are the same"),
+ argv[i], saved_out_file_name);
}
}
}

View File

@ -1,35 +0,0 @@
diff -rup binutils.orig/gold/options.h binutils-2.31.1/gold/options.h
--- binutils.orig/gold/options.h 2018-11-28 13:43:45.192094029 +0000
+++ binutils-2.31.1/gold/options.h 2018-11-28 13:44:30.616758345 +0000
@@ -1358,6 +1358,10 @@ class General_options
N_("Warn about duplicate common symbols"),
N_("Do not warn about duplicate common symbols"));
+ DEFINE_bool(warn_drop_version, options::TWO_DASHES, '\0', false,
+ N_("Warn when discarding version information"),
+ N_("Do not warn when discarding version information"));
+
DEFINE_bool_ignore(warn_constructors, options::TWO_DASHES, '\0',
N_("Ignored"), N_("Ignored"));
diff -rup binutils.orig/gold/symtab.cc binutils-2.31.1/gold/symtab.cc
--- binutils.orig/gold/symtab.cc 2018-11-28 13:43:45.193094021 +0000
+++ binutils-2.31.1/gold/symtab.cc 2018-11-28 13:45:13.479441595 +0000
@@ -2623,11 +2623,12 @@ Symbol_table::set_dynsym_indexes(unsigne
versions->record_version(this, dynpool, sym);
else
{
- gold_warning(_("discarding version information for "
- "%s@%s, defined in unused shared library %s "
- "(linked with --as-needed)"),
- sym->name(), sym->version(),
- sym->object()->name().c_str());
+ if (parameters->options().warn_drop_version())
+ gold_warning(_("discarding version information for "
+ "%s@%s, defined in unused shared library %s "
+ "(linked with --as-needed)"),
+ sym->name(), sym->version(),
+ sym->object()->name().c_str());
sym->clear_version();
}
}

View File

@ -1,23 +0,0 @@
diff -rup binutils.orig/gold/layout.cc binutils-2.31.1/gold/layout.cc
--- binutils.orig/gold/layout.cc 2018-07-27 11:49:15.188939352 +0100
+++ binutils-2.31.1/gold/layout.cc 2018-07-27 11:50:03.984405949 +0100
@@ -5429,6 +5429,7 @@ const Layout::Section_name_mapping Layou
MAPPING_INIT(".gnu.linkonce.armextab.", ".ARM.extab"),
MAPPING_INIT(".ARM.exidx", ".ARM.exidx"),
MAPPING_INIT(".gnu.linkonce.armexidx.", ".ARM.exidx"),
+ MAPPING_INIT(".gnu.build.attributes.", ".gnu.build.attributes"),
};
// Mapping for ".text" section prefixes with -z,keep-text-section-prefix.
diff -rup binutils.orig/ld/scripttempl/elf.sc binutils-2.31.1/ld/scripttempl/elf.sc
--- binutils.orig/ld/scripttempl/elf.sc 2018-07-30 10:48:58.409509857 +0100
+++ binutils-2.31.1/ld/scripttempl/elf.sc 2018-07-30 10:49:09.267393364 +0100
@@ -692,6 +692,8 @@ cat <<EOF
.comment 0 : { *(.comment) }
+ .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
+
EOF
. $srcdir/scripttempl/DWARF.sc

View File

@ -1,61 +0,0 @@
--- binutils.orig/binutils/objcopy.c 2018-08-06 09:11:02.053503486 +0100
+++ binutils-2.30/binutils/objcopy.c 2018-08-06 09:11:23.296329566 +0100
@@ -2174,7 +2174,7 @@ merge_gnu_build_notes (bfd * abfd, asect
3. Eliminate any NT_GNU_BUILD_ATTRIBUTE_OPEN notes that have the same
full name field as the immediately preceeding note with the same type
of name and whose address ranges coincide.
- IE - it there are gaps in the coverage of the notes, then these gaps
+ IE - if there are gaps in the coverage of the notes, then these gaps
must be preserved.
4. Combine the numeric value of any NT_GNU_BUILD_ATTRIBUTE_OPEN notes
of type GNU_BUILD_ATTRIBUTE_STACK_SIZE.
@@ -2182,16 +2182,47 @@ merge_gnu_build_notes (bfd * abfd, asect
its description field is empty then the nearest preceeding OPEN note
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. */
+ 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 ++)
{
int note_type;
objcopy_internal_note * back;
objcopy_internal_note * prev_open_with_range = NULL;
+ /* Rule 6 - delete 0-range notes. */
+ if (pnote->start == pnote->end)
+ {
+ duplicate_found = TRUE;
+ pnote->note.type = 0;
+ continue;
+ }
+
/* Rule 2 - preserve function notes. */
if (! is_open_note (pnote))
- continue;
+ {
+ int iter;
+
+ /* Check to see if there is an identical previous function note.
+ This can happen with overlays for example. */
+ for (iter = 0, back = pnote -1; back >= pnotes; back --)
+ {
+ if (back->start == pnote->start
+ && back->end == pnote->end
+ && back->note.namesz == pnote->note.namesz
+ && memcmp (back->note.namedata, pnote->note.namedata, pnote->note.namesz) == 0)
+ {
+ duplicate_found = TRUE;
+ pnote->note.type = 0;
+ break;
+ }
+
+ /* Don't scan too far back however. */
+ if (iter ++ > 16)
+ break;
+ }
+ continue;
+ }
note_type = pnote->note.namedata[attribute_type_byte];

View File

@ -1,872 +0,0 @@
diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.31.1/bfd/elf64-s390.c
--- binutils.orig/bfd/elf64-s390.c 2018-07-19 12:37:28.107030007 +0100
+++ binutils-2.31.1/bfd/elf64-s390.c 2018-07-19 12:38:11.235548717 +0100
@@ -481,7 +481,7 @@ elf_s390_is_local_label_name (bfd *abfd,
#define RELA_ENTRY_SIZE sizeof (Elf64_External_Rela)
-/* The first three entries in a procedure linkage table are reserved,
+/* The first three entries in a global offset table are reserved,
and the initial contents are unimportant (we zero them out).
Subsequent entries look like this. See the SVR4 ABI 386
supplement to see how this works. */
@@ -511,8 +511,8 @@ elf_s390_is_local_label_name (bfd *abfd,
LG 1,0(1) # 6 bytes Load address from GOT in r1
BCR 15,1 # 2 bytes Jump to address
RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
- LGF 1,12(1) # 6 bytes Load offset in symbl table in r1
- BRCL 15,-x # 6 bytes Jump to start of PLT
+ LGF 1,12(1) # 6 bytes Load rela.plt offset into r1
+ BRCL 15,-x # 6 bytes Jump to first PLT entry
.long ? # 4 bytes offset into .rela.plt
Total = 32 bytes per PLT entry
@@ -1605,8 +1605,7 @@ allocate_dynrelocs (struct elf_link_hash
/* Make room for this entry. */
s->size += PLT_ENTRY_SIZE;
- /* We also need to make an entry in the .got.plt section, which
- will be placed in the .got section by the linker script. */
+ /* We also need to make an entry in the .got.plt section. */
htab->elf.sgotplt->size += GOT_ENTRY_SIZE;
/* We also need to make an entry in the .rela.plt section. */
@@ -1831,6 +1830,20 @@ elf_s390_size_dynamic_sections (bfd *out
}
}
+ if (htab->elf.sgot && s390_gotplt_after_got_p (info))
+ {
+ /* _bfd_elf_create_got_section adds the got header size always
+ to .got.plt but we need it in .got if this section comes
+ first. */
+ htab->elf.sgot->size += 3 * GOT_ENTRY_SIZE;
+ htab->elf.sgotplt->size -= 3 * GOT_ENTRY_SIZE;
+
+ /* Make the _GLOBAL_OFFSET_TABLE_ symbol point to the .got
+ instead of .got.plt. */
+ htab->elf.hgot->root.u.def.section = htab->elf.sgot;
+ htab->elf.hgot->root.u.def.value = 0;
+ }
+
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
@@ -2131,7 +2144,6 @@ elf_s390_relocate_section (bfd *output_b
bfd_boolean unresolved_reloc;
bfd_reloc_status_type r;
int tls_type;
- asection *base_got = htab->elf.sgot;
bfd_boolean resolved_to_zero;
r_type = ELF64_R_TYPE (rel->r_info);
@@ -2172,7 +2184,7 @@ elf_s390_relocate_section (bfd *output_b
case R_390_PLTOFF16:
case R_390_PLTOFF32:
case R_390_PLTOFF64:
- relocation -= htab->elf.sgot->output_section->vma;
+ relocation -= s390_got_pointer (info);
break;
case R_390_GOTPLT12:
case R_390_GOTPLT16:
@@ -2192,10 +2204,10 @@ elf_s390_relocate_section (bfd *output_b
htab->elf.sgot->contents +
local_got_offsets[r_symndx]);
relocation = (local_got_offsets[r_symndx] +
- htab->elf.sgot->output_offset);
+ s390_got_offset (info));
if (r_type == R_390_GOTENT || r_type == R_390_GOTPLTENT)
- relocation += htab->elf.sgot->output_section->vma;
+ relocation += s390_got_pointer (info);
break;
}
default:
@@ -2254,25 +2266,23 @@ elf_s390_relocate_section (bfd *output_b
if (s390_is_ifunc_symbol_p (h))
{
+ /* Entry indices of .iplt and .igot.plt match
+ 1:1. No magic PLT first entry here. */
plt_index = h->plt.offset / PLT_ENTRY_SIZE;
- relocation = (plt_index * GOT_ENTRY_SIZE +
- htab->elf.igotplt->output_offset);
- if (r_type == R_390_GOTPLTENT)
- relocation += htab->elf.igotplt->output_section->vma;
+ relocation = (plt_index * GOT_ENTRY_SIZE
+ + s390_gotplt_offset (info)
+ + htab->elf.igotplt->output_offset);
}
else
{
- /* Calc. index no.
- Current offset - size first entry / entry size. */
- plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) /
- PLT_ENTRY_SIZE;
-
- /* Offset in GOT is PLT index plus GOT headers(3)
- times 8, addr & GOT addr. */
- relocation = (plt_index + 3) * GOT_ENTRY_SIZE;
- if (r_type == R_390_GOTPLTENT)
- relocation += htab->elf.sgot->output_section->vma;
+ plt_index = ((h->plt.offset - PLT_FIRST_ENTRY_SIZE)
+ / PLT_ENTRY_SIZE);
+
+ relocation = (plt_index * GOT_ENTRY_SIZE
+ + s390_gotplt_offset (info));
}
+ if (r_type == R_390_GOTPLTENT)
+ relocation += s390_got_pointer (info);
unresolved_reloc = FALSE;
break;
}
@@ -2286,7 +2296,7 @@ elf_s390_relocate_section (bfd *output_b
case R_390_GOTENT:
/* Relocation is to the entry for this symbol in the global
offset table. */
- if (base_got == NULL)
+ if (htab->elf.sgot == NULL)
abort ();
if (h != NULL)
@@ -2303,8 +2313,19 @@ elf_s390_relocate_section (bfd *output_b
{
/* No explicit GOT usage so redirect to the
got.iplt slot. */
- base_got = htab->elf.igotplt;
- off = h->plt.offset / PLT_ENTRY_SIZE * GOT_ENTRY_SIZE;
+ relocation = (s390_gotplt_offset (info)
+ + htab->elf.igotplt->output_offset
+ + (h->plt.offset / PLT_ENTRY_SIZE
+ * GOT_ENTRY_SIZE));
+
+ /* For @GOTENT the relocation is against the offset between
+ the instruction and the symbols entry in the GOT and not
+ between the start of the GOT and the symbols entry. We
+ add the vma of the GOT to get the correct value. */
+ if (r_type == R_390_GOTENT || r_type == R_390_GOTPLTENT)
+ relocation += s390_got_pointer (info);
+
+ break;
}
else
{
@@ -2337,7 +2358,7 @@ elf_s390_relocate_section (bfd *output_b
else
{
bfd_put_64 (output_bfd, relocation,
- base_got->contents + off);
+ htab->elf.sgot->contents + off);
h->got.offset |= 1;
}
@@ -2419,7 +2440,7 @@ elf_s390_relocate_section (bfd *output_b
if (off >= (bfd_vma) -2)
abort ();
- relocation = base_got->output_offset + off;
+ relocation = s390_got_offset (info) + off;
/* For @GOTENT the relocation is against the offset between
the instruction and the symbols entry in the GOT and not
@@ -2427,7 +2448,7 @@ elf_s390_relocate_section (bfd *output_b
add the vma of the GOT to get the correct value. */
if ( r_type == R_390_GOTENT
|| r_type == R_390_GOTPLTENT)
- relocation += base_got->output_section->vma;
+ relocation += s390_got_pointer (info);
break;
@@ -2445,22 +2466,17 @@ elf_s390_relocate_section (bfd *output_b
relocation = (htab->elf.iplt->output_section->vma
+ htab->elf.iplt->output_offset
+ h->plt.offset
- - htab->elf.sgot->output_section->vma);
+ - s390_got_pointer (info));
goto do_relocation;
}
- /* Note that sgot->output_offset is not involved in this
- calculation. We always want the start of .got. If we
- defined _GLOBAL_OFFSET_TABLE in a different way, as is
- permitted by the ABI, we might have to change this
- calculation. */
- relocation -= htab->elf.sgot->output_section->vma;
+ relocation -= s390_got_pointer (info);
break;
case R_390_GOTPC:
case R_390_GOTPCDBL:
/* Use global offset table as symbol value. */
- relocation = htab->elf.sgot->output_section->vma;
+ relocation = s390_got_pointer (info);
unresolved_reloc = FALSE;
break;
@@ -2509,7 +2525,7 @@ elf_s390_relocate_section (bfd *output_b
|| h->plt.offset == (bfd_vma) -1
|| (htab->elf.splt == NULL && !s390_is_ifunc_symbol_p (h)))
{
- relocation -= htab->elf.sgot->output_section->vma;
+ relocation -= s390_got_pointer (info);
break;
}
@@ -2517,12 +2533,12 @@ elf_s390_relocate_section (bfd *output_b
relocation = (htab->elf.iplt->output_section->vma
+ htab->elf.iplt->output_offset
+ h->plt.offset
- - htab->elf.sgot->output_section->vma);
+ - s390_got_pointer (info));
else
relocation = (htab->elf.splt->output_section->vma
+ htab->elf.splt->output_offset
+ h->plt.offset
- - htab->elf.sgot->output_section->vma);
+ - s390_got_pointer (info));
unresolved_reloc = FALSE;
break;
@@ -3296,7 +3312,7 @@ elf_s390_finish_dynamic_symbol (bfd *out
if (h->plt.offset != (bfd_vma) -1)
{
bfd_vma plt_index;
- bfd_vma got_offset;
+ bfd_vma gotplt_offset;
Elf_Internal_Rela rela;
bfd_byte *loc;
@@ -3325,18 +3341,25 @@ elf_s390_finish_dynamic_symbol (bfd *out
Current offset - size first entry / entry size. */
plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE;
- /* Offset in GOT is PLT index plus GOT headers(3) times 8,
- addr & GOT addr. */
- got_offset = (plt_index + 3) * GOT_ENTRY_SIZE;
+ /* The slots in the .got.plt correspond to the PLT slots in
+ the same order. */
+ gotplt_offset = plt_index * GOT_ENTRY_SIZE;
+
+ /* If .got.plt comes first it needs to contain the 3 header
+ entries. */
+ if (!s390_gotplt_after_got_p (info))
+ gotplt_offset += 3 * GOT_ENTRY_SIZE;
/* Fill in the blueprint of a PLT. */
memcpy (htab->elf.splt->contents + h->plt.offset, elf_s390x_plt_entry,
PLT_ENTRY_SIZE);
- /* Fixup the relative address to the GOT entry */
+ /* The first instruction in the PLT entry is a LARL loading
+ the address of the GOT slot. We write the 4 byte
+ immediate operand of the LARL instruction here. */
bfd_put_32 (output_bfd,
(htab->elf.sgotplt->output_section->vma +
- htab->elf.sgotplt->output_offset + got_offset
+ htab->elf.sgotplt->output_offset + gotplt_offset
- (htab->elf.splt->output_section->vma +
htab->elf.splt->output_offset +
h->plt.offset))/2,
@@ -3356,12 +3379,12 @@ elf_s390_finish_dynamic_symbol (bfd *out
+ htab->elf.splt->output_offset
+ h->plt.offset
+ 14),
- htab->elf.sgotplt->contents + got_offset);
+ htab->elf.sgotplt->contents + gotplt_offset);
/* Fill in the entry in the .rela.plt section. */
rela.r_offset = (htab->elf.sgotplt->output_section->vma
+ htab->elf.sgotplt->output_offset
- + got_offset);
+ + gotplt_offset);
rela.r_info = ELF64_R_INFO (h->dynindx, R_390_JMP_SLOT);
rela.r_addend = 0;
loc = htab->elf.srelplt->contents + plt_index *
@@ -3568,8 +3591,8 @@ elf_s390_finish_dynamic_sections (bfd *o
continue;
case DT_PLTGOT:
- s = htab->elf.sgotplt;
- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ /* DT_PLTGOT matches _GLOBAL_OFFSET_TABLE_ */
+ dyn.d_un.d_ptr = s390_got_pointer (info);
break;
case DT_JMPREL:
@@ -3606,10 +3629,11 @@ elf_s390_finish_dynamic_sections (bfd *o
/* fill in blueprint for plt 0 entry */
memcpy (htab->elf.splt->contents, elf_s390x_first_plt_entry,
PLT_FIRST_ENTRY_SIZE);
- /* Fixup relative address to start of GOT */
+ /* The second instruction in the first PLT entry is a LARL
+ loading the GOT pointer. Fill in the LARL immediate
+ address. */
bfd_put_32 (output_bfd,
- (htab->elf.sgotplt->output_section->vma
- + htab->elf.sgotplt->output_offset
+ (s390_got_pointer (info)
- htab->elf.splt->output_section->vma
- htab->elf.splt->output_offset - 6)/2,
htab->elf.splt->contents + 8);
@@ -3619,21 +3643,22 @@ elf_s390_finish_dynamic_sections (bfd *o
= PLT_ENTRY_SIZE;
}
- if (htab->elf.sgotplt)
+ if (htab->elf.hgot && htab->elf.hgot->root.u.def.section)
{
/* Fill in the first three entries in the global offset table. */
- if (htab->elf.sgotplt->size > 0)
+ if (htab->elf.hgot->root.u.def.section->size > 0)
{
bfd_put_64 (output_bfd,
(sdyn == NULL ? (bfd_vma) 0
: sdyn->output_section->vma + sdyn->output_offset),
- htab->elf.sgotplt->contents);
+ htab->elf.hgot->root.u.def.section->contents);
/* One entry for shared object struct ptr. */
- bfd_put_64 (output_bfd, (bfd_vma) 0, htab->elf.sgotplt->contents + 8);
+ bfd_put_64 (output_bfd, (bfd_vma) 0,
+ htab->elf.hgot->root.u.def.section->contents + 8);
/* One entry for _dl_runtime_resolve. */
- bfd_put_64 (output_bfd, (bfd_vma) 0, htab->elf.sgotplt->contents + 16);
+ bfd_put_64 (output_bfd, (bfd_vma) 0,
+ htab->elf.hgot->root.u.def.section->contents + 16);
}
-
elf_section_data (htab->elf.sgot->output_section)
->this_hdr.sh_entsize = 8;
}
diff -rup binutils.orig/bfd/elf-s390-common.c binutils-2.31.1/bfd/elf-s390-common.c
--- binutils.orig/bfd/elf-s390-common.c 2018-07-19 12:37:28.113029940 +0100
+++ binutils-2.31.1/bfd/elf-s390-common.c 2018-07-19 12:38:11.235548717 +0100
@@ -30,6 +30,87 @@ s390_is_ifunc_symbol_p (struct elf_link_
return h->type == STT_GNU_IFUNC || eh->ifunc_resolver_address != 0;
}
+/* Return true if .got.plt is supposed to be emitted after .got. */
+
+static inline bfd_boolean
+s390_gotplt_after_got_p (struct bfd_link_info *info)
+{
+ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info);
+
+ if (!htab->elf.sgot || !htab->elf.sgotplt)
+ return TRUE;
+
+ if (htab->elf.sgot->output_section == htab->elf.sgotplt->output_section)
+ {
+ if (htab->elf.sgot->output_offset < htab->elf.sgotplt->output_offset)
+ return TRUE;
+ }
+ else
+ {
+ if (htab->elf.sgot->output_section->vma
+ <= htab->elf.sgotplt->output_section->vma)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/* Return the value of the _GLOBAL_OFFSET_TABLE_ symbol. */
+
+static inline bfd_vma
+s390_got_pointer (struct bfd_link_info *info)
+{
+ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info);
+ bfd_vma got_pointer;
+
+ BFD_ASSERT (htab && htab->elf.hgot);
+
+ got_pointer = (htab->elf.hgot->root.u.def.section->output_section->vma
+ + htab->elf.hgot->root.u.def.section->output_offset);
+ /* Our ABI requires the GOT pointer to point at the very beginning
+ of the global offset table. */
+ BFD_ASSERT (got_pointer
+ <= (htab->elf.sgot->output_section->vma
+ + htab->elf.sgot->output_offset));
+ BFD_ASSERT (got_pointer
+ <= (htab->elf.sgotplt->output_section->vma
+ + htab->elf.sgotplt->output_offset));
+
+ return got_pointer;
+}
+
+
+/* Return the offset of the .got versus _GLOBAL_OFFSET_TABLE_. */
+
+static inline bfd_vma
+s390_got_offset (struct bfd_link_info *info)
+{
+ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info);
+
+ /* The absolute address of the .got in the target image. */
+ bfd_vma got_address = (htab->elf.sgot->output_section->vma
+ + htab->elf.sgot->output_offset);
+
+ /* GOT offset must not be negative. */
+ BFD_ASSERT (s390_got_pointer (info) <= got_address);
+ return got_address - s390_got_pointer (info);
+}
+
+/* Return the offset of the .got.plt versus _GLOBAL_OFFSET_TABLE_. */
+
+static inline bfd_vma
+s390_gotplt_offset (struct bfd_link_info *info)
+{
+ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info);
+
+ /* The absolute address of the .got.plt in the target image. */
+ bfd_vma gotplt_address = (htab->elf.sgotplt->output_section->vma
+ + htab->elf.sgotplt->output_offset);
+
+ /* GOT offset must not be negative. */
+ BFD_ASSERT (s390_got_pointer (info) <= gotplt_address);
+ return gotplt_address - s390_got_pointer (info);
+}
+
/* Create sections needed by STT_GNU_IFUNC symbol. */
static bfd_boolean
diff -rup binutils.orig/ld/emulparams/elf64_s390.sh binutils-2.31.1/ld/emulparams/elf64_s390.sh
--- binutils.orig/ld/emulparams/elf64_s390.sh 2018-07-19 12:37:28.544025130 +0100
+++ binutils-2.31.1/ld/emulparams/elf64_s390.sh 2018-07-19 12:38:11.235548717 +0100
@@ -11,9 +11,12 @@ NOP=0x07070707
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
+GENERATE_RELRO_SCRIPT=yes
NO_SMALL_DATA=yes
EXTRA_EM_FILE=s390
IREL_IN_PLT=
+SEPARATE_GOTPLT=0
+test -z "$RELRO" && unset SEPARATE_GOTPLT
# Treat a host that matches the target with the possible exception of "x"
# in the name as if it were native.
diff -rup binutils.orig/ld/emultempl/elf32.em binutils-2.31.1/ld/emultempl/elf32.em
--- binutils.orig/ld/emultempl/elf32.em 2018-07-19 12:37:28.549025074 +0100
+++ binutils-2.31.1/ld/emultempl/elf32.em 2018-07-19 12:37:39.041907980 +0100
@@ -2376,17 +2376,41 @@ echo ' && link_info.combrelo
echo ' && link_info.relro' >> e${EMULATION_NAME}.c
echo ' && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xdw >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c
+echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c
+echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xdceo >> e${EMULATION_NAME}.c
+fi
echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c
echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c
echo ' && link_info.combreloc) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xdce >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c
+echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xdco >> e${EMULATION_NAME}.c
+fi
echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c
echo ' && link_info.combreloc) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xdc >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c
+echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xdeo >> e${EMULATION_NAME}.c
+fi
fi
echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c
echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xde >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xdo >> e${EMULATION_NAME}.c
+fi
echo ' ; else if (bfd_link_pie (&link_info)) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xd >> e${EMULATION_NAME}.c
fi
@@ -2402,17 +2426,41 @@ echo ' && link_info.combrelo
echo ' && link_info.relro' >> e${EMULATION_NAME}.c
echo ' && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xsw >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c
+echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c
+echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xsceo >> e${EMULATION_NAME}.c
+fi
echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c
echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c
echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xsce >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c
+echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xsco >> e${EMULATION_NAME}.c
+fi
echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c
echo ' && link_info.combreloc) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xsc >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c
+echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xseo >> e${EMULATION_NAME}.c
+fi
fi
echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c
echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xse >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xso >> e${EMULATION_NAME}.c
+fi
echo ' ; else if (bfd_link_dll (&link_info)) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c
fi
@@ -2425,14 +2473,34 @@ echo ' ; else if (link_info.combreloc'
echo ' && link_info.relro' >> e${EMULATION_NAME}.c
echo ' && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xw >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (link_info.combreloc' >> e${EMULATION_NAME}.c
+echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xceo >> e${EMULATION_NAME}.c
+fi
echo ' ; else if (link_info.combreloc' >> e${EMULATION_NAME}.c
echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xce >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (link_info.combreloc' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xco >> e${EMULATION_NAME}.c
+fi
echo ' ; else if (link_info.combreloc) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xc >> e${EMULATION_NAME}.c
fi
-echo ' ; else if (link_info.separate_code) return' >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (link_info.separate_code' >> e${EMULATION_NAME}.c
+echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xeo >> e${EMULATION_NAME}.c
+fi
+echo ' ; else if (link_info.separate_code) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xe >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+echo ' ; else if (link_info.relro) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xo >> e${EMULATION_NAME}.c
+fi
echo ' ; else return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
echo '; }' >> e${EMULATION_NAME}.c
@@ -2471,6 +2539,21 @@ fragment <<EOF
else
return "ldscripts/${EMULATION_NAME}.xdw";
}
+EOF
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+ else if (bfd_link_pie (&link_info)
+ && link_info.combreloc
+ && link_info.relro)
+ {
+ if (link_info.separate_code)
+ return "ldscripts/${EMULATION_NAME}.xdceo";
+ else
+ return "ldscripts/${EMULATION_NAME}.xdco";
+ }
+EOF
+fi
+fragment <<EOF
else if (bfd_link_pie (&link_info)
&& link_info.combreloc)
{
@@ -2481,6 +2564,18 @@ fragment <<EOF
}
EOF
fi
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+ else if (bfd_link_pie (&link_info)
+ && link_info.relro)
+ {
+ if (link_info.separate_code)
+ return "ldscripts/${EMULATION_NAME}.xdeo";
+ else
+ return "ldscripts/${EMULATION_NAME}.xdo";
+ }
+EOF
+fi
fragment <<EOF
else if (bfd_link_pie (&link_info))
{
@@ -2502,6 +2597,21 @@ fragment <<EOF
else
return "ldscripts/${EMULATION_NAME}.xsw";
}
+EOF
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+ else if (bfd_link_dll (&link_info)
+ && link_info.combreloc
+ && link_info.relro)
+ {
+ if (link_info.separate_code)
+ return "ldscripts/${EMULATION_NAME}.xsceo";
+ else
+ return "ldscripts/${EMULATION_NAME}.xsco";
+ }
+EOF
+fi
+fragment <<EOF
else if (bfd_link_dll (&link_info) && link_info.combreloc)
{
if (link_info.separate_code)
@@ -2511,6 +2621,18 @@ fragment <<EOF
}
EOF
fi
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+ else if (bfd_link_dll (&link_info)
+ && link_info.relro)
+ {
+ if (link_info.separate_code)
+ return "ldscripts/${EMULATION_NAME}.xseo";
+ else
+ return "ldscripts/${EMULATION_NAME}.xso";
+ }
+EOF
+fi
fragment <<EOF
else if (bfd_link_dll (&link_info))
{
@@ -2531,6 +2653,20 @@ fragment <<EOF
else
return "ldscripts/${EMULATION_NAME}.xw";
}
+EOF
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+ else if (link_info.combreloc
+ && link_info.relro)
+ {
+ if (link_info.separate_code)
+ return "ldscripts/${EMULATION_NAME}.xceo";
+ else
+ return "ldscripts/${EMULATION_NAME}.xco";
+ }
+EOF
+fi
+fragment <<EOF
else if (link_info.combreloc)
{
if (link_info.separate_code)
@@ -2540,6 +2676,17 @@ fragment <<EOF
}
EOF
fi
+if test -n "$GENERATE_RELRO_SCRIPT" ; then
+fragment <<EOF
+ else if (link_info.relro)
+ {
+ if (link_info.separate_code)
+ return "ldscripts/${EMULATION_NAME}.xeo";
+ else
+ return "ldscripts/${EMULATION_NAME}.xo";
+ }
+EOF
+fi
fragment <<EOF
else
{
diff -rup binutils.orig/ld/genscripts.sh binutils-2.31.1/ld/genscripts.sh
--- binutils.orig/ld/genscripts.sh 2018-07-19 12:37:28.540025175 +0100
+++ binutils-2.31.1/ld/genscripts.sh 2018-07-19 12:37:39.041907980 +0100
@@ -306,6 +306,20 @@ LD_FLAG=textonly
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xe
+if test -n "$GENERATE_RELRO_SCRIPT"; then
+ LD_FLAG=
+ RELRO=" "
+ ( echo "/* Script for -z relo: generate normal executables with separate code segment */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xo
+ LD_FLAG=textonly
+ ( echo "/* Script for -z separate-code -z relo: generate normal executables with separate code segment */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xeo
+ unset RELRO
+fi
LD_FLAG=n
DATA_ALIGNMENT=${DATA_ALIGNMENT_n}
( echo "/* Script for -n: mix text and data on same page */"
@@ -353,6 +367,25 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT";
rm -f ${COMBRELOC}
COMBRELOC=
unset RELRO_NOW
+ if test -n "$GENERATE_RELRO_SCRIPT"; then
+ LD_FLAG=c
+ RELRO=" "
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xco.tmp
+ ( echo "/* Script for -z combreloc -z relro: combine and sort reloc sections */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xco
+ rm -f ${COMBRELOC}
+ LD_FLAG=ctextonly
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xceo.tmp
+ ( echo "/* Script for -z combreloc -z separate-code -z relro: combine and sort reloc sections */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xceo
+ rm -f ${COMBRELOC}
+ COMBRELOC=
+ unset RELRO
+ fi
fi
if test -n "$GENERATE_SHLIB_SCRIPT"; then
@@ -370,6 +403,23 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; the
. ${CUSTOMIZER_SCRIPT}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xse
+
+ if test -n "$GENERATE_RELRO_SCRIPT"; then
+ RELRO=" "
+ LD_FLAG=shared
+ (
+ echo "/* Script for ld --shared -z relro: link shared library */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xso
+ LD_FLAG=sharedtextonly
+ (
+ echo "/* Script for ld --shared -z relro -z separate-code: link shared library with separate code segment */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xseo
+ unset RELRO
+ fi
if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}}
LD_FLAG=cshared
@@ -401,8 +451,27 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; the
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xswe
rm -f ${COMBRELOC}
- COMBRELOC=
unset RELRO_NOW
+
+ if test -n "$GENERATE_RELRO_SCRIPT"; then
+ LD_FLAG=wshared
+ RELRO=" "
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xsco.tmp
+ ( echo "/* Script for --shared -z combreloc -z relro: shared library, combine & sort relocs with separate code segment */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsco
+ rm -f ${COMBRELOC}
+ LD_FLAG=wsharedtextonly
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xsceo.tmp
+ ( echo "/* Script for --shared -z combreloc -z relro -z separate-code: shared library, combine & sort relocs with separate code segment */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsceo
+ rm -f ${COMBRELOC}
+ unset RELRO
+ fi
+ COMBRELOC=
fi
unset CREATE_SHLIB
fi
@@ -422,6 +491,22 @@ if test -n "$GENERATE_PIE_SCRIPT"; then
. ${CUSTOMIZER_SCRIPT}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xde
+ if test -n "$GENERATE_RELRO_SCRIPT"; then
+ RELRO=" "
+ LD_FLAG=pie
+ (
+ echo "/* Script for ld -pie -z relro: link position independent executable */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdo
+ LD_FLAG=pietextonly
+ (
+ echo "/* Script for ld -pie -z relro -z separate-code: link position independent executable with separate code segment */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdeo
+ unset RELRO
+ fi
if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}}
COMBRELOC=ldscripts/${EMULATION_NAME}.xdc.tmp
@@ -453,8 +538,28 @@ if test -n "$GENERATE_PIE_SCRIPT"; then
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdwe
rm -f ${COMBRELOC}
- COMBRELOC=
unset RELRO_NOW
+
+ if test -n "$GENERATE_RELRO_SCRIPT"; then
+ LD_FLAG=wpie
+ RELRO=" "
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xdco.tmp
+ ( echo "/* Script for -pie -z combreloc -z relro: position independent executable, combine & sort relocs with separate code segment */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdco
+ rm -f ${COMBRELOC}
+ LD_FLAG=wpietextonly
+ COMBRELOC=ldscripts/${EMULATION_NAME}.xdceo.tmp
+ ( echo "/* Script for -pie -z combreloc -z relro -z separate-code: position independent executable, combine & sort relocs with separate code segment */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdceo
+ rm -f ${COMBRELOC}
+
+ unset RELRO
+ fi
+ COMBRELOC=
fi
unset CREATE_PIE
fi
Only in binutils.orig/ld/testsuite/ld-s390: gotreloc_64-1.dd
Only in binutils-2.31.1/ld/testsuite/ld-s390: gotreloc_64-norelro-1.dd
Only in binutils-2.31.1/ld/testsuite/ld-s390: gotreloc_64-relro-1.dd
diff -rup binutils.orig/ld/testsuite/ld-s390/s390.exp binutils-2.31.1/ld/testsuite/ld-s390/s390.exp
--- binutils.orig/ld/testsuite/ld-s390/s390.exp 2018-07-19 12:37:28.498025644 +0100
+++ binutils-2.31.1/ld/testsuite/ld-s390/s390.exp 2018-07-19 12:38:11.236548705 +0100
@@ -70,10 +70,15 @@ set s390xtests {
{{readelf -WSsrl tlsbin_64.rd} {objdump -dzrj.text tlsbin_64.dd}
{objdump -sj.got tlsbin_64.sd} {objdump -sj.tdata tlsbin_64.td}}
"tlsbin_64"}
- {"GOT: symbol address load from got to larl"
- "-shared -melf64_s390 --hash-style=sysv --version-script=gotreloc-1.ver" ""
+ {"GOT: norelro symbol address load from got to larl"
+ "-shared -melf64_s390 -z norelro --hash-style=sysv --version-script=gotreloc-1.ver" ""
"-m64" {gotreloc-1.s}
- {{objdump -dzrj.text gotreloc_64-1.dd}}
+ {{objdump -dzrj.text gotreloc_64-norelro-1.dd}}
+ "gotreloc_64-1"}
+ {"GOT: relro symbol address load from got to larl"
+ "-shared -melf64_s390 -z relro --hash-style=sysv --version-script=gotreloc-1.ver" ""
+ "-m64" {gotreloc-1.s}
+ {{objdump -dzrj.text gotreloc_64-relro-1.dd}}
"gotreloc_64-1"}
{"PLT: offset test"
"-shared -m elf64_s390 -dT pltoffset-1.ld" ""

View File

@ -74,8 +74,8 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.31.1
Release: 23%{?dist}
Version: 2.32
Release: 1%{?dist}
License: GPLv3+
URL: https://sourceware.org/binutils
@ -106,7 +106,7 @@ Patch02: binutils-2.25-version.patch
# Purpose: Exports the demangle.h header file (associated with the libiberty
# sources) with the binutils-devel rpm.
# Lifetime: Permanent. This is a RHEL/Fedora specific patch.
Patch03: binutils-2.31-export-demangle.h.patch
Patch03: binutils-export-demangle.h.patch
# Purpose: Disables the check in the BFD library's bfd.h header file that
# config.h has been included before the bfd.h header. See BZ
@ -126,7 +126,7 @@ Patch04: binutils-2.22.52.0.4-no-config-h-check.patch
# making it better (IMHO) but also potentially breaking tools that
# depend upon readelf's current format. Hence it remains a local
# patch.
Patch06: binutils-2.29-filename-in-error-messages.patch
Patch05: binutils-2.29-filename-in-error-messages.patch
# Purpose: Disable an x86/x86_64 optimization that moves functions from the
# PLT into the GOTPLT for faster access. This optimization is
@ -134,7 +134,7 @@ Patch06: binutils-2.29-filename-in-error-messages.patch
# as ltrace and LD_AUDIT. See BZs 1452111 and 1333481.
# Lifetime: Permanent. But it should not be.
# FIXME: Replace with a configure time option.
Patch07: binutils-2.29-revert-PLT-elision.patch
Patch06: binutils-2.29-revert-PLT-elision.patch
# Purpose: Changes readelf so that when it displays extra information about
# a symbol, this information is placed at the end of the line.
@ -142,88 +142,31 @@ Patch07: binutils-2.29-revert-PLT-elision.patch
# FIXME: The proper fix would be to update the scripts that are expecting
# a fixed output from readelf. But it seems that some of them are
# no longer being maintained.
Patch08: binutils-readelf-other-sym-info.patch
Patch07: binutils-readelf-other-sym-info.patch
# Purpose: Do not create PLT entries for AARCH64 IFUNC symbols referenced in
# debug sections.
# Lifetime: Permanent.
# FIXME: Find related bug. Decide on permanency.
Patch09: binutils-2.27-aarch64-ifunc.patch
# Purpose: Fix linker testsuite failures
# Lifetime: Fixed in 2.32 (probably)
Patch10: binutils-fix-testsuite-failures.patch
# Purpose: Revert fix for PR 23161 which was placing unversioned section
# symbols (_edata, _end, __bss_start) into shared libraries.
# See also PR 23499 and BZ 1614920
# Lifetime: Fixed in 2.32
# Patch11: binutils-do-not-provide-shared-section-symbols.patch
Patch11: binutils-clear-version-info.patch
# Purpose: Stop gold from complaining about relocs in the .gnu.build.attribute
# section that reference symbols in discarded sections.
# Lifetime: Fixed in 2.32 (maybe)
Patch12: binutils-gold-ignore-discarded-note-relocs.patch
# Purpose: Improve partial relro support for 64-bit s/390.
# Lifetime: Fixed in 2.32
Patch13: binutils-s390-partial-relro.patch
# Purpose: Merge .gnu.build.attribute sections into a single section.
# Lifetime: Fixed in 2.32
Patch14: binutils-merge-attribute-sections.patch
# Purpose: Improve objcopy's --merge-notes option.
# Lifetime: Fixed in 2.32
Patch15: binutils-note-merge-improvements.patch
# Purpose: Detect and report corrupt symbol version information.
# Lifetime: Fixed in 2.32
Patch16: binutils-detect-corrupt-sym-version-info.patch
# Purpose: Delay the evaluation of linker script constants until
# after the configuration options have been set.
# Lifetime: Fixed in 2.32
Patch17: binutils-delay-ld-script-constant-eval.patch
# Purpose: Stop readelf's reports of gaps in build notes - they are unreliable.
# Lifetime: Unknown.
Patch18: binutils-disable-readelf-gap-reports.patch
Patch08: binutils-2.27-aarch64-ifunc.patch
# Purpose: Stop the binutils from statically linking with libstdc++.
# Lifetime: Permanent.
Patch20: binutils-do-not-link-with-static-libstdc++.patch
Patch09: binutils-do-not-link-with-static-libstdc++.patch
# Purpose: Add a .attach_to_group pseudo-op to the assembler for
# use by the annobin gcc plugin.
# Lifetime: Permanent.
Patch21: binutils-attach-to-group.patch
Patch10: binutils-attach-to-group.patch
# Purpose: Fix a potential buffer overrun when parsing a corrupt ELF file.
# Lifetime: Fixed in 2.32.
Patch22: binutils-CVE-2018-17358.patch
# Purpose: Stop gold from complaining about relocs in the .gnu.build.attribute
# section that reference symbols in discarded sections.
# Lifetime: Fixed in 2.33 (maybe)
Patch11: binutils-gold-ignore-discarded-note-relocs.patch
# Purpose: Allow OS specific sections in section groups.
# Lifetime: Might be fixed in 2.32
Patch23: binutils-special-sections-in-groups.patch
# Purpose: Stop gold from issuing warnings about dropped version
# information, unless explicitly requested otherwise.
# Lifetime: Fixed in 2.32
Patch24: binutils-gold-discard-version-info.patch
# Purpose: Fix a memory leak reading minisymbols.
# Lifetime: Fixed in 2.32
Patch25: binutils-CVE-2018-20002.patch
# Purpose: Fix assembler check for an output file matching an input file.
# Lifetime: Fixed in 2.32
Patch26: binutils-gas-input-matches-output.patch
# Purpose: Ensure that decompressed sections have the correct alignment.
# Lifetime: Fixed in 2.32
Patch27: binutils-alignment-of-decompressed-sections.patch
# Lifetime: Might be fixed in 2.33
Patch12: binutils-special-sections-in-groups.patch
#----------------------------------------------------------------------------
@ -348,6 +291,7 @@ using libelf instead of BFD.
%patch02 -p1
%patch03 -p1
%patch04 -p1
%patch05 -p1
%patch06 -p1
%patch07 -p1
%patch08 -p1
@ -355,20 +299,6 @@ using libelf instead of BFD.
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
# FIXME - this is no longer true. Maybe try reinstating autotool use ?
@ -770,6 +700,25 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Wed Feb 20 2019 Nick Clifton <nickc@redhat.com> - 2.32-1
- Rebase to GNU Binutils 2.32
- Retire: binutils-s390-partial-relro.patch
- Retire: binutils-note-merge-improvements.patch
- Retire: Retire: binutils-merge-attribute-sections.patch
- Retire: binutils-gold-discard-version-info.patch
- Retire: binutils-gas-input-matches-output.patch
- Retire: binutils-fix-testsuite-failures.patch
- Retire: binutils-do-not-provide-shared-section-symbols.patch
- Retire: binutils-disable-readelf-gap-reports.patch
- Retire: binutils-detect-corrupt-sym-version-info.patch
- Retire: binutils-delay-ld-script-constant-eval.patch
- Retire: binutils-clear-version-info.patch
- Retire: binutils-CVE-2018-20002.patch
- Retire: binutils-CVE-2018-17358.patch
- Retire: binutils-2.31-export-demangle.h.patch
- Retire: binutils-2.28-ignore-gold-duplicates.patch
- Retire: binutils-2.26-lto.patch
* Mon Feb 18 2019 Nick Clifton <nickc@redhat.com> - 2.31.1-23
- Ensure that decompressed sections have the correct alignment. (#1678204)

View File

@ -1 +1,2 @@
SHA512 (binutils-2.31.1.tar.xz) = 0fca326feb1d5f5fe505a827b20237fe3ec9c13eaf7ec7e35847fd71184f605ba1cefe1314b1b8f8a29c0aa9d88162849ee1c1a3e70c2f7407d88339b17edb30
SHA512 (binutils-2.32.tar.xz) = d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a
SHA512 (binutils-2.19.50.0.1-output-format.sed) = 2f8686b0c8af13c98cda056824c2820416f6e2d003f70b78ccf5314525b9ee3684d421dfa83e638a2d42d06ea4d4bdaf5226b64d6ec26f7ff59c44ffb2a23dd2