import binutils-2.30-73.el8

This commit is contained in:
CentOS Sources 2020-04-28 05:34:26 -04:00 committed by Andrew Lukoshko
parent 3273012749
commit 887ad2334b
10 changed files with 5480 additions and 7 deletions

View File

@ -0,0 +1,15 @@
--- binutils.orig/gold/fileread.cc 2019-11-08 10:33:58.911577903 +0000
+++ binutils-2.30/gold/fileread.cc 2019-11-08 10:34:13.001470092 +0000
@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_
ssize_t bytes;
if (this->whole_file_view_ != NULL)
{
+ // See PR 23765 for an example of a testcase that triggers this error.
+ if (((ssize_t) start) < 0)
+ gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
+ this->filename().c_str(),
+ static_cast<long long>(start));
+
bytes = this->size_ - start;
if (static_cast<section_size_type>(bytes) >= size)
{

View File

@ -0,0 +1,11 @@
--- binutils.orig/binutils/readelf.c 2019-08-13 10:03:33.518792590 +0100
+++ binutils-2.32/binutils/readelf.c 2019-08-13 10:04:22.885418269 +0100
@@ -13234,7 +13234,7 @@ apply_relocations (Filedata *
}
rloc = start + rp->r_offset;
- if ((rloc + reloc_size) > end || (rloc < start))
+ if (rloc >= end || (rloc + reloc_size) > end || (rloc < start))
{
warn (_("skipping invalid relocation offset 0x%lx in section %s\n"),
(unsigned long) rp->r_offset,

View File

@ -0,0 +1,62 @@
--- binutils.orig/bfd/dwarf2.c 2019-12-03 15:50:43.324118062 +0000
+++ binutils-2.30/bfd/dwarf2.c 2019-12-03 15:54:32.545489215 +0000
@@ -2803,8 +2803,8 @@ lookup_symbol_in_variable_table (struct
static bfd_boolean
find_abstract_instance_name (struct comp_unit *unit,
- bfd_byte *orig_info_ptr,
struct attribute *attr_ptr,
+ unsigned int recur_count,
const char **pname,
bfd_boolean *is_linkage)
{
@@ -2817,6 +2817,14 @@ find_abstract_instance_name (struct comp
struct attribute attr;
const char *name = NULL;
+ if (recur_count == 100)
+ {
+ _bfd_error_handler
+ (_("DWARF error: abstract instance recursion detected"));
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
/* DW_FORM_ref_addr can reference an entry in a different CU. It
is an offset from the .debug_info section, not the current CU. */
if (attr_ptr->form == DW_FORM_ref_addr)
@@ -2934,15 +2942,7 @@ find_abstract_instance_name (struct comp
info_ptr, info_ptr_end);
if (info_ptr == NULL)
break;
- /* It doesn't ever make sense for DW_AT_specification to
- refer to the same DIE. Stop simple recursion. */
- if (info_ptr == orig_info_ptr)
- {
- _bfd_error_handler
- (_("Dwarf Error: Abstract instance recursion detected."));
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
+
switch (attr.name)
{
case DW_AT_name:
@@ -2956,7 +2956,7 @@ find_abstract_instance_name (struct comp
}
break;
case DW_AT_specification:
- if (!find_abstract_instance_name (unit, info_ptr, &attr,
+ if (!find_abstract_instance_name (unit, &attr, recur_count + 1,
pname, is_linkage))
return FALSE;
break;
@@ -3162,7 +3162,7 @@ scan_unit_for_symbols (struct comp_unit
case DW_AT_abstract_origin:
case DW_AT_specification:
- if (!find_abstract_instance_name (unit, info_ptr, &attr,
+ if (!find_abstract_instance_name (unit, &attr, 0,
&func->name,
&func->is_linkage))
goto fail;

View File

@ -0,0 +1,20 @@
--- binutils.orig/bfd/dwarf2.c 2019-11-13 11:32:09.395430104 +0000
+++ binutils-2.33.1/bfd/dwarf2.c 2019-11-13 11:33:17.272899503 +0000
@@ -4440,7 +4440,16 @@ _bfd_dwarf2_slurp_debug_info (bfd *abfd,
for (total_size = 0;
msec;
msec = find_debug_info (debug_bfd, debug_sections, msec))
- total_size += msec->size;
+ {
+ /* Catch PR25070 testcase overflowing size calculation here. */
+ if (total_size + msec->size < total_size
+ || total_size + msec->size < msec->size)
+ {
+ bfd_set_error (bfd_error_no_memory);
+ return FALSE;
+ }
+ total_size += msec->size;
+ }
stash->info_ptr_memory = (bfd_byte *) bfd_malloc (total_size);
if (stash->info_ptr_memory == NULL)

View File

@ -0,0 +1,855 @@
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.32/bfd/elfnn-aarch64.c
--- binutils.orig/bfd/elfnn-aarch64.c 2019-07-02 17:30:19.407892712 +0100
+++ binutils-2.32/bfd/elfnn-aarch64.c 2019-07-02 17:35:21.874749884 +0100
@@ -2579,6 +2579,9 @@ struct elf_aarch64_link_hash_table
unsigned int top_index;
asection **input_list;
+ /* JUMP_SLOT relocs for variant PCS symbols may be present. */
+ int variant_pcs;
+
/* The offset into splt of the PLT entry for the TLS descriptor
resolver. Special values are 0, if not necessary (or not found
to be necessary yet), and -1 if needed but not determined
@@ -2790,6 +2793,31 @@ elfNN_aarch64_copy_indirect_symbol (stru
_bfd_elf_link_hash_copy_indirect (info, dir, ind);
}
+/* Merge non-visibility st_other attributes. */
+
+static void
+elfNN_aarch64_merge_symbol_attribute (struct elf_link_hash_entry *h,
+ const Elf_Internal_Sym *isym,
+ bfd_boolean definition ATTRIBUTE_UNUSED,
+ bfd_boolean dynamic ATTRIBUTE_UNUSED)
+{
+ unsigned int isym_sto = isym->st_other & ~ELF_ST_VISIBILITY (-1);
+ unsigned int h_sto = h->other & ~ELF_ST_VISIBILITY (-1);
+
+ if (isym_sto == h_sto)
+ return;
+
+ if (isym_sto & ~STO_AARCH64_VARIANT_PCS)
+ /* Not fatal, this callback cannot fail. */
+ _bfd_error_handler (_("unknown attribute for symbol `%s': 0x%02x"),
+ h->root.root.string, isym_sto);
+
+ /* Note: Ideally we would warn about any attribute mismatch, but
+ this api does not allow that without substantial changes. */
+ if (isym_sto & STO_AARCH64_VARIANT_PCS)
+ h->other |= STO_AARCH64_VARIANT_PCS;
+}
+
/* Destroy an AArch64 elf linker hash table. */
static void
@@ -8370,6 +8398,12 @@ elfNN_aarch64_allocate_dynrelocs (struct
updated. */
htab->root.srelplt->reloc_count++;
+
+ /* Mark the DSO in case R_<CLS>_JUMP_SLOT relocs against
+ variant PCS symbols are present. */
+ if (h->other & STO_AARCH64_VARIANT_PCS)
+ htab->variant_pcs = 1;
+
}
else
{
@@ -8958,6 +8992,10 @@ elfNN_aarch64_size_dynamic_sections (bfd
|| !add_dynamic_entry (DT_JMPREL, 0))
return FALSE;
+ if (htab->variant_pcs
+ && !add_dynamic_entry (DT_AARCH64_VARIANT_PCS, 0))
+ return FALSE;
+
if (htab->tlsdesc_plt
&& (!add_dynamic_entry (DT_TLSDESC_PLT, 0)
|| !add_dynamic_entry (DT_TLSDESC_GOT, 0)))
@@ -9708,6 +9746,9 @@ const struct elf_size_info elfNN_aarch64
#define elf_backend_copy_indirect_symbol \
elfNN_aarch64_copy_indirect_symbol
+#define elf_backend_merge_symbol_attribute \
+ elfNN_aarch64_merge_symbol_attribute
+
/* Create .dynbss, and .rela.bss sections in DYNOBJ, and set up shortcuts
to them in our hash. */
#define elf_backend_create_dynamic_sections \
diff -rup binutils.orig/binutils/readelf.c binutils-2.32/binutils/readelf.c
--- binutils.orig/binutils/readelf.c 2019-07-02 17:30:18.890896375 +0100
+++ binutils-2.32/binutils/readelf.c 2019-07-02 17:32:25.008002901 +0100
@@ -1797,6 +1797,19 @@ dump_relocations (Filedata * fi
}
static const char *
+get_aarch64_dynamic_type (unsigned long type)
+{
+ switch (type)
+ {
+ case DT_AARCH64_BTI_PLT: return "AARCH64_BTI_PLT";
+ case DT_AARCH64_PAC_PLT: return "AARCH64_PAC_PLT";
+ case DT_AARCH64_VARIANT_PCS: return "AARCH64_VARIANT_PCS";
+ default:
+ return NULL;
+ }
+}
+
+static const char *
get_mips_dynamic_type (unsigned long type)
{
switch (type)
@@ -2169,6 +2182,9 @@ get_dynamic_type (Filedata * filedata, u
switch (filedata->file_header.e_machine)
{
+ case EM_AARCH64:
+ result = get_aarch64_dynamic_type (type);
+ break;
case EM_MIPS:
case EM_MIPS_RS3_LE:
result = get_mips_dynamic_type (type);
@@ -11054,6 +11070,22 @@ get_solaris_symbol_visibility (unsigned
}
static const char *
+get_aarch64_symbol_other (unsigned int other)
+{
+ static char buf[32];
+
+ if (other & STO_AARCH64_VARIANT_PCS)
+ {
+ other &= ~STO_AARCH64_VARIANT_PCS;
+ if (other == 0)
+ return "VARIANT_PCS";
+ snprintf (buf, sizeof buf, "VARIANT_PCS | %x", other);
+ return buf;
+ }
+ return NULL;
+}
+
+static const char *
get_mips_symbol_other (unsigned int other)
{
switch (other)
@@ -11164,6 +11196,9 @@ get_symbol_other (Filedata * filedata, u
switch (filedata->file_header.e_machine)
{
+ case EM_AARCH64:
+ result = get_aarch64_symbol_other (other);
+ break;
case EM_MIPS:
result = get_mips_symbol_other (other);
break;
diff -rup binutils.orig/gas/config/tc-aarch64.c binutils-2.32/gas/config/tc-aarch64.c
--- binutils.orig/gas/config/tc-aarch64.c 2019-07-02 17:30:19.131894667 +0100
+++ binutils-2.32/gas/config/tc-aarch64.c 2019-07-02 17:35:45.202584620 +0100
@@ -1938,6 +1938,28 @@ s_aarch64_elf_cons (int nbytes)
demand_empty_rest_of_line ();
}
+/* Mark symbol that it follows a variant PCS convention. */
+
+static void
+s_variant_pcs (int ignored ATTRIBUTE_UNUSED)
+{
+ char *name;
+ char c;
+ symbolS *sym;
+ asymbol *bfdsym;
+ elf_symbol_type *elfsym;
+
+ c = get_symbol_name (&name);
+ if (!*name)
+ as_bad (_("Missing symbol name in directive"));
+ sym = symbol_find_or_make (name);
+ restore_line_pointer (c);
+ demand_empty_rest_of_line ();
+ bfdsym = symbol_get_bfdsym (sym);
+ elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
+ gas_assert (elfsym);
+ elfsym->internal_elf_sym.st_other |= STO_AARCH64_VARIANT_PCS;
+}
#endif /* OBJ_ELF */
/* Output a 32-bit word, but mark as an instruction. */
@@ -2084,6 +2106,7 @@ const pseudo_typeS md_pseudo_table[] = {
{"long", s_aarch64_elf_cons, 4},
{"xword", s_aarch64_elf_cons, 8},
{"dword", s_aarch64_elf_cons, 8},
+ {"variant_pcs", s_variant_pcs, 0},
#endif
{0, 0, 0}
};
@@ -9320,3 +9343,35 @@ aarch64_copy_symbol_attributes (symbolS
{
AARCH64_GET_FLAG (dest) = AARCH64_GET_FLAG (src);
}
+
+#ifdef OBJ_ELF
+/* Same as elf_copy_symbol_attributes, but without copying st_other.
+ This is needed so AArch64 specific st_other values can be independently
+ specified for an IFUNC resolver (that is called by the dynamic linker)
+ and the symbol it resolves (aliased to the resolver). In particular,
+ if a function symbol has special st_other value set via directives,
+ then attaching an IFUNC resolver to that symbol should not override
+ the st_other setting. Requiring the directive on the IFUNC resolver
+ symbol would be unexpected and problematic in C code, where the two
+ symbols appear as two independent function declarations. */
+
+void
+aarch64_elf_copy_symbol_attributes (symbolS *dest, symbolS *src)
+{
+ struct elf_obj_sy *srcelf = symbol_get_obj (src);
+ struct elf_obj_sy *destelf = symbol_get_obj (dest);
+ if (srcelf->size)
+ {
+ if (destelf->size == NULL)
+ destelf->size = XNEW (expressionS);
+ *destelf->size = *srcelf->size;
+ }
+ else
+ {
+ if (destelf->size != NULL)
+ free (destelf->size);
+ destelf->size = NULL;
+ }
+ S_SET_SIZE (dest, S_GET_SIZE (src));
+}
+#endif
diff -rup binutils.orig/gas/config/tc-aarch64.h binutils-2.32/gas/config/tc-aarch64.h
--- binutils.orig/gas/config/tc-aarch64.h 2019-07-02 17:30:19.136894632 +0100
+++ binutils-2.32/gas/config/tc-aarch64.h 2019-07-02 17:35:45.202584620 +0100
@@ -130,6 +130,12 @@ void aarch64_copy_symbol_attributes (sym
(aarch64_copy_symbol_attributes (DEST, SRC))
#endif
+#ifdef OBJ_ELF
+void aarch64_elf_copy_symbol_attributes (symbolS *, symbolS *);
+#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \
+ aarch64_elf_copy_symbol_attributes (DEST, SRC)
+#endif
+
#define TC_START_LABEL(STR, NUL_CHAR, NEXT_CHAR) \
(NEXT_CHAR == ':' || (NEXT_CHAR == '/' && aarch64_data_in_code ()))
#define tc_canonicalize_symbol_name(str) aarch64_canonicalize_symbol_name (str);
diff -rup binutils.orig/gas/doc/c-aarch64.texi binutils-2.32/gas/doc/c-aarch64.texi
--- binutils.orig/gas/doc/c-aarch64.texi 2019-07-02 17:30:19.125894710 +0100
+++ binutils-2.32/gas/doc/c-aarch64.texi 2019-07-02 17:35:11.362824354 +0100
@@ -425,6 +425,12 @@ should only be done if it is really nece
@c VVVVVVVVVVVVVVVVVVVVVVVVVV
+@cindex @code{.variant_pcs} directive, AArch64
+@item .variant_pcs @var{symbol}
+This directive marks @var{symbol} referencing a function that may
+follow a variant procedure call standard with different register
+usage convention from the base procedure call standard.
+
@c WWWWWWWWWWWWWWWWWWWWWWWWWW
@c XXXXXXXXXXXXXXXXXXXXXXXXXX
diff -rup binutils.orig/include/elf/aarch64.h binutils-2.32/include/elf/aarch64.h
--- binutils.orig/include/elf/aarch64.h 2019-07-02 17:30:18.850896658 +0100
+++ binutils-2.32/include/elf/aarch64.h 2019-07-02 17:32:55.678785616 +0100
@@ -36,6 +36,15 @@
#define SHF_COMDEF 0x80000000 /* Section may be multiply defined
in the input to a link step. */
+/* Processor specific dynamic array tags. */
+#define DT_AARCH64_BTI_PLT (DT_LOPROC + 1)
+#define DT_AARCH64_PAC_PLT (DT_LOPROC + 3)
+#define DT_AARCH64_VARIANT_PCS (DT_LOPROC + 5)
+
+/* AArch64-specific values for st_other. */
+#define STO_AARCH64_VARIANT_PCS 0x80 /* Symbol may follow different call
+ convention from the base PCS. */
+
/* Relocation types. */
START_RELOC_NUMBERS (elf_aarch64_reloc_type)
diff -rup binutils.orig/ld/testsuite/ld-aarch64/aarch64-elf.exp binutils-2.32/ld/testsuite/ld-aarch64/aarch64-elf.exp
--- binutils.orig/ld/testsuite/ld-aarch64/aarch64-elf.exp 2019-07-02 17:30:18.922896148 +0100
+++ binutils-2.32/ld/testsuite/ld-aarch64/aarch64-elf.exp 2019-07-02 17:35:21.875749878 +0100
@@ -371,6 +371,10 @@ run_dump_test_lp64 "rela-abs-relative-op
run_dump_test_lp64 "pie-bind-locally"
+run_dump_test_lp64 "variant_pcs-r"
+run_dump_test_lp64 "variant_pcs-shared"
+run_dump_test_lp64 "variant_pcs-now"
+
set aarch64elflinktests {
{"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s}
{} "copy-reloc-so.so"}
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-1.d 2019-07-02 17:35:11.362824354 +0100
@@ -0,0 +1,10 @@
+#objdump: -t
+
+.*: file format .*
+
+SYMBOL TABLE:
+0+ l d \.text 0+ \.text
+0+ l d \.data 0+ \.data
+0+ l d \.bss 0+ \.bss
+0+ l \.text 0+ func
+0+ \*UND\* 0+ 0x80 foobar
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-1.s 2019-07-02 17:35:11.362824354 +0100
@@ -0,0 +1,8 @@
+.text
+.variant_pcs foobar
+func:
+ bl foobar
+ b foobar
+
+.data
+.xword foobar
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-2.d 2019-07-02 17:35:11.362824354 +0100
@@ -0,0 +1,9 @@
+#objdump: -t
+
+.*: file format .*
+
+SYMBOL TABLE:
+0+ l d \.text 0+ \.text
+0+ l d \.data 0+ \.data
+0+ l d \.bss 0+ \.bss
+0+ l \.text 0+ 0x80 foo
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-2.s 2019-07-02 17:35:11.362824354 +0100
@@ -0,0 +1,4 @@
+.text
+.variant_pcs foo
+foo:
+ ret
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-3.s 2019-07-02 17:35:45.202584620 +0100
@@ -0,0 +1,20 @@
+.text
+.global foo_vpcs
+.global foo_base
+.global alias_vpcs
+.global alias_base
+
+.variant_pcs foo_vpcs
+.variant_pcs alias_vpcs
+
+foo_vpcs:
+foo_base:
+ bl foo_vpcs
+ bl foo_base
+ bl alias_vpcs
+ bl alias_base
+
+/* Check that the STO_AARCH64_VARIANT_PCS is not affected by .set. */
+
+.set alias_base, foo_vpcs
+.set alias_vpcs, foo_base
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/gas/testsuite/gas/aarch64/symbol-variant_pcs-3.d 2019-07-02 17:35:45.202584620 +0100
@@ -0,0 +1,12 @@
+#objdump: -t
+
+.*: file format .*
+
+SYMBOL TABLE:
+0+ l d \.text 0+ \.text
+0+ l d \.data 0+ \.data
+0+ l d \.bss 0+ \.bss
+0+ g \.text 0+ 0x80 foo_vpcs
+0+ g \.text 0+ foo_base
+0+ g \.text 0+ 0x80 alias_vpcs
+0+ g \.text 0+ alias_base
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-1.s 2019-07-02 17:35:21.875749878 +0100
@@ -0,0 +1,59 @@
+.text
+
+.variant_pcs f_spec_global_default_def
+.variant_pcs f_spec_global_default_undef
+.variant_pcs f_spec_global_hidden_def
+.variant_pcs f_spec_local
+.variant_pcs f_spec_global_default_ifunc
+.variant_pcs f_spec_global_hidden_ifunc
+.variant_pcs f_spec_local_ifunc
+
+.global f_spec_global_default_def
+.global f_spec_global_default_undef
+.global f_spec_global_hidden_def
+.global f_spec_global_default_ifunc
+.global f_spec_global_hidden_ifunc
+.global f_base_global_default_def
+.global f_base_global_default_undef
+.global f_base_global_hidden_def
+.global f_base_global_default_ifunc
+.global f_base_global_hidden_ifunc
+
+.hidden f_spec_global_hidden_def
+.hidden f_spec_global_hidden_ifunc
+.hidden f_base_global_hidden_def
+.hidden f_base_global_hidden_ifunc
+
+.type f_spec_global_default_ifunc, %gnu_indirect_function
+.type f_spec_global_hidden_ifunc, %gnu_indirect_function
+.type f_spec_local_ifunc, %gnu_indirect_function
+.type f_base_global_default_ifunc, %gnu_indirect_function
+.type f_base_global_hidden_ifunc, %gnu_indirect_function
+.type f_base_local_ifunc, %gnu_indirect_function
+
+f_spec_global_default_def:
+f_spec_global_hidden_def:
+f_spec_local:
+f_base_global_default_def:
+f_base_global_hidden_def:
+f_base_local:
+f_spec_global_default_ifunc:
+f_spec_global_hidden_ifunc:
+f_spec_local_ifunc:
+f_base_global_default_ifunc:
+f_base_global_hidden_ifunc:
+f_base_local_ifunc:
+ bl f_spec_global_default_def
+ bl f_spec_global_default_undef
+ bl f_spec_global_hidden_def
+ bl f_spec_local
+ bl f_base_global_default_def
+ bl f_base_global_default_undef
+ bl f_base_global_hidden_def
+ bl f_base_local
+ bl f_spec_global_default_ifunc
+ bl f_spec_global_hidden_ifunc
+ bl f_spec_local_ifunc
+ bl f_base_global_default_ifunc
+ bl f_base_global_hidden_ifunc
+ bl f_base_local_ifunc
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-2.s 2019-07-02 17:35:21.875749878 +0100
@@ -0,0 +1,47 @@
+.text
+
+.variant_pcs f_spec_global_default_def
+.variant_pcs f_spec_global_default_undef
+.variant_pcs f_spec_global_hidden_def
+.variant_pcs f_spec_local2
+.variant_pcs f_spec_global_default_ifunc
+.variant_pcs f_spec_global_hidden_ifunc
+.variant_pcs f_spec_local2_ifunc
+
+.global f_spec_global_default_def
+.global f_spec_global_default_undef
+.global f_spec_global_hidden_def
+.global f_spec_global_default_ifunc
+.global f_spec_global_hidden_ifunc
+.global f_base_global_default_def
+.global f_base_global_default_undef
+.global f_base_global_hidden_def
+.global f_base_global_default_ifunc
+.global f_base_global_hidden_ifunc
+
+.hidden f_spec_global_hidden_def
+.hidden f_spec_global_hidden_ifunc
+.hidden f_base_global_hidden_def
+.hidden f_base_global_hidden_ifunc
+
+.type f_spec_local2_ifunc, %gnu_indirect_function
+.type f_base_local2_ifunc, %gnu_indirect_function
+
+f_spec_local2:
+f_base_local2:
+f_spec_local2_ifunc:
+f_base_local2_ifunc:
+ bl f_spec_global_default_def
+ bl f_spec_global_default_undef
+ bl f_spec_global_hidden_def
+ bl f_spec_local2
+ bl f_base_global_default_def
+ bl f_base_global_default_undef
+ bl f_base_global_hidden_def
+ bl f_base_local2
+ bl f_spec_global_default_ifunc
+ bl f_spec_global_hidden_ifunc
+ bl f_spec_local2_ifunc
+ bl f_base_global_default_ifunc
+ bl f_base_global_hidden_ifunc
+ bl f_base_local2_ifunc
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs.ld 2019-07-02 17:35:37.100642017 +0100
@@ -0,0 +1,23 @@
+/* Script for .variant_pcs symbol tests. */
+OUTPUT_ARCH(aarch64)
+ENTRY(_start)
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = 0x8000); . = 0x8000;
+ .text :
+ {
+ *(.before)
+ *(.text)
+ *(.after)
+ } =0
+ . = 0x9000;
+ .got : { *(.got) *(.got.plt)}
+ . = 0x10000;
+ .rela.dyn : { *(.rela.ifunc) }
+ . = 0x11000;
+ .rela.plt : { *(.rela.plt) *(.rela.iplt) }
+ . = 0x12340000;
+ .far : { *(.far) }
+ .ARM.attributes 0 : { *(.ARM.atttributes) }
+}
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-now.d 2019-07-02 17:34:37.557063849 +0100
@@ -0,0 +1,67 @@
+#source: variant_pcs-1.s
+#source: variant_pcs-2.s
+#ld: -shared --hash-style=sysv -T variant_pcs.ld -z now
+#readelf: -rsW
+
+Relocation section '\.rela\.plt' at offset 0x11000 contains 12 entries:
+ Offset Info Type Symbol's Value Symbol's Name \+ Addend
+0000000000009020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0
+0000000000009028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0
+0000000000009030 0000000400000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_base_global_default_def \+ 0
+0000000000009038 0000000500000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_spec_global_default_def \+ 0
+0000000000009040 0000000000000408 R_AARCH64_IRELATIVE 8000
+0000000000009048 0000000300000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
+0000000000009050 0000000000000408 R_AARCH64_IRELATIVE 8000
+0000000000009058 0000000600000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
+0000000000009060 0000000000000408 R_AARCH64_IRELATIVE 8038
+0000000000009068 0000000000000408 R_AARCH64_IRELATIVE 8000
+0000000000009070 0000000000000408 R_AARCH64_IRELATIVE 8000
+0000000000009078 0000000000000408 R_AARCH64_IRELATIVE 8038
+
+Symbol table '\.dynsym' contains 7 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
+ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
+ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
+ 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
+ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
+ 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
+
+Symbol table '\.symtab' contains 35 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000000000008000 0 SECTION LOCAL DEFAULT 1
+ 2: 0000000000008070 0 SECTION LOCAL DEFAULT 2
+ 3: 0000000000009000 0 SECTION LOCAL DEFAULT 3
+ 4: 0000000000009080 0 SECTION LOCAL DEFAULT 4
+ 5: 0000000000011000 0 SECTION LOCAL DEFAULT 5
+ 6: 0000000000011120 0 SECTION LOCAL DEFAULT 6
+ 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7
+ 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8
+ 9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
+ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
+ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
+ 12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
+ 13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
+ 14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x
+ 15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
+ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
+ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
+ 18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
+ 19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
+ 20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x
+ 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS
+ 22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC
+ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def
+ 24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc
+ 25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def
+ 26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
+ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
+ 28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x
+ 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
+ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
+ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
+ 32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
+ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
+ 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-r.d 2019-07-02 17:35:35.244655166 +0100
@@ -0,0 +1,60 @@
+#source: variant_pcs-1.s
+#source: variant_pcs-2.s
+#ld: -r
+#readelf: -rsW
+
+Relocation section '\.rela\.text' at offset .* contains 24 entries:
+ Offset Info Type Symbol's Value Symbol's Name \+ Addend
+0000000000000000 000000180000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_def \+ 0
+0000000000000004 000000110000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_undef \+ 0
+0000000000000008 000000120000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_hidden_def \+ 0
+0000000000000010 000000170000011b R_AARCH64_CALL26 0000000000000000 f_base_global_default_def \+ 0
+0000000000000014 000000100000011b R_AARCH64_CALL26 0000000000000000 f_base_global_default_undef \+ 0
+0000000000000018 000000150000011b R_AARCH64_CALL26 0000000000000000 f_base_global_hidden_def \+ 0
+0000000000000020 000000140000011b R_AARCH64_CALL26 f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
+0000000000000024 000000160000011b R_AARCH64_CALL26 f_spec_global_hidden_ifunc\(\) f_spec_global_hidden_ifunc \+ 0
+0000000000000028 000000060000011b R_AARCH64_CALL26 f_spec_local_ifunc\(\) f_spec_local_ifunc \+ 0
+000000000000002c 000000190000011b R_AARCH64_CALL26 f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
+0000000000000030 000000130000011b R_AARCH64_CALL26 f_base_global_hidden_ifunc\(\) f_base_global_hidden_ifunc \+ 0
+0000000000000034 000000070000011b R_AARCH64_CALL26 f_base_local_ifunc\(\) f_base_local_ifunc \+ 0
+0000000000000038 000000180000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_def \+ 0
+000000000000003c 000000110000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_undef \+ 0
+0000000000000040 000000120000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_hidden_def \+ 0
+0000000000000048 000000170000011b R_AARCH64_CALL26 0000000000000000 f_base_global_default_def \+ 0
+000000000000004c 000000100000011b R_AARCH64_CALL26 0000000000000000 f_base_global_default_undef \+ 0
+0000000000000050 000000150000011b R_AARCH64_CALL26 0000000000000000 f_base_global_hidden_def \+ 0
+0000000000000058 000000140000011b R_AARCH64_CALL26 f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
+000000000000005c 000000160000011b R_AARCH64_CALL26 f_spec_global_hidden_ifunc\(\) f_spec_global_hidden_ifunc \+ 0
+0000000000000060 0000000c0000011b R_AARCH64_CALL26 f_spec_local2_ifunc\(\) f_spec_local2_ifunc \+ 0
+0000000000000064 000000190000011b R_AARCH64_CALL26 f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
+0000000000000068 000000130000011b R_AARCH64_CALL26 f_base_global_hidden_ifunc\(\) f_base_global_hidden_ifunc \+ 0
+000000000000006c 0000000d0000011b R_AARCH64_CALL26 f_base_local2_ifunc\(\) f_base_local2_ifunc \+ 0
+
+Symbol table '\.symtab' contains 26 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1
+ 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3
+ 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4
+ 4: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
+ 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
+ 6: 0000000000000000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
+ 7: 0000000000000000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
+ 8: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
+ 9: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 \$x
+ 10: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
+ 11: 0000000000000038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
+ 12: 0000000000000038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
+ 13: 0000000000000038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
+ 14: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
+ 15: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 \$x
+ 16: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
+ 17: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
+ 18: 0000000000000000 0 NOTYPE GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_def
+ 19: 0000000000000000 0 IFUNC GLOBAL HIDDEN 1 f_base_global_hidden_ifunc
+ 20: 0000000000000000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
+ 21: 0000000000000000 0 NOTYPE GLOBAL HIDDEN 1 f_base_global_hidden_def
+ 22: 0000000000000000 0 IFUNC GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
+ 23: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
+ 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
+ 25: 0000000000000000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
--- /dev/null 2019-07-02 08:01:33.386842704 +0100
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2019-07-02 17:34:45.635006622 +0100
@@ -0,0 +1,67 @@
+#source: variant_pcs-1.s
+#source: variant_pcs-2.s
+#ld: -shared --hash-style=sysv -T variant_pcs.ld
+#readelf: -rsW
+
+Relocation section '\.rela\.plt' at offset 0x11000 contains 12 entries:
+ Offset Info Type Symbol's Value Symbol's Name \+ Addend
+0000000000009020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0
+0000000000009028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0
+0000000000009030 0000000400000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_base_global_default_def \+ 0
+0000000000009038 0000000500000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_spec_global_default_def \+ 0
+0000000000009040 0000000000000408 R_AARCH64_IRELATIVE 8000
+0000000000009048 0000000300000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0
+0000000000009050 0000000000000408 R_AARCH64_IRELATIVE 8000
+0000000000009058 0000000600000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0
+0000000000009060 0000000000000408 R_AARCH64_IRELATIVE 8038
+0000000000009068 0000000000000408 R_AARCH64_IRELATIVE 8000
+0000000000009070 0000000000000408 R_AARCH64_IRELATIVE 8000
+0000000000009078 0000000000000408 R_AARCH64_IRELATIVE 8038
+
+Symbol table '\.dynsym' contains 7 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
+ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
+ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
+ 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
+ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
+ 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
+
+Symbol table '\.symtab' contains 35 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000000000008000 0 SECTION LOCAL DEFAULT 1
+ 2: 0000000000008070 0 SECTION LOCAL DEFAULT 2
+ 3: 0000000000009000 0 SECTION LOCAL DEFAULT 3
+ 4: 0000000000009080 0 SECTION LOCAL DEFAULT 4
+ 5: 0000000000011000 0 SECTION LOCAL DEFAULT 5
+ 6: 0000000000011120 0 SECTION LOCAL DEFAULT 6
+ 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7
+ 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8
+ 9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
+ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
+ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
+ 12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
+ 13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
+ 14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x
+ 15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
+ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
+ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
+ 18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
+ 19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
+ 20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x
+ 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS
+ 22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC
+ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def
+ 24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc
+ 25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def
+ 26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
+ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
+ 28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x
+ 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
+ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
+ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
+ 32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
+ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
+ 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-now.d
--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d 2019-07-03 10:06:20.012412075 +0100
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-now.d 2019-07-03 10:20:51.959203582 +0100
@@ -22,10 +22,10 @@ Symbol table '\.dynsym' contains 7 entri
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
- 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
- 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
+ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
+ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
- 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
+ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
Symbol table '\.symtab' contains 35 entries:
@@ -40,28 +40,28 @@ Symbol table '\.symtab' contains 35 entr
7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7
8: 0000000000011270 0 SECTION LOCAL DEFAULT 8
9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
- 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
- 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
+ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local \[VARIANT_PCS\]
+ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc \[VARIANT_PCS\]
12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x
15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
- 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
- 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
+ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2 \[VARIANT_PCS\]
+ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc \[VARIANT_PCS\]
18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x
21: 0000000000000000 0 FILE LOCAL DEFAULT ABS
22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC
- 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def
+ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_global_hidden_def \[VARIANT_PCS\]
24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc
25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def
26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
- 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
+ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_global_hidden_ifunc \[VARIANT_PCS\]
28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x
29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
- 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
- 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
+ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
+ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
- 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
+ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-r.d binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-r.d
--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-r.d 2019-07-03 10:06:20.012412075 +0100
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-r.d 2019-07-03 10:14:28.152933189 +0100
@@ -37,24 +37,24 @@ Symbol table '\.symtab' contains 26 entr
2: 0000000000000000 0 SECTION LOCAL DEFAULT 3
3: 0000000000000000 0 SECTION LOCAL DEFAULT 4
4: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
- 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
- 6: 0000000000000000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
+ 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local \[VARIANT_PCS\]
+ 6: 0000000000000000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc \[VARIANT_PCS\]
7: 0000000000000000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
8: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
9: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 \$x
10: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
- 11: 0000000000000038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
- 12: 0000000000000038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
+ 11: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2 \[VARIANT_PCS\]
+ 12: 0000000000000038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc \[VARIANT_PCS\]
13: 0000000000000038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
14: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
15: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 \$x
16: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
- 17: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
- 18: 0000000000000000 0 NOTYPE GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_def
+ 17: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
+ 18: 0000000000000000 0 NOTYPE GLOBAL HIDDEN 1 f_spec_global_hidden_def \[VARIANT_PCS\]
19: 0000000000000000 0 IFUNC GLOBAL HIDDEN 1 f_base_global_hidden_ifunc
- 20: 0000000000000000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
+ 20: 0000000000000000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
21: 0000000000000000 0 NOTYPE GLOBAL HIDDEN 1 f_base_global_hidden_def
- 22: 0000000000000000 0 IFUNC GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
+ 22: 0000000000000000 0 IFUNC GLOBAL HIDDEN 1 f_spec_global_hidden_ifunc \[VARIANT_PCS\]
23: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
- 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
+ 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
25: 0000000000000000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-shared.d
--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2019-07-03 10:06:20.012412075 +0100
+++ binutils-2.32/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2019-07-03 10:19:00.760994532 +0100
@@ -22,10 +22,10 @@ Symbol table '\.dynsym' contains 7 entri
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
- 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
- 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
+ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
+ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
- 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
+ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc
Symbol table '\.symtab' contains 35 entries:
@@ -40,28 +40,28 @@ Symbol table '\.symtab' contains 35 entr
7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7
8: 0000000000011270 0 SECTION LOCAL DEFAULT 8
9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o
- 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local
- 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc
+ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local \[VARIANT_PCS\]
+ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc \[VARIANT_PCS\]
12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc
13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local
14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x
15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o
- 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2
- 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc
+ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2 \[VARIANT_PCS\]
+ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc \[VARIANT_PCS\]
18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc
19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2
20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x
21: 0000000000000000 0 FILE LOCAL DEFAULT ABS
22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC
- 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def
+ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_global_hidden_def \[VARIANT_PCS\]
24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc
25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def
26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
- 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc
+ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_global_hidden_ifunc \[VARIANT_PCS\]
28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x
29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef
- 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef
- 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc
+ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef \[VARIANT_PCS\]
+ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc \[VARIANT_PCS\]
32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def
- 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def
+ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def \[VARIANT_PCS\]
34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
--- binutils.orig/ld/emultempl/elf32.em 2019-07-22 13:25:51.601030174 +0100
+++ binutils-2.32/ld/emultempl/elf32.em 2019-07-22 13:27:36.070394830 +0100
@@ -2029,10 +2029,12 @@ elf_orphan_compatible (asection *in, ase
if (elf_section_data (out)->this_hdr.sh_info
!= elf_section_data (in)->this_hdr.sh_info)
return FALSE;
- /* We can't merge two sections with differing SHF_EXCLUDE when doing
- a relocatable link. */
+ /* We can't merge with member of output section group nor merge two
+ sections with differing SHF_EXCLUDE when doing a relocatable link. */
if (bfd_link_relocatable (&link_info)
- && ((elf_section_flags (out) ^ elf_section_flags (in)) & SHF_EXCLUDE) != 0)
+ && (elf_next_in_group (out) != NULL
+ || ((elf_section_flags (out) ^ elf_section_flags (in))
+ & SHF_EXCLUDE) != 0))
return FALSE;
return _bfd_elf_match_sections_by_type (link_info.output_bfd, out,
in->owner, in);

View File

@ -753,3 +753,16 @@ diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.30/ld/tests
run_cc_link_tests [list \
[list \
"Build plt-lib.so" \
--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2019-12-02 10:22:47.019526080 +0000
+++ binutils-2.30/ld/testsuite/ld-plugin/lto.exp 2019-12-02 10:28:11.413354928 +0000
@@ -33,8 +33,8 @@ global CFLAGS
global CXXFLAGS
set saved_CFLAGS "$CFLAGS"
set saved_CXXFLAGS "$CXXFLAGS"
-regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CFLAGS "" CFLAGS
-regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CXXFLAGS "" CXXFLAGS
+# regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CFLAGS "" CFLAGS
+# regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CXXFLAGS "" CXXFLAGS
proc restore_notify { } {
global saved_CFLAGS

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,12 @@
# relocations against absolute symbols.
%define default_generate_notes 0
# Enable thread support in the GOLD linker (if it is being built). This is
# particularly important if plugins to the linker intend to use threads
# themselves. See BZ 1636479 for more details. This option is made
# configurable in case there is ever a need to disable thread support.
%define enable_threading 1
#----End of Configure Options------------------------------------------------
# Default: Not bootstrapping.
@ -63,7 +69,7 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.30
Release: 58%{?dist}.2
Release: 73%{?dist}
License: GPLv3+
URL: https://sourceware.org/binutils
@ -380,15 +386,50 @@ Patch56: binutils-AArch64-gold.patch
# Lifetime: Fixed in 2.33
Patch57: binutils-multiple-relocs-for-same-section.patch
# Purpose: Stop the linker from merging groups which have different settings
# of the SHF_EXCLUDE flag.
# Lifetime: Fixed in 2.33
Patch58: binutils-do-not-merge-differing-SHF_EXCLUDE-groups.patch
# Purpose: Add support for the SVE variant PCS in AArch64.
# Lifetime: Fixed in 2.33
Patch59: binutils-aarch64-STO_AARCH64_VARIANT_PCS.patch
# Purpose: Add fixes and markers for Coverity test failures.
# Lifetime: Permanent.
Patch60: binutils-coverity-fixes.patch
# Purpose: Improve objcopy's merging of GNU build attribute notes.
# Lifetime: Fixed in 2.33
Patch61: binutils-improved-note-merging.patch
# Purpose: Add check to readelf in order to prevent an integer overflow.
# Lifetime: Fixed in 2.33
Patch62: binutils-CVE-2019-14444.patch
# Purpose: Fix a seg-fault in gold when linking corrupt input files.
# Lifetime: Fixed in 2.34 (maybe)
Patch63: binutils-CVE-2019-1010204.patch
# Purpose: Add a feature to the x86/64 assembler to create
# workarounds for the Intel Jcc Erratum.
# Lifetime: Fixed in 2.34
Patch58: binutils-x86_JCC_Erratum.patch
Patch64: binutils-x86_JCC_Erratum.patch
# Purpose: Fix a potential seg-fault in the BFD library when parsing
# pathalogical debug_info sections.
# Lifetime: Fixed in 2.34
Patch65: binutils-CVE-2019-17451.patch
# Purpose: Fix a memory exhaustion bug in the BFD library when parsing
# corrupt DWARF debug information.
# Lifetime: Fixed in 2.34
Patch66: binutils-CVE-2019-17450.patch
# Purpose: Allow the BFD library to handle the copying of files which
# contain secondary reloc sections.
# Lifetime: Fixed in 2.35
Patch59: binutils-copy-multiple-relocs.patch
Patch67: binutils-copy-multiple-relocs.patch
#----------------------------------------------------------------------------
@ -573,6 +614,14 @@ using libelf instead of BFD.
%patch57 -p1
%patch58 -p1
%patch59 -p1
%patch60 -p1
%patch61 -p1
%patch62 -p1
%patch63 -p1
%patch64 -p1
%patch65 -p1
%patch66 -p1
%patch67 -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 ?
@ -714,6 +763,11 @@ export LDFLAGS=$RPM_LD_FLAGS
--enable-generate-build-notes=yes \
%else
--enable-generate-build-notes=no \
%endif
%if %{enable_threading}
--enable-threads=yes \
%else
--enable-threads=no \
%endif
$CARGS \
--enable-plugins \
@ -1005,11 +1059,54 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Tue Feb 18 2020 Nick Clifton <nickc@redhat.com> - 2.30-58.2
- Allow the BFD library to handle the copying of files containing secondary reloc sections. (#1803825)
* Wed Feb 12 2020 Nick Clifton <nickc@redhat.com> - 2.30-73
- Remove bogus assertion. (#1801879)
* Mon Dec 16 2019 Nick Clifton <nickc@redhat.com> - 2.30-58.1
- Backport H.J.Lu's patch to add a workaround for the JCC Errata to the assembler. (#1783957)
* Wed Feb 12 2020 Nick Clifton <nickc@redhat.com> - 2.30-72
- Allow the BFD library to handle the copying of files containing secondary reloc sections. (#1801879)
* Tue Dec 03 2019 Nick Clifton <nickc@redhat.com> - 2.30-71
- Fix a potential seg-fault in the BFD library when parsing pathalogical debug_info sections. (#1779245)
- Fix a potential memory exhaustion in the BFD library when parsing corrupt DWARF debug information.
* Mon Dec 02 2019 Nick Clifton <nickc@redhat.com> - 2.30-70
- Re-enable strip merging build notes. (#1777760)
* Mon Dec 02 2019 Nick Clifton <nickc@redhat.com> - 2.30-69
- Fix linker testsuite failures triggered by annobin update.
* Thu Nov 28 2019 Nick Clifton <nickc@redhat.com> - 2.30-68
- Backport H.J.Lu's patch to add a workaround for the JCC Errata to the assembler. (#1777002)
* Thu Nov 21 2019 Nick Clifton <nickc@redhat.com> - 2.30-67
- Fix a buffer overrun in the note merging code. (#1774507)
* Fri Nov 08 2019 Nick Clifton <nickc@redhat.com> 2.30-66
- Fix a seg-fault in gold when linking corrupt input files. (#1739254)
* Thu Nov 07 2019 Nick Clifton <nickc@redhat.com> 2.30-65
- NVR bump to allow rebuild with reverted version of glibc in the buildroot.
* Wed Nov 06 2019 Nick Clifton <nickc@redhat.com> 2.30-64
- Stop note merging with no effect from creating null filled note sections.
* Wed Nov 06 2019 Nick Clifton <nickc@redhat.com> 2.30-63
- Stop objcopy from generating a exit failure status when merging corrupt notes.
* Fri Nov 01 2019 Nick Clifton <nickc@redhat.com> 2.30-62
- Fix binutils testsuite failure introduced by -60 patch. (#1767711)
* Tue Oct 29 2019 Nick Clifton <nickc@redhat.com> 2.30-61
- Enable threading in the GOLD linker. (#1729225)
- Add check to readelf in order to prevent an integer overflow.
* Mon Oct 28 2019 Nick Clifton <nickc@redhat.com> 2.30-60
- Add support for SVE Vector PCS on AArch64. (#1726637)
- Add fixes for coverity test failures.
- Improve objcopy's ability to merge GNU build attribute notes.
* Mon Oct 28 2019 Nick Clifton <nickc@redhat.com> 2.30-59
- Stop the linker from merging groups with different settings of the SHF_EXCLUDE flag. (#1730906)
* Fri Sep 13 2019 Nick Clifton <nickc@redhat.com> 2.30-58
- Stop the BFD library from complaining about sections with multiple sets of relocations. (#1749084)