- Rebase on FSF binutils 2.29.
- Retire: binutils-2.20.51.0.10-ppc64-pie.patch - Retire: binutils-2.27-ld-buffer-overflow.patch - Retire: binutils-2.28-libiberty-bugfixes.patch - Retire: binutils-gnu-build-notes.patch - Retire: binutils-2.28-gas-comp_dir.patch - Retire: binutils-2.28-ppc-dynamic-relocs.patch - Retire: binutils-2.28-dynamic-section-warning.patch - Retire: binutils-2.28-aarch64-copy-relocs.patch - Retire: binutils-2.28-DW_AT_export_symbols.patch
This commit is contained in:
parent
231fc46d8d
commit
283a7e8f17
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@ x86_64
|
||||
HOWTO
|
||||
build-sources
|
||||
|
||||
/binutils-2.29.tar.xz
|
||||
|
@ -1,12 +0,0 @@
|
||||
--- a/bfd/elf64-ppc.c 2012-09-11 12:13:00.637448573 +0100
|
||||
+++ b/bfd/elf64-ppc.c 2012-09-11 12:13:17.922449052 +0100
|
||||
@@ -13523,6 +13523,9 @@
|
||||
{
|
||||
BFD_ASSERT (h->elf.dynindx != -1);
|
||||
outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type);
|
||||
+ if (h->elf.dynindx == -1
|
||||
+ && h->elf.root.type == bfd_link_hash_undefweak)
|
||||
+ memset (&outrel, 0, sizeof outrel);
|
||||
}
|
||||
else
|
||||
{
|
@ -2432,7 +2432,7 @@ diff -rup binutils-2.26.orig/ld/testsuite/ld-plugin/lto.exp binutils-2.26/ld/tes
|
||||
+++ binutils-2.28/bfd/opncls.c 2017-03-02 11:23:23.546065945 +0000
|
||||
@@ -1990,3 +1990,69 @@ bfd_follow_build_id_debuglink (bfd *abfd
|
||||
get_build_id_name,
|
||||
check_build_id_file);
|
||||
check_build_id_file, &build_id);
|
||||
}
|
||||
+
|
||||
+/*
|
||||
@ -2467,7 +2467,7 @@ diff -rup binutils-2.26.orig/ld/testsuite/ld-plugin/lto.exp binutils-2.26/ld/tes
|
||||
+ name = make_temp_file (".obj-only.o");
|
||||
+
|
||||
+ /* Open the object-only file. */
|
||||
+ file = real_fopen (name, FOPEN_WB);
|
||||
+ file = _bfd_real_fopen (name, FOPEN_WB);
|
||||
+ if (!bfd_get_full_section_contents (abfd, sec, &memhunk))
|
||||
+ {
|
||||
+ err = bfd_get_error ();
|
||||
|
@ -1,35 +0,0 @@
|
||||
diff -rup binutils.orig/ld/ldlang.c binutils-2.27/ld/ldlang.c
|
||||
--- binutils.orig/ld/ldlang.c 2017-01-31 11:08:03.711398839 +0000
|
||||
+++ binutils-2.27/ld/ldlang.c 2017-01-31 11:09:31.411347584 +0000
|
||||
@@ -2034,14 +2034,11 @@ static void
|
||||
lang_print_asneeded (void)
|
||||
{
|
||||
struct asneeded_minfo *m;
|
||||
- char buf[100];
|
||||
|
||||
if (asneeded_list_head == NULL)
|
||||
return;
|
||||
|
||||
- sprintf (buf, _("\nAs-needed library included "
|
||||
- "to satisfy reference by file (symbol)\n\n"));
|
||||
- minfo ("%s", buf);
|
||||
+ minfo (_("\nAs-needed library included to satisfy reference by file (symbol)\n\n"));
|
||||
|
||||
for (m = asneeded_list_head; m != NULL; m = m->next)
|
||||
{
|
||||
diff -rup binutils.orig/ld/ldmain.c binutils-2.27/ld/ldmain.c
|
||||
--- binutils.orig/ld/ldmain.c 2017-01-31 11:08:03.874396886 +0000
|
||||
+++ binutils-2.27/ld/ldmain.c 2017-01-31 11:09:01.393708155 +0000
|
||||
@@ -840,11 +840,7 @@ add_archive_element (struct bfd_link_inf
|
||||
|
||||
if (!header_printed)
|
||||
{
|
||||
- char buf[100];
|
||||
-
|
||||
- sprintf (buf, _("Archive member included "
|
||||
- "to satisfy reference by file (symbol)\n\n"));
|
||||
- minfo ("%s", buf);
|
||||
+ minfo (_("Archive member included to satisfy reference by file (symbol)\n\n"));
|
||||
header_printed = TRUE;
|
||||
}
|
||||
|
@ -1,26 +0,0 @@
|
||||
--- binutils-2.27.orig/ld/testsuite/ld-plugin/lto.exp 2016-09-20 14:11:51.866711051 +0100
|
||||
+++ binutils-2.27/ld/testsuite/ld-plugin/lto.exp 2016-09-20 14:18:28.528223979 +0100
|
||||
@@ -287,11 +287,21 @@ set lto_link_elf_tests [list \
|
||||
{dummy.c} {} "pr16746a.exe"] \
|
||||
[list "PR ld/16746 (2)" \
|
||||
"-O2 -flto -fuse-linker-plugin tmpdir/pr16746c.o tmpdir/pr16746a.o" "-O2 -flto" \
|
||||
- {dummy.c} {} "pr16746b.exe"] \
|
||||
+ {dummy.c} {} "pr16746b.exe"] \
|
||||
+]
|
||||
+
|
||||
+# PR 14918 checks that libgcc is not spuriously included in a shared link of
|
||||
+# an empty program. The ARM crt1.o startup code however calls __libc_csu_init
|
||||
+# in /usr/lib/libc_nonshared.a(elf-init.oS). This in turn needs
|
||||
+# __aeabi_unwind_cpp_pr0@@GCC_3.5 which is provided by libgcc_s.so.1, so the
|
||||
+# test fails. Hence this code to skip the test.
|
||||
+if { ! [istarget "arm*-*-*"] } {
|
||||
+ set lto_link_elf_tests [concat $lto_link_elf_tests [list \
|
||||
[list "PR ld/14918" \
|
||||
"-flto" "-flto" \
|
||||
{pr14918.c} {{"readelf" {-d --wide} "pr14918.d"}} "pr14918.exe" "c"] \
|
||||
-]
|
||||
+ ]]
|
||||
+}
|
||||
|
||||
# Check final symbols in executables.
|
||||
set lto_link_symbol_tests [list \
|
@ -1,14 +0,0 @@
|
||||
--- binutils.orig/include/dwarf2.def 2017-07-20 09:05:22.616764282 +0100
|
||||
+++ binutils-2.28/include/dwarf2.def 2017-07-20 09:05:59.168330104 +0100
|
||||
@@ -310,6 +310,11 @@ DW_AT (DW_AT_enum_class, 0x6d)
|
||||
DW_AT (DW_AT_linkage_name, 0x6e)
|
||||
/* DWARF 5. */
|
||||
DW_AT (DW_AT_noreturn, 0x87)
|
||||
+DW_AT (DW_AT_alignment, 0x88)
|
||||
+DW_AT (DW_AT_export_symbols, 0x89)
|
||||
+DW_AT (DW_AT_deleted, 0x8a)
|
||||
+DW_AT (DW_AT_defaulted, 0x8b)
|
||||
+DW_AT (DW_AT_loclists_base, 0x8c)
|
||||
|
||||
DW_AT_DUP (DW_AT_lo_user, 0x2000) /* Implementation-defined range start. */
|
||||
DW_AT_DUP (DW_AT_hi_user, 0x3fff) /* Implementation-defined range end. */
|
@ -1,414 +0,0 @@
|
||||
diff -rupN binutils.orig/bfd/elfnn-aarch64.c binutils-2.28/bfd/elfnn-aarch64.c
|
||||
--- binutils.orig/bfd/elfnn-aarch64.c 2017-06-08 09:11:46.364977859 +0100
|
||||
+++ binutils-2.28/bfd/elfnn-aarch64.c 2017-06-08 09:15:46.901961364 +0100
|
||||
@@ -246,7 +246,7 @@
|
||||
|| (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC \
|
||||
|| (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_OFF_G1)
|
||||
|
||||
-#define ELIMINATE_COPY_RELOCS 0
|
||||
+#define ELIMINATE_COPY_RELOCS 1
|
||||
|
||||
/* Return size of a relocation entry. HTAB is the bfd's
|
||||
elf_aarch64_link_hash_entry. */
|
||||
@@ -5152,12 +5152,25 @@ elfNN_aarch64_final_link_relocate (reloc
|
||||
/* When generating a shared object or relocatable executable, these
|
||||
relocations are copied into the output file to be resolved at
|
||||
run time. */
|
||||
- if (((bfd_link_pic (info) == TRUE)
|
||||
- || globals->root.is_relocatable_executable)
|
||||
- && (input_section->flags & SEC_ALLOC)
|
||||
- && (h == NULL
|
||||
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
- || h->root.type != bfd_link_hash_undefweak))
|
||||
+ if (((bfd_link_pic (info)
|
||||
+ || globals->root.is_relocatable_executable)
|
||||
+ && (input_section->flags & SEC_ALLOC)
|
||||
+ && (h == NULL
|
||||
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
+ || h->root.type != bfd_link_hash_undefweak))
|
||||
+ /* Or we are creating an executable, we may need to keep relocations
|
||||
+ for symbols satisfied by a dynamic library if we manage to avoid
|
||||
+ copy relocs for the symbol. */
|
||||
+ || (ELIMINATE_COPY_RELOCS
|
||||
+ && !bfd_link_pic (info)
|
||||
+ && h != NULL
|
||||
+ && (input_section->flags & SEC_ALLOC)
|
||||
+ && h->dynindx != -1
|
||||
+ && !h->non_got_ref
|
||||
+ && ((h->def_dynamic
|
||||
+ && !h->def_regular)
|
||||
+ || h->root.type == bfd_link_hash_undefweak
|
||||
+ || h->root.type == bfd_link_hash_undefined)))
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
bfd_byte *loc;
|
||||
@@ -6822,6 +6835,25 @@ elfNN_aarch64_gc_sweep_hook (bfd *abfd,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+/* Return true if we have dynamic relocs against EH or any of its weak
|
||||
+ aliases, that apply to read-only sections. */
|
||||
+
|
||||
+static bfd_boolean
|
||||
+alias_readonly_dynrelocs (struct elf_aarch64_link_hash_entry *eh)
|
||||
+{
|
||||
+ struct elf_dyn_relocs *p;
|
||||
+ asection *s;
|
||||
+
|
||||
+ for (p = eh->dyn_relocs; p != NULL; p = p->next)
|
||||
+ {
|
||||
+ s = p->sec->output_section;
|
||||
+ if (s != NULL && (s->flags & SEC_READONLY) != 0)
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
/* Adjust a symbol defined by a dynamic object and referenced by a
|
||||
regular object. The current definition is in some section of the
|
||||
dynamic object, but we're not including those sections. We have to
|
||||
@@ -6895,6 +6927,19 @@ elfNN_aarch64_adjust_dynamic_symbol (str
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+ if (ELIMINATE_COPY_RELOCS)
|
||||
+ {
|
||||
+ struct elf_aarch64_link_hash_entry *eh;
|
||||
+ /* If we didn't find any dynamic relocs in read-only sections, then
|
||||
+ we'll be keeping the dynamic relocs and avoiding the copy reloc. */
|
||||
+ eh = (struct elf_aarch64_link_hash_entry *) h;
|
||||
+ if (eh->dyn_relocs && !alias_readonly_dynrelocs (eh))
|
||||
+ {
|
||||
+ h->non_got_ref = 0;
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* We must allocate the symbol in our .dynbss section, which will
|
||||
become part of the .bss section of the executable. There will be
|
||||
an entry for this symbol in the .dynsym section. The dynamic
|
||||
@@ -7167,7 +7212,16 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
|
||||
|
||||
/* No need to do anything if we're not creating a shared
|
||||
object. */
|
||||
- if (! bfd_link_pic (info))
|
||||
+ if (!(bfd_link_pic (info)
|
||||
+ /* If on the other hand, we are creating an executable, we
|
||||
+ may need to keep relocations for symbols satisfied by a
|
||||
+ dynamic library if we manage to avoid copy relocs for the
|
||||
+ symbol. */
|
||||
+ || (ELIMINATE_COPY_RELOCS
|
||||
+ && !bfd_link_pic (info)
|
||||
+ && h != NULL
|
||||
+ && (h->root.type == bfd_link_hash_defweak
|
||||
+ || !h->def_regular))))
|
||||
break;
|
||||
|
||||
{
|
||||
diff -rupN binutils.orig/ld/testsuite/ld-aarch64/aarch64-elf.exp binutils-2.28/ld/testsuite/ld-aarch64/aarch64-elf.exp
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/aarch64-elf.exp 2017-06-08 09:11:54.845871503 +0100
|
||||
+++ binutils-2.28/ld/testsuite/ld-aarch64/aarch64-elf.exp 2017-06-08 09:16:34.984358379 +0100
|
||||
@@ -323,6 +323,8 @@ set aarch64elflinktests {
|
||||
{} "copy-reloc-so.so"}
|
||||
{"ld-aarch64/exe with copy relocation" "-e0 tmpdir/copy-reloc-so.so" "" ""
|
||||
{copy-reloc-exe.s} {{objdump -R copy-reloc.d}} "copy-reloc"}
|
||||
+ {"ld-aarch64/exe with copy relocation elimination" "-e0 tmpdir/copy-reloc-so.so" "" ""
|
||||
+ {copy-reloc-exe-eliminate.s} {{objdump -R copy-reloc-eliminate.d}} "copy-reloc-elimination"}
|
||||
}
|
||||
|
||||
run_ld_link_tests $aarch64elflinktests
|
||||
diff -rupN binutils.orig/ld/testsuite/ld-aarch64/copy-reloc-eliminate.d binutils-2.28/ld/testsuite/ld-aarch64/copy-reloc-eliminate.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/copy-reloc-eliminate.d 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.28/ld/testsuite/ld-aarch64/copy-reloc-eliminate.d 2017-06-08 09:12:10.191679056 +0100
|
||||
@@ -0,0 +1,4 @@
|
||||
+.*
|
||||
+DYNAMIC RELOCATION RECORDS
|
||||
+OFFSET.*TYPE.*VALUE.*
|
||||
+.*R_AARCH64_ABS64.*global_a
|
||||
diff -rupN binutils.orig/ld/testsuite/ld-aarch64/copy-reloc-exe-eliminate.s binutils-2.28/ld/testsuite/ld-aarch64/copy-reloc-exe-eliminate.s
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/copy-reloc-exe-eliminate.s 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.28/ld/testsuite/ld-aarch64/copy-reloc-exe-eliminate.s 2017-06-08 09:12:10.191679056 +0100
|
||||
@@ -0,0 +1,7 @@
|
||||
+ .global p
|
||||
+ .section .data.rel.ro,"aw",%progbits
|
||||
+ .align 3
|
||||
+ .type p, %object
|
||||
+ .size p, 8
|
||||
+p:
|
||||
+ .xword global_a
|
||||
diff -rupN binutils.orig/bfd/elfnn-aarch64.c binutils-2.28/bfd/elfnn-aarch64.c
|
||||
--- binutils.orig/bfd/elfnn-aarch64.c 2017-06-15 15:12:31.038471300 +0100
|
||||
+++ binutils-2.28/bfd/elfnn-aarch64.c 2017-06-15 15:12:52.797218241 +0100
|
||||
@@ -6812,15 +6812,22 @@ elfNN_aarch64_gc_sweep_hook (bfd *abfd,
|
||||
h->plt.refcount -= 1;
|
||||
break;
|
||||
|
||||
+ case BFD_RELOC_AARCH64_ADD_LO12:
|
||||
case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
|
||||
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
|
||||
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
|
||||
+ case BFD_RELOC_AARCH64_LDST128_LO12:
|
||||
+ case BFD_RELOC_AARCH64_LDST16_LO12:
|
||||
+ case BFD_RELOC_AARCH64_LDST32_LO12:
|
||||
+ case BFD_RELOC_AARCH64_LDST64_LO12:
|
||||
+ case BFD_RELOC_AARCH64_LDST8_LO12:
|
||||
+ case BFD_RELOC_AARCH64_LD_LO19_PCREL:
|
||||
case BFD_RELOC_AARCH64_MOVW_G0_NC:
|
||||
case BFD_RELOC_AARCH64_MOVW_G1_NC:
|
||||
case BFD_RELOC_AARCH64_MOVW_G2_NC:
|
||||
case BFD_RELOC_AARCH64_MOVW_G3:
|
||||
case BFD_RELOC_AARCH64_NN:
|
||||
- if (h != NULL && bfd_link_executable (info))
|
||||
+ if (h != NULL && !bfd_link_pic (info))
|
||||
{
|
||||
if (h->plt.refcount > 0)
|
||||
h->plt.refcount -= 1;
|
||||
@@ -6835,18 +6842,24 @@ elfNN_aarch64_gc_sweep_hook (bfd *abfd,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
-/* Return true if we have dynamic relocs against EH or any of its weak
|
||||
- aliases, that apply to read-only sections. */
|
||||
+/* Return true if we need copy relocation against EH. */
|
||||
|
||||
static bfd_boolean
|
||||
-alias_readonly_dynrelocs (struct elf_aarch64_link_hash_entry *eh)
|
||||
+need_copy_relocation_p (struct elf_aarch64_link_hash_entry *eh)
|
||||
{
|
||||
struct elf_dyn_relocs *p;
|
||||
asection *s;
|
||||
|
||||
for (p = eh->dyn_relocs; p != NULL; p = p->next)
|
||||
{
|
||||
+ /* If there is any pc-relative reference, we need to keep copy relocation
|
||||
+ to avoid propagating the relocation into runtime that current glibc
|
||||
+ does not support. */
|
||||
+ if (p->pc_count)
|
||||
+ return TRUE;
|
||||
+
|
||||
s = p->sec->output_section;
|
||||
+ /* Need copy relocation if it's against read-only section. */
|
||||
if (s != NULL && (s->flags & SEC_READONLY) != 0)
|
||||
return TRUE;
|
||||
}
|
||||
@@ -6933,7 +6946,7 @@ elfNN_aarch64_adjust_dynamic_symbol (str
|
||||
/* If we didn't find any dynamic relocs in read-only sections, then
|
||||
we'll be keeping the dynamic relocs and avoiding the copy reloc. */
|
||||
eh = (struct elf_aarch64_link_hash_entry *) h;
|
||||
- if (eh->dyn_relocs && !alias_readonly_dynrelocs (eh))
|
||||
+ if (!need_copy_relocation_p (eh))
|
||||
{
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
@@ -7194,6 +7207,41 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
|
||||
|
||||
switch (bfd_r_type)
|
||||
{
|
||||
+ case BFD_RELOC_AARCH64_MOVW_G0_NC:
|
||||
+ case BFD_RELOC_AARCH64_MOVW_G1_NC:
|
||||
+ case BFD_RELOC_AARCH64_MOVW_G2_NC:
|
||||
+ case BFD_RELOC_AARCH64_MOVW_G3:
|
||||
+ if (bfd_link_pic (info))
|
||||
+ {
|
||||
+ int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START;
|
||||
+ _bfd_error_handler
|
||||
+ /* xgettext:c-format */
|
||||
+ (_("%B: relocation %s against `%s' can not be used when making "
|
||||
+ "a shared object; recompile with -fPIC"),
|
||||
+ abfd, elfNN_aarch64_howto_table[howto_index].name,
|
||||
+ (h) ? h->root.root.string : "a local symbol");
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ /* Fall through. */
|
||||
+
|
||||
+ case BFD_RELOC_AARCH64_16_PCREL:
|
||||
+ case BFD_RELOC_AARCH64_32_PCREL:
|
||||
+ case BFD_RELOC_AARCH64_64_PCREL:
|
||||
+ case BFD_RELOC_AARCH64_ADD_LO12:
|
||||
+ case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
|
||||
+ case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
|
||||
+ case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
|
||||
+ case BFD_RELOC_AARCH64_LDST128_LO12:
|
||||
+ case BFD_RELOC_AARCH64_LDST16_LO12:
|
||||
+ case BFD_RELOC_AARCH64_LDST32_LO12:
|
||||
+ case BFD_RELOC_AARCH64_LDST64_LO12:
|
||||
+ case BFD_RELOC_AARCH64_LDST8_LO12:
|
||||
+ case BFD_RELOC_AARCH64_LD_LO19_PCREL:
|
||||
+ if (h == NULL || bfd_link_pic (info))
|
||||
+ break;
|
||||
+ /* Fall through. */
|
||||
+
|
||||
case BFD_RELOC_AARCH64_NN:
|
||||
|
||||
/* We don't need to handle relocs into sections not going into
|
||||
@@ -7216,7 +7264,17 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
|
||||
/* If on the other hand, we are creating an executable, we
|
||||
may need to keep relocations for symbols satisfied by a
|
||||
dynamic library if we manage to avoid copy relocs for the
|
||||
- symbol. */
|
||||
+ symbol.
|
||||
+
|
||||
+ NOTE: Currently, there is no support of copy relocs
|
||||
+ elimination on pc-relative relocation types, because there is
|
||||
+ no dynamic relocation support for them in glibc. We still
|
||||
+ record the dynamic symbol reference for them. This is
|
||||
+ because one symbol may be referenced by both absolute
|
||||
+ relocation (for example, BFD_RELOC_AARCH64_NN) and
|
||||
+ pc-relative relocation. We need full symbol reference
|
||||
+ information to make correct decision later in
|
||||
+ elfNN_aarch64_adjust_dynamic_symbol. */
|
||||
|| (ELIMINATE_COPY_RELOCS
|
||||
&& !bfd_link_pic (info)
|
||||
&& h != NULL
|
||||
@@ -7227,6 +7285,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
|
||||
{
|
||||
struct elf_dyn_relocs *p;
|
||||
struct elf_dyn_relocs **head;
|
||||
+ int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START;
|
||||
|
||||
/* We must copy these reloc types into the output file.
|
||||
Create a reloc section in dynobj and make room for
|
||||
@@ -7290,6 +7349,8 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
|
||||
|
||||
p->count += 1;
|
||||
|
||||
+ if (elfNN_aarch64_howto_table[howto_index].pc_relative)
|
||||
+ p->pc_count += 1;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -7393,44 +7454,6 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
|
||||
break;
|
||||
}
|
||||
|
||||
- case BFD_RELOC_AARCH64_MOVW_G0_NC:
|
||||
- case BFD_RELOC_AARCH64_MOVW_G1_NC:
|
||||
- case BFD_RELOC_AARCH64_MOVW_G2_NC:
|
||||
- case BFD_RELOC_AARCH64_MOVW_G3:
|
||||
- if (bfd_link_pic (info))
|
||||
- {
|
||||
- int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START;
|
||||
- _bfd_error_handler
|
||||
- /* xgettext:c-format */
|
||||
- (_("%B: relocation %s against `%s' can not be used when making "
|
||||
- "a shared object; recompile with -fPIC"),
|
||||
- abfd, elfNN_aarch64_howto_table[howto_index].name,
|
||||
- (h) ? h->root.root.string : "a local symbol");
|
||||
- bfd_set_error (bfd_error_bad_value);
|
||||
- return FALSE;
|
||||
- }
|
||||
- /* Fall through. */
|
||||
-
|
||||
- case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
|
||||
- case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
|
||||
- case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
|
||||
- if (h != NULL && bfd_link_executable (info))
|
||||
- {
|
||||
- /* If this reloc is in a read-only section, we might
|
||||
- need a copy reloc. We can't check reliably at this
|
||||
- stage whether the section is read-only, as input
|
||||
- sections have not yet been mapped to output sections.
|
||||
- Tentatively set the flag for now, and correct in
|
||||
- adjust_dynamic_symbol. */
|
||||
- h->non_got_ref = 1;
|
||||
- h->plt.refcount += 1;
|
||||
- h->pointer_equality_needed = 1;
|
||||
- }
|
||||
- /* FIXME:: RR need to handle these in shared libraries
|
||||
- and essentially bomb out as these being non-PIC
|
||||
- relocations in shared libraries. */
|
||||
- break;
|
||||
-
|
||||
case BFD_RELOC_AARCH64_CALL26:
|
||||
case BFD_RELOC_AARCH64_JUMP26:
|
||||
/* If this is a local symbol then we resolve it
|
||||
diff -rupN binutils.orig/ld/testsuite/ld-aarch64/aarch64-elf.exp binutils-2.28/ld/testsuite/ld-aarch64/aarch64-elf.exp
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/aarch64-elf.exp 2017-06-15 15:12:31.263468684 +0100
|
||||
+++ binutils-2.28/ld/testsuite/ld-aarch64/aarch64-elf.exp 2017-06-15 15:12:52.797218241 +0100
|
||||
@@ -323,6 +323,8 @@ set aarch64elflinktests {
|
||||
{} "copy-reloc-so.so"}
|
||||
{"ld-aarch64/exe with copy relocation" "-e0 tmpdir/copy-reloc-so.so" "" ""
|
||||
{copy-reloc-exe.s} {{objdump -R copy-reloc.d}} "copy-reloc"}
|
||||
+ {"ld-aarch64/exe with copy relocation 2" "-e0 tmpdir/copy-reloc-so.so" "" ""
|
||||
+ {copy-reloc-exe-2.s} {{objdump -R copy-reloc-2.d}} "copy-reloc-2"}
|
||||
{"ld-aarch64/exe with copy relocation elimination" "-e0 tmpdir/copy-reloc-so.so" "" ""
|
||||
{copy-reloc-exe-eliminate.s} {{objdump -R copy-reloc-eliminate.d}} "copy-reloc-elimination"}
|
||||
}
|
||||
diff -rupN binutils.orig/ld/testsuite/ld-aarch64/copy-reloc-2.d binutils-2.28/ld/testsuite/ld-aarch64/copy-reloc-2.d
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/copy-reloc-2.d 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.28/ld/testsuite/ld-aarch64/copy-reloc-2.d 2017-06-15 15:12:52.797218241 +0100
|
||||
@@ -0,0 +1,7 @@
|
||||
+.*
|
||||
+DYNAMIC RELOCATION RECORDS
|
||||
+OFFSET.*TYPE.*VALUE.*
|
||||
+.*R_AARCH64_COPY.*global_[abcd]
|
||||
+.*R_AARCH64_COPY.*global_[abcd]
|
||||
+.*R_AARCH64_COPY.*global_[abcd]
|
||||
+.*R_AARCH64_COPY.*global_[abcd]
|
||||
diff -rupN binutils.orig/ld/testsuite/ld-aarch64/copy-reloc-exe-2.s binutils-2.28/ld/testsuite/ld-aarch64/copy-reloc-exe-2.s
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/copy-reloc-exe-2.s 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ binutils-2.28/ld/testsuite/ld-aarch64/copy-reloc-exe-2.s 2017-06-15 15:12:52.797218241 +0100
|
||||
@@ -0,0 +1,32 @@
|
||||
+ # expect copy relocation for all these scenarios.
|
||||
+ .global p
|
||||
+ .global q
|
||||
+ .global r
|
||||
+ .section .data.rel.ro,"aw",%progbits
|
||||
+ .align 3
|
||||
+ .type p, %object
|
||||
+ .size p, 8
|
||||
+p:
|
||||
+ .xword global_a
|
||||
+
|
||||
+ .type q, %object
|
||||
+ .size q, 8
|
||||
+q:
|
||||
+ .xword global_b
|
||||
+
|
||||
+ .type r, %object
|
||||
+ .size r, 8
|
||||
+r:
|
||||
+ # Any pc-rel relocation as no dynamic linker support on AArch64.
|
||||
+ .xword global_c - .
|
||||
+
|
||||
+ .text
|
||||
+ .global main
|
||||
+main:
|
||||
+ # Symbols are referenced by any other relocation against read-only
|
||||
+ # section.
|
||||
+ movz x0, :abs_g0_nc:global_a
|
||||
+ adrp x1, global_b
|
||||
+ # pc-rel.
|
||||
+ adrp x2, global_d
|
||||
+ add x2, x2, #:lo12:global_c
|
||||
diff -rupN binutils.orig/ld/testsuite/ld-aarch64/copy-reloc-so.s binutils-2.28/ld/testsuite/ld-aarch64/copy-reloc-so.s
|
||||
--- binutils.orig/ld/testsuite/ld-aarch64/copy-reloc-so.s 2017-06-15 15:12:31.263468684 +0100
|
||||
+++ binutils-2.28/ld/testsuite/ld-aarch64/copy-reloc-so.s 2017-06-15 15:12:52.797218241 +0100
|
||||
@@ -1,6 +1,25 @@
|
||||
.global global_a
|
||||
.type global_a, %object
|
||||
.size global_a, 4
|
||||
+
|
||||
+ .global global_b
|
||||
+ .type global_b, %object
|
||||
+ .size global_b, 4
|
||||
+
|
||||
+ .global global_c
|
||||
+ .type global_c, %object
|
||||
+ .size global_c, 4
|
||||
+
|
||||
+ .global global_d
|
||||
+ .type global_d, %object
|
||||
+ .size global_d, 4
|
||||
+
|
||||
.data
|
||||
global_a:
|
||||
.word 0xcafedead
|
||||
+global_b:
|
||||
+ .word 0xcafecafe
|
||||
+global_c:
|
||||
+ .word 0xdeadcafe
|
||||
+global_d:
|
||||
+ .word 0xdeaddead
|
@ -1,209 +0,0 @@
|
||||
commit 49fced1206db40c71208c201165d65f92c69cebe
|
||||
Author: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sun Mar 5 23:37:54 2017 +0100
|
||||
|
||||
gas: Emit name, comp_dir and producer strings in .debug_str.
|
||||
|
||||
Putting the name, comp_dir and producer strings in the .debug_str section
|
||||
makes it possible to share them across CUs. This saves a small amount of
|
||||
space (about ~20K on a glibc libc.so.6 build with debuginfo). And makes
|
||||
it easier for tools like rpm debugedit to adjust the source paths when
|
||||
generating separate debuginfo files.
|
||||
|
||||
gas/
|
||||
* dwarf2dbg.c (out_debug_abbrev): Use DW_FORM_strp instead of
|
||||
DW_FORM_string for DW_AT_name, DW_AT_comp_dir and DW_AT_producer.
|
||||
(out_debug_info): Accept symbols to name, comp_dir and producer
|
||||
in the .debug_str section and emit those offsets not full strings.
|
||||
(out_debug_str): New function that outputs the strings for name,
|
||||
comp_dir and producer in .debug_str and generates symbols to
|
||||
those strings.
|
||||
(out_debug_line): Create a .debug_str section if necessary and
|
||||
call out_debug_str before calling out_debug_info.
|
||||
* testsuite/gas/aarch64/dwarf.d: Add extra section symbol to
|
||||
expected output.
|
||||
|
||||
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
|
||||
index 4bb658b..e02b6e8 100644
|
||||
--- a/gas/dwarf2dbg.c
|
||||
+++ b/gas/dwarf2dbg.c
|
||||
@@ -1726,9 +1726,9 @@ out_debug_abbrev (segT abbrev_seg,
|
||||
else
|
||||
out_abbrev (DW_AT_ranges, DW_FORM_data8);
|
||||
}
|
||||
- out_abbrev (DW_AT_name, DW_FORM_string);
|
||||
- out_abbrev (DW_AT_comp_dir, DW_FORM_string);
|
||||
- out_abbrev (DW_AT_producer, DW_FORM_string);
|
||||
+ out_abbrev (DW_AT_name, DW_FORM_strp);
|
||||
+ out_abbrev (DW_AT_comp_dir, DW_FORM_strp);
|
||||
+ out_abbrev (DW_AT_producer, DW_FORM_strp);
|
||||
out_abbrev (DW_AT_language, DW_FORM_data2);
|
||||
out_abbrev (0, 0);
|
||||
|
||||
@@ -1739,15 +1739,11 @@ out_debug_abbrev (segT abbrev_seg,
|
||||
/* Emit a description of this compilation unit for .debug_info. */
|
||||
|
||||
static void
|
||||
-out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg)
|
||||
+out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg,
|
||||
+ symbolS *name_sym, symbolS *comp_dir_sym, symbolS *producer_sym)
|
||||
{
|
||||
- char producer[128];
|
||||
- const char *comp_dir;
|
||||
- const char *dirname;
|
||||
expressionS exp;
|
||||
symbolS *info_end;
|
||||
- char *p;
|
||||
- int len;
|
||||
int sizeof_offset;
|
||||
|
||||
sizeof_offset = out_header (info_seg, &exp);
|
||||
@@ -1798,10 +1794,38 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg)
|
||||
TC_DWARF2_EMIT_OFFSET (section_symbol (ranges_seg), sizeof_offset);
|
||||
}
|
||||
|
||||
+ /* DW_AT_name, DW_AT_comp_dir and DW_AT_producer. Symbols in .debug_str
|
||||
+ setup in out_debug_str below. */
|
||||
+ TC_DWARF2_EMIT_OFFSET (name_sym, sizeof_offset);
|
||||
+ TC_DWARF2_EMIT_OFFSET (comp_dir_sym, sizeof_offset);
|
||||
+ TC_DWARF2_EMIT_OFFSET (producer_sym, sizeof_offset);
|
||||
+
|
||||
+ /* DW_AT_language. Yes, this is probably not really MIPS, but the
|
||||
+ dwarf2 draft has no standard code for assembler. */
|
||||
+ out_two (DW_LANG_Mips_Assembler);
|
||||
+
|
||||
+ symbol_set_value_now (info_end);
|
||||
+}
|
||||
+
|
||||
+/* Emit the three debug strings needed in .debug_str and setup symbols
|
||||
+ to them for use in out_debug_info. */
|
||||
+static void
|
||||
+out_debug_str (segT str_seg, symbolS **name_sym, symbolS **comp_dir_sym,
|
||||
+ symbolS **producer_sym)
|
||||
+{
|
||||
+ char producer[128];
|
||||
+ const char *comp_dir;
|
||||
+ const char *dirname;
|
||||
+ char *p;
|
||||
+ int len;
|
||||
+
|
||||
+ subseg_set (str_seg, 0);
|
||||
+
|
||||
/* DW_AT_name. We don't have the actual file name that was present
|
||||
on the command line, so assume files[1] is the main input file.
|
||||
We're not supposed to get called unless at least one line number
|
||||
entry was emitted, so this should always be defined. */
|
||||
+ *name_sym = symbol_temp_new_now ();
|
||||
if (files_in_use == 0)
|
||||
abort ();
|
||||
if (files[1].dir)
|
||||
@@ -1823,22 +1847,18 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg)
|
||||
memcpy (p, files[1].filename, len);
|
||||
|
||||
/* DW_AT_comp_dir */
|
||||
+ *comp_dir_sym = symbol_temp_new_now ();
|
||||
comp_dir = remap_debug_filename (getpwd ());
|
||||
len = strlen (comp_dir) + 1;
|
||||
p = frag_more (len);
|
||||
memcpy (p, comp_dir, len);
|
||||
|
||||
/* DW_AT_producer */
|
||||
+ *producer_sym = symbol_temp_new_now ();
|
||||
sprintf (producer, "GNU AS %s", VERSION);
|
||||
len = strlen (producer) + 1;
|
||||
p = frag_more (len);
|
||||
memcpy (p, producer, len);
|
||||
-
|
||||
- /* DW_AT_language. Yes, this is probably not really MIPS, but the
|
||||
- dwarf2 draft has no standard code for assembler. */
|
||||
- out_two (DW_LANG_Mips_Assembler);
|
||||
-
|
||||
- symbol_set_value_now (info_end);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1907,19 +1927,22 @@ dwarf2_finish (void)
|
||||
out_debug_line (line_seg);
|
||||
|
||||
/* If this is assembler generated line info, and there is no
|
||||
- debug_info already, we need .debug_info and .debug_abbrev
|
||||
- sections as well. */
|
||||
+ debug_info already, we need .debug_info, .debug_abbrev and
|
||||
+ .debug_str sections as well. */
|
||||
if (emit_other_sections)
|
||||
{
|
||||
segT abbrev_seg;
|
||||
segT aranges_seg;
|
||||
segT ranges_seg;
|
||||
+ segT str_seg;
|
||||
+ symbolS *name_sym, *comp_dir_sym, *producer_sym;
|
||||
|
||||
gas_assert (all_segs);
|
||||
|
||||
info_seg = subseg_new (".debug_info", 0);
|
||||
abbrev_seg = subseg_new (".debug_abbrev", 0);
|
||||
aranges_seg = subseg_new (".debug_aranges", 0);
|
||||
+ str_seg = subseg_new (".debug_str", 0);
|
||||
|
||||
bfd_set_section_flags (stdoutput, info_seg,
|
||||
SEC_READONLY | SEC_DEBUGGING);
|
||||
@@ -1927,6 +1950,10 @@ dwarf2_finish (void)
|
||||
SEC_READONLY | SEC_DEBUGGING);
|
||||
bfd_set_section_flags (stdoutput, aranges_seg,
|
||||
SEC_READONLY | SEC_DEBUGGING);
|
||||
+ bfd_set_section_flags (stdoutput, str_seg,
|
||||
+ (SEC_READONLY | SEC_DEBUGGING
|
||||
+ | SEC_MERGE | SEC_STRINGS));
|
||||
+ str_seg->entsize = 1;
|
||||
|
||||
record_alignment (aranges_seg, ffs (2 * sizeof_address) - 1);
|
||||
|
||||
@@ -1943,6 +1970,8 @@ dwarf2_finish (void)
|
||||
|
||||
out_debug_aranges (aranges_seg, info_seg);
|
||||
out_debug_abbrev (abbrev_seg, info_seg, line_seg);
|
||||
- out_debug_info (info_seg, abbrev_seg, line_seg, ranges_seg);
|
||||
+ out_debug_str (str_seg, &name_sym, &comp_dir_sym, &producer_sym);
|
||||
+ out_debug_info (info_seg, abbrev_seg, line_seg, ranges_seg,
|
||||
+ name_sym, comp_dir_sym, producer_sym);
|
||||
}
|
||||
}
|
||||
diff --git a/gas/testsuite/gas/aarch64/dwarf.d b/gas/testsuite/gas/aarch64/dwarf.d
|
||||
index 005f1d5..2a75e0b 100644
|
||||
--- a/gas/testsuite/gas/aarch64/dwarf.d
|
||||
+++ b/gas/testsuite/gas/aarch64/dwarf.d
|
||||
@@ -1,7 +1,7 @@
|
||||
#readelf: -s --debug-dump=aranges
|
||||
#as: -g
|
||||
|
||||
-Symbol table '.symtab' contains 10 entries:
|
||||
+Symbol table '.symtab' contains 11 entries:
|
||||
Num:[ ]+Value[ ]+Size[ ]+Type[ ]+Bind[ ]+Vis[ ]+Ndx[ ]+Name
|
||||
0: 0+ 0 NOTYPE LOCAL DEFAULT UND[ ]+
|
||||
1: 0+ 0 SECTION LOCAL DEFAULT 1[ ]+
|
||||
@@ -11,8 +11,9 @@ Symbol table '.symtab' contains 10 entries:
|
||||
5: 0+ 0 SECTION LOCAL DEFAULT 6[ ]+
|
||||
6: 0+ 0 SECTION LOCAL DEFAULT 8[ ]+
|
||||
7: 0+ 0 SECTION LOCAL DEFAULT 4[ ]+
|
||||
- 8: 0+ 0 SECTION LOCAL DEFAULT 9[ ]+
|
||||
- 9: 0+ 8 FUNC GLOBAL DEFAULT 1 testfunc
|
||||
+ 8: 0+ 0 SECTION LOCAL DEFAULT 11[ ]+
|
||||
+ 9: 0+ 0 SECTION LOCAL DEFAULT 9[ ]+
|
||||
+ 10: 0+ 8 FUNC GLOBAL DEFAULT 1 testfunc
|
||||
Contents of the .debug_aranges section:
|
||||
|
||||
Length: (44|28)
|
||||
--- binutils.orig/gas/config/tc-s390.c 2017-07-19 15:24:06.295642817 +0100
|
||||
+++ binutils-2.28/gas/config/tc-s390.c 2017-07-19 15:24:39.085277066 +0100
|
||||
@@ -2135,8 +2135,9 @@ md_pcrel_from_section (fixS *fixp, segT
|
||||
int
|
||||
tc_s390_fix_adjustable (fixS *fixP)
|
||||
{
|
||||
- /* Don't adjust references to merge sections. */
|
||||
- if ((S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_MERGE) != 0)
|
||||
+ /* Don't adjust pc-relative references to merge sections. */
|
||||
+ if (fixP->fx_pcrel
|
||||
+ && (S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_MERGE) != 0)
|
||||
return 0;
|
||||
/* adjust_reloc_syms doesn't know about the GOT. */
|
||||
if ( fixP->fx_r_type == BFD_RELOC_16_GOTOFF
|
@ -1,104 +0,0 @@
|
||||
diff -rup binutils-2.28/libiberty/configure /work/sources/binutils/current/libiberty/configure
|
||||
--- binutils-2.28/libiberty/configure 2017-03-02 11:41:42.254309307 +0000
|
||||
+++ /work/sources/binutils/current/libiberty/configure 2017-01-04 16:01:24.944939339 +0000
|
||||
@@ -5097,7 +5097,7 @@ case "${host}" in
|
||||
# If we are using a compiler supporting mdynamic-no-pic
|
||||
# and the option has been tested as safe to add, then cancel
|
||||
# it here, since the code generated is incompatible with shared
|
||||
- # libs.
|
||||
+ # libs.
|
||||
*-mdynamic-no-pic*) PICFLAG='-fno-common -mno-dynamic-no-pic' ;;
|
||||
*) PICFLAG=-fno-common ;;
|
||||
esac
|
||||
diff -rup binutils-2.28/libiberty/cp-demangle.c /work/sources/binutils/current/libiberty/cp-demangle.c
|
||||
--- binutils-2.28/libiberty/cp-demangle.c 2017-03-02 08:28:19.000000000 +0000
|
||||
+++ /work/sources/binutils/current/libiberty/cp-demangle.c 2017-03-01 14:37:20.557586479 +0000
|
||||
@@ -2595,7 +2594,11 @@ cplus_demangle_type (struct d_info *di)
|
||||
/* auto */
|
||||
ret = d_make_name (di, "auto", 4);
|
||||
break;
|
||||
-
|
||||
+ case 'c':
|
||||
+ /* decltype(auto) */
|
||||
+ ret = d_make_name (di, "decltype(auto)", 14);
|
||||
+ break;
|
||||
+
|
||||
case 'f':
|
||||
/* 32-bit decimal floating point */
|
||||
ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[26]);
|
||||
diff -rup binutils-2.28/libiberty/Makefile.in /work/sources/binutils/current/libiberty/Makefile.in
|
||||
--- binutils-2.28/libiberty/Makefile.in 2016-12-23 08:40:18.000000000 +0000
|
||||
+++ /work/sources/binutils/current/libiberty/Makefile.in 2017-01-04 16:01:24.943939351 +0000
|
||||
@@ -1,9 +1,7 @@
|
||||
# Makefile for the libiberty library.
|
||||
# Originally written by K. Richard Pixley <rich@cygnus.com>.
|
||||
#
|
||||
-# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||
-# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
|
||||
-# 2012, 2014, 2015 Free Software Foundation
|
||||
+# Copyright (C) 1990-2017 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of the libiberty library.
|
||||
# Libiberty is free software; you can redistribute it and/or
|
||||
@@ -484,7 +482,8 @@ configure_deps = $(srcdir)/aclocal.m4 \
|
||||
$(srcdir)/../config/acx.m4 \
|
||||
$(srcdir)/../config/no-executables.m4 \
|
||||
$(srcdir)/../config/override.m4 \
|
||||
- $(srcdir)/../config/warnings.m4 \
|
||||
+ $(srcdir)/../config/picflag.m4 \
|
||||
+ $(srcdir)/../config/warnings.m4
|
||||
|
||||
$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
diff -rup binutils-2.28/libiberty/strndup.c /work/sources/binutils/current/libiberty/strndup.c
|
||||
--- binutils-2.28/libiberty/strndup.c 2013-11-04 15:33:40.000000000 +0000
|
||||
+++ /work/sources/binutils/current/libiberty/strndup.c 2017-01-04 16:01:24.950939263 +0000
|
||||
@@ -33,7 +33,7 @@ memory was available. The result is alw
|
||||
#include "ansidecl.h"
|
||||
#include <stddef.h>
|
||||
|
||||
-extern size_t strlen (const char*);
|
||||
+extern size_t strnlen (const char *s, size_t maxlen);
|
||||
extern PTR malloc (size_t);
|
||||
extern PTR memcpy (PTR, const PTR, size_t);
|
||||
|
||||
@@ -41,10 +41,7 @@ char *
|
||||
strndup (const char *s, size_t n)
|
||||
{
|
||||
char *result;
|
||||
- size_t len = strlen (s);
|
||||
-
|
||||
- if (n < len)
|
||||
- len = n;
|
||||
+ size_t len = strnlen (s, n);
|
||||
|
||||
result = (char *) malloc (len + 1);
|
||||
if (!result)
|
||||
diff -rup binutils-2.28/libiberty/testsuite/demangle-expected /work/sources/binutils/current/libiberty/testsuite/demangle-expected
|
||||
--- binutils-2.28/libiberty/testsuite/demangle-expected 2017-03-02 08:28:19.000000000 +0000
|
||||
+++ /work/sources/binutils/current/libiberty/testsuite/demangle-expected 2017-03-01 14:37:55.295138174 +0000
|
||||
@@ -4200,6 +4200,9 @@ decltype (new auto({parm#1})) f<int>(int
|
||||
_Z1fIiERDaRKT_S1_
|
||||
auto& f<int>(int const&, int)
|
||||
--format=gnu-v3
|
||||
+_Z1gIiEDcRKT_S0_
|
||||
+decltype(auto) g<int>(int const&, int)
|
||||
+--format=gnu-v3
|
||||
_Z1gILi1EEvR1AIXT_EER1BIXscbT_EE
|
||||
void g<1>(A<1>&, B<static_cast<bool>(1)>&)
|
||||
--format=gnu-v3
|
||||
diff -rup binutils-2.28/libiberty/xstrndup.c /work/sources/binutils/current/libiberty/xstrndup.c
|
||||
--- binutils-2.28/libiberty/xstrndup.c 2013-11-04 15:33:40.000000000 +0000
|
||||
+++ /work/sources/binutils/current/libiberty/xstrndup.c 2017-01-04 16:01:24.951939251 +0000
|
||||
@@ -48,10 +48,7 @@ char *
|
||||
xstrndup (const char *s, size_t n)
|
||||
{
|
||||
char *result;
|
||||
- size_t len = strlen (s);
|
||||
-
|
||||
- if (n < len)
|
||||
- len = n;
|
||||
+ size_t len = strnlen (s, n);
|
||||
|
||||
result = XNEWVEC (char, len + 1);
|
||||
|
@ -1,15 +0,0 @@
|
||||
--- binutils.orig/bfd/elf64-ppc.c 2017-03-08 15:44:25.132804697 +0000
|
||||
+++ binutils-2.28/bfd/elf64-ppc.c 2017-03-08 15:44:54.596440794 +0000
|
||||
@@ -14798,8 +14798,10 @@ ppc64_elf_relocate_section (bfd *output_
|
||||
break;
|
||||
|
||||
if (bfd_link_pic (info)
|
||||
- ? ((h != NULL && pc_dynrelocs (h))
|
||||
- || must_be_dyn_reloc (info, r_type))
|
||||
+ ? ((h == NULL
|
||||
+ || h->dyn_relocs != NULL)
|
||||
+ && ((h != NULL && pc_dynrelocs (h))
|
||||
+ || must_be_dyn_reloc (info, r_type)))
|
||||
: (h != NULL
|
||||
? h->dyn_relocs != NULL
|
||||
: ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC))
|
@ -1,7 +1,7 @@
|
||||
--- binutils-2.27.orig/binutils/readelf.c 2017-01-16 11:51:05.043922264 +0000
|
||||
+++ binutils-2.27/binutils/readelf.c 2017-01-16 12:01:34.389053872 +0000
|
||||
@@ -16733,39 +16733,49 @@ process_archive (char * file_name, FILE
|
||||
static int
|
||||
--- binutils.orig/binutils/readelf.c 2017-07-24 15:27:09.859116315 +0100
|
||||
+++ binutils-2.29/binutils/readelf.c 2017-07-24 15:30:33.557770525 +0100
|
||||
@@ -18414,39 +18414,49 @@ process_archive (char * file_name, FILE
|
||||
static bfd_boolean
|
||||
process_file (char * file_name)
|
||||
{
|
||||
+ char * name;
|
||||
@ -9,9 +9,8 @@
|
||||
FILE * file;
|
||||
struct stat statbuf;
|
||||
char armag[SARMAG];
|
||||
- int ret;
|
||||
+ int ret = 1;
|
||||
+
|
||||
bfd_boolean ret = TRUE;
|
||||
|
||||
+ /* Overload program_name to include file_name. Doing this means
|
||||
+ that warning/error messages will positively identify the file
|
||||
+ concerned even when multiple instances of readelf are running. */
|
||||
@ -19,7 +18,7 @@
|
||||
+ sprintf (name, "%s: %s", program_name, file_name);
|
||||
+ saved_program_name = program_name;
|
||||
+ program_name = name;
|
||||
|
||||
+
|
||||
if (stat (file_name, &statbuf) < 0)
|
||||
{
|
||||
if (errno == ENOENT)
|
||||
@ -28,7 +27,7 @@
|
||||
else
|
||||
- error (_("Could not locate '%s'. System error message: %s\n"),
|
||||
- file_name, strerror (errno));
|
||||
- return 1;
|
||||
- return FALSE;
|
||||
+ error (_("Could not locate file. System error message: %s\n"),
|
||||
+ strerror (errno));
|
||||
+ goto done;
|
||||
@ -37,7 +36,7 @@
|
||||
if (! S_ISREG (statbuf.st_mode))
|
||||
{
|
||||
- error (_("'%s' is not an ordinary file\n"), file_name);
|
||||
- return 1;
|
||||
- return FALSE;
|
||||
+ error (_("Not an ordinary file\n"));
|
||||
+ goto done;
|
||||
}
|
||||
@ -46,7 +45,7 @@
|
||||
if (file == NULL)
|
||||
{
|
||||
- error (_("Input file '%s' is not readable.\n"), file_name);
|
||||
- return 1;
|
||||
- return FALSE;
|
||||
+ error (_("Not readable\n"));
|
||||
+ goto done;
|
||||
}
|
||||
@ -56,29 +55,19 @@
|
||||
- error (_("%s: Failed to read file's magic number\n"), file_name);
|
||||
+ error (_("Failed to read file's magic number\n"));
|
||||
fclose (file);
|
||||
- return 1;
|
||||
- return FALSE;
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
current_file_size = (bfd_size_type) statbuf.st_size;
|
||||
@@ -16777,8 +16787,7 @@ process_file (char * file_name)
|
||||
else
|
||||
{
|
||||
if (do_archive_index)
|
||||
- error (_("File %s is not an archive so its index cannot be displayed.\n"),
|
||||
- file_name);
|
||||
+ error (_("Not an archive so its index cannot be displayed\n"));
|
||||
|
||||
rewind (file);
|
||||
archive_file_size = archive_file_offset = 0;
|
||||
@@ -16787,7 +16796,10 @@ process_file (char * file_name)
|
||||
@@ -18474,7 +18484,10 @@ process_file (char * file_name)
|
||||
}
|
||||
|
||||
fclose (file);
|
||||
|
||||
+ done:
|
||||
current_file_size = 0;
|
||||
+ free (program_name);
|
||||
+ program_name = saved_program_name;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
32
binutils-2.29-skip-rp14918-test-for-arm.patch
Normal file
32
binutils-2.29-skip-rp14918-test-for-arm.patch
Normal file
@ -0,0 +1,32 @@
|
||||
--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2017-07-24 15:24:18.365091235 +0100
|
||||
+++ binutils-2.29/ld/testsuite/ld-plugin/lto.exp 2017-07-24 15:25:25.567317336 +0100
|
||||
@@ -301,9 +301,6 @@ set lto_link_elf_tests [list \
|
||||
[list "PR ld/16746 (2)" \
|
||||
"-O2 -flto -fuse-linker-plugin tmpdir/pr16746c.o tmpdir/pr16746a.o" "-O2 -flto" \
|
||||
{dummy.c} {} "pr16746b.exe"] \
|
||||
- [list "PR ld/14918" \
|
||||
- "-flto" "-flto" \
|
||||
- {pr14918.c} {{"readelf" {-d --wide} "pr14918.d"}} "pr14918.exe" "c"] \
|
||||
[list "Build pr21382a.o" \
|
||||
"" "-O2 -flto" \
|
||||
{pr21382a.c} {} "" "c"] \
|
||||
@@ -312,6 +309,19 @@ set lto_link_elf_tests [list \
|
||||
{pr21382b.c} {} "pr21382.so" "c"] \
|
||||
]
|
||||
|
||||
+# PR 14918 checks that libgcc is not spuriously included in a shared link of
|
||||
+# an empty program. The ARM crt1.o startup code however calls __libc_csu_init
|
||||
+# in /usr/lib/libc_nonshared.a(elf-init.oS). This in turn needs
|
||||
+# __aeabi_unwind_cpp_pr0@@GCC_3.5 which is provided by libgcc_s.so.1, so the
|
||||
+# test fails. Hence this code to skip the test.
|
||||
+if { ! [istarget "arm*-*-*"] } {
|
||||
+ set lto_link_elf_tests [concat $lto_link_elf_tests [list \
|
||||
+ [list "PR ld/14918" \
|
||||
+ "-flto" "-flto" \
|
||||
+ {pr14918.c} {{"readelf" {-d --wide} "pr14918.d"}} "pr14918.exe" "c"] \
|
||||
+ ]]
|
||||
+}
|
||||
+
|
||||
# Check final symbols in executables.
|
||||
set lto_link_symbol_tests [list \
|
||||
[list "LTO 3 symbol" \
|
File diff suppressed because it is too large
Load Diff
@ -42,8 +42,8 @@
|
||||
|
||||
Summary: A GNU collection of binary utilities
|
||||
Name: %{?cross}binutils%{?_with_debug:-debug}
|
||||
Version: 2.28
|
||||
Release: 14%{?dist}
|
||||
Version: 2.29
|
||||
Release: 1%{?dist}
|
||||
License: GPLv3+
|
||||
Group: Development/Tools
|
||||
URL: http://sources.redhat.com/binutils
|
||||
@ -52,49 +52,32 @@ URL: http://sources.redhat.com/binutils
|
||||
# many controversial patches so we stick with the official FSF version
|
||||
# instead.
|
||||
|
||||
Source: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.bz2
|
||||
Source: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz
|
||||
|
||||
Source2: binutils-2.19.50.0.1-output-format.sed
|
||||
|
||||
Patch01: binutils-2.20.51.0.2-libtool-lib64.patch
|
||||
Patch02: binutils-2.20.51.0.10-ppc64-pie.patch
|
||||
Patch03: binutils-2.25-version.patch
|
||||
Patch04: binutils-2.25-set-long-long.patch
|
||||
Patch05: binutils-2.20.51.0.10-sec-merge-emit.patch
|
||||
Patch02: binutils-2.25-version.patch
|
||||
Patch03: binutils-2.25-set-long-long.patch
|
||||
Patch04: binutils-2.20.51.0.10-sec-merge-emit.patch
|
||||
# Enable -zrelro by default: BZ #621983
|
||||
Patch06: binutils-2.22.52.0.1-relro-on-by-default.patch
|
||||
Patch05: binutils-2.22.52.0.1-relro-on-by-default.patch
|
||||
# Local patch - export demangle.h with the binutils-devel rpm.
|
||||
Patch07: binutils-2.22.52.0.1-export-demangle.h.patch
|
||||
Patch06: binutils-2.22.52.0.1-export-demangle.h.patch
|
||||
# Disable checks that config.h has been included before system headers. BZ #845084
|
||||
Patch08: binutils-2.22.52.0.4-no-config-h-check.patch
|
||||
Patch07: binutils-2.22.52.0.4-no-config-h-check.patch
|
||||
# Fix detections little endian PPC shared libraries
|
||||
Patch09: binutils-2.24-ldforcele.patch
|
||||
Patch10: binutils-2.25.1-cleansweep.patch
|
||||
Patch11: binutils-2.26-fix-compile-warnings.patch
|
||||
Patch08: binutils-2.24-ldforcele.patch
|
||||
Patch09: binutils-2.25.1-cleansweep.patch
|
||||
Patch10: binutils-2.26-fix-compile-warnings.patch
|
||||
# Import H.J.Lu's Kernel LTO patch.
|
||||
Patch12: binutils-2.26-lto.patch
|
||||
Patch11: binutils-2.26-lto.patch
|
||||
# Skip PR14918 linker test for ARM native targets.
|
||||
Patch13: binutils-2.27-skip-rp14918-test-for-arm.patch
|
||||
Patch12: binutils-2.29-skip-rp14918-test-for-arm.patch
|
||||
# Include the filename concerned in readelf error messages.
|
||||
Patch14: binutils-2.27-filename-in-error-messages.patch
|
||||
# Fix a couple of buffer overflows when printing messages in translated strings.
|
||||
Patch15: binutils-2.27-ld-buffer-overflow.patch
|
||||
# Sync libiberty sources with FSF GCC mainline.
|
||||
Patch16: binutils-2.28-libiberty-bugfixes.patch
|
||||
# Add support for GNU BUILD NOTEs.
|
||||
Patch17: binutils-gnu-build-notes.patch
|
||||
# GAS: Emit name, comp_dir and producer strings in .debug_str.
|
||||
Patch18: binutils-2.28-gas-comp_dir.patch
|
||||
# Import fix for PR 21124 and 20519
|
||||
Patch19: binutils-2.28-ppc-dynamic-relocs.patch
|
||||
# Have readelf skip checks of the dynamic section when its type is SHT_NOBITS.
|
||||
Patch20: binutils-2.28-dynamic-section-warning.patch
|
||||
# Fix incorrect generation of copy relocs on AArch64.
|
||||
Patch21: binutils-2.28-aarch64-copy-relocs.patch
|
||||
Patch13: binutils-2.29-filename-in-error-messages.patch
|
||||
# Ignore duplicate indirect symbols generated by GOLD.
|
||||
Patch22: binutils-2.28-ignore-gold-duplicates.patch
|
||||
# Add support for displaying new DWARF5 tags including DW_AT_export_symbols.
|
||||
Patch23: binutils-2.28-DW_AT_export_symbols.patch
|
||||
Patch14: binutils-2.28-ignore-gold-duplicates.patch
|
||||
|
||||
Provides: bundled(libiberty)
|
||||
|
||||
@ -213,32 +196,21 @@ using libelf instead of BFD.
|
||||
%prep
|
||||
%setup -q -n binutils-%{version}
|
||||
%patch01 -p1 -b .libtool-lib64~
|
||||
%patch02 -p1 -b .ppc64-pie~
|
||||
%patch03 -p1 -b .version~
|
||||
%patch04 -p1 -b .set-long-long~
|
||||
%patch05 -p1 -b .sec-merge-emit~
|
||||
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
|
||||
%patch06 -p1 -b .relro~
|
||||
%endif
|
||||
%patch07 -p1 -b .export-demangle-h~
|
||||
%patch08 -p1 -b .no-config-h-check~
|
||||
%patch02 -p1 -b .version~
|
||||
%patch03 -p1 -b .set-long-long~
|
||||
%patch04 -p1 -b .sec-merge-emit~
|
||||
%patch05 -p1 -b .relro~
|
||||
%patch06 -p1 -b .export-demangle-h~
|
||||
%patch07 -p1 -b .no-config-h-check~
|
||||
%ifarch ppc64le
|
||||
%patch09 -p1 -b .ldforcele~
|
||||
%patch08 -p1 -b .ldforcele~
|
||||
%endif
|
||||
%patch10 -p0
|
||||
%patch09 -p0
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
%patch19 -p1
|
||||
%patch20 -p1
|
||||
%patch21 -p1
|
||||
%patch22 -p1
|
||||
%patch23 -p1
|
||||
|
||||
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
|
||||
|
||||
@ -605,6 +577,18 @@ exit 0
|
||||
%endif # %{isnative}
|
||||
|
||||
%changelog
|
||||
* Mon Jul 24 2017 Nick Clifton <nickc@redhat.com> 2.29-1
|
||||
- Rebase on FSF binutils 2.29.
|
||||
- Retire: binutils-2.20.51.0.10-ppc64-pie.patch
|
||||
- Retire: binutils-2.27-ld-buffer-overflow.patch
|
||||
- Retire: binutils-2.28-libiberty-bugfixes.patch
|
||||
- Retire: binutils-gnu-build-notes.patch
|
||||
- Retire: binutils-2.28-gas-comp_dir.patch
|
||||
- Retire: binutils-2.28-ppc-dynamic-relocs.patch
|
||||
- Retire: binutils-2.28-dynamic-section-warning.patch
|
||||
- Retire: binutils-2.28-aarch64-copy-relocs.patch
|
||||
- Retire: binutils-2.28-DW_AT_export_symbols.patch
|
||||
|
||||
* Thu Jul 20 2017 Nick Clifton <nickc@redhat.com> 2.28-14
|
||||
- Remove -flto compile time option accidentally added to CFLAGS.
|
||||
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (binutils-2.28.tar.bz2) = ede2e4e59a800260eea8c14eafbaee94e30abadafd5c419a3370f9f62213cf027d6400a1d4970b6958bd4d220e675dcd483a708107016e7abd5c99d7392ba8fd
|
||||
SHA512 (binutils-2.29.tar.xz) = bb227c7af65133a61bbde8be4104a543f4185fce8c8e7be22c36d92d121d28b5413d42f18c7e987d035d6312c542d0e2aaca8930386a4ce26d7c9d7248145398
|
||||
|
Loading…
Reference in New Issue
Block a user