- Update binutils-2.26-branch.diff, updates to branch head.

(swo#19739) (swo#19775)

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=208
This commit is contained in:
Richard Biener 2016-03-09 11:21:52 +00:00 committed by Git OBS Bridge
parent b8241668cd
commit 37e85f4b2b
22 changed files with 684 additions and 24 deletions

View File

@ -1,8 +1,28 @@
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e860c3e..4dbc32f 100644
index e860c3e..0a08b55 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,81 @@
@@ -1,3 +1,101 @@
+2016-03-09 Nick Clifton <nickc@redhat.com>
+ Alan Modra <amodra@gmail.com>
+
+ PR binutils/19775
+ * archive.c (bfd_generic_openr_next_archived_file): Allow zero
+ length elements in the archive.
+ * coff-alpha.c (alpha_ecoff_openr_next_archived_file): Likewise.
+
+2016-03-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/19752
+ Backport from master
+ 2015-12-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * coff-x86_64.c (coff_amd64_reloc): Fix formatting.
+
+ 2015-12-18 Nick Clifton <nickc@redhat.com>
+
+ * coff-i386.c (coff_i386_reloc): Fix formatting.
+
+2016-02-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from master
@ -84,7 +104,7 @@ index e860c3e..4dbc32f 100644
2016-01-25 Tristan Gingold <gingold@adacore.com>
* version.m4: Bump version to 2.26
@@ -119,7 +197,7 @@
@@ -119,7 +217,7 @@
* configure: Regenerate.
2015-11-11 Alan Modra <amodra@gmail.com>
@ -93,7 +113,7 @@ index e860c3e..4dbc32f 100644
* elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_REL16DX_HA.
(ppc_elf_reloc_type_lookup): Handle R_PPC_REL16DX_HA.
@@ -179,8 +257,8 @@
@@ -179,8 +277,8 @@
2015-10-29 Catherine Moore <clm@codesourcery.com>
@ -104,7 +124,7 @@ index e860c3e..4dbc32f 100644
2015-10-29 Ed Schouten <ed@nuxi.nl>
@@ -232,7 +310,7 @@
@@ -232,7 +330,7 @@
* bfd-in2.h: Regenerate.
2015-10-27 Laurent Alfonsi <laurent.alfonsi@st.com>
@ -113,7 +133,7 @@ index e860c3e..4dbc32f 100644
* bfd-in2.h: Regenerate.
* bfd-in.h (bfd_arm_stm32l4xx_fix): New enum. Specify how
@@ -1225,115 +1303,115 @@
@@ -1225,115 +1323,115 @@
2015-08-18 H.J. Lu <hongjiu.lu@intel.com>
@ -336,7 +356,7 @@ index e860c3e..4dbc32f 100644
2015-08-18 Alan Modra <amodra@gmail.com>
@@ -1387,7 +1465,7 @@
@@ -1387,7 +1485,7 @@
2015-08-11 Jiong Wang <jiong.wang@arm.com>
@ -345,7 +365,7 @@ index e860c3e..4dbc32f 100644
Loose the check for symbol from ABS section.
(elfNN_aarch64_size_stubs): Pass sym_sec.
@@ -1688,10 +1766,10 @@
@@ -1688,10 +1786,10 @@
2015-07-10 H.J. Lu <hongjiu.lu@intel.com>
@ -360,7 +380,7 @@ index e860c3e..4dbc32f 100644
2015-07-09 Catherine Moore <clm@codesourcery.com>
@@ -2004,7 +2082,6 @@
@@ -2004,7 +2102,6 @@
Bernd Schmidt <bernds@codesourcery.com>
Paul Brook <paul@codesourcery.com>
@ -368,7 +388,7 @@ index e860c3e..4dbc32f 100644
* bfd-in2.h: Regenerated.
* elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define.
(COMPACT_EH_CANT_UNWIND_OPCODE): Define.
@@ -2913,7 +2990,7 @@
@@ -2913,7 +3010,7 @@
2015-03-18 H.J. Lu <hongjiu.lu@intel.com>
* compress.c (bfd_compress_section_contents): Make it static.
@ -377,7 +397,7 @@ index e860c3e..4dbc32f 100644
2015-03-18 Eric Youngdale <eyoungdale@ptc.com>
@@ -3062,8 +3139,8 @@
@@ -3062,8 +3159,8 @@
2015-02-27 Marcus Shawcroft <marcus.shawcroft@arm.com>
@ -388,7 +408,7 @@ index e860c3e..4dbc32f 100644
2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
@@ -3534,7 +3611,7 @@
@@ -3534,7 +3631,7 @@
is weak or pointer_equality_needed is FALSE.
* elf32-arm.c (elf32_arm_finish_dynamic_symbol): Improve
@ -397,6 +417,224 @@ index e860c3e..4dbc32f 100644
2015-02-02 Kuan-Lin Chen <kuanlinchentw@gmail.com>
diff --git a/bfd/archive.c b/bfd/archive.c
index b3d03d3..1fc3a94 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -802,7 +802,7 @@ bfd_generic_openr_next_archived_file (bfd *archive, bfd *last_file)
Note that last_file->origin can be odd in the case of
BSD-4.4-style element with a long odd size. */
filestart += filestart % 2;
- if (filestart <= last_file->proxy_origin)
+ if (filestart < last_file->proxy_origin)
{
/* Prevent looping. See PR19256. */
bfd_set_error (bfd_error_malformed_archive);
diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index 7478f2f..fffb9f7 100644
--- a/bfd/coff-alpha.c
+++ b/bfd/coff-alpha.c
@@ -2208,7 +2208,7 @@ alpha_ecoff_openr_next_archived_file (bfd *archive, bfd *last_file)
BSD-4.4-style element with a long odd size. */
filestart = last_file->proxy_origin + size;
filestart += filestart % 2;
- if (filestart <= last_file->proxy_origin)
+ if (filestart < last_file->proxy_origin)
{
/* Prevent looping. See PR19256. */
bfd_set_error (bfd_error_malformed_archive);
diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c
index a9725c4..1b1a815 100644
--- a/bfd/coff-i386.c
+++ b/bfd/coff-i386.c
@@ -139,41 +139,41 @@ coff_i386_reloc (bfd *abfd,
#define DOIT(x) \
x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask))
- if (diff != 0)
- {
- reloc_howto_type *howto = reloc_entry->howto;
- unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+ if (diff != 0)
+ {
+ reloc_howto_type *howto = reloc_entry->howto;
+ unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+
+ switch (howto->size)
+ {
+ case 0:
+ {
+ char x = bfd_get_8 (abfd, addr);
+ DOIT (x);
+ bfd_put_8 (abfd, x, addr);
+ }
+ break;
- switch (howto->size)
+ case 1:
{
- case 0:
- {
- char x = bfd_get_8 (abfd, addr);
- DOIT (x);
- bfd_put_8 (abfd, x, addr);
- }
- break;
-
- case 1:
- {
- short x = bfd_get_16 (abfd, addr);
- DOIT (x);
- bfd_put_16 (abfd, (bfd_vma) x, addr);
- }
- break;
-
- case 2:
- {
- long x = bfd_get_32 (abfd, addr);
- DOIT (x);
- bfd_put_32 (abfd, (bfd_vma) x, addr);
- }
- break;
-
- default:
- abort ();
+ short x = bfd_get_16 (abfd, addr);
+ DOIT (x);
+ bfd_put_16 (abfd, (bfd_vma) x, addr);
}
- }
+ break;
+
+ case 2:
+ {
+ long x = bfd_get_32 (abfd, addr);
+ DOIT (x);
+ bfd_put_32 (abfd, (bfd_vma) x, addr);
+ }
+ break;
+
+ default:
+ abort ();
+ }
+ }
/* Now let bfd_perform_relocation finish everything up. */
return bfd_reloc_continue;
diff --git a/bfd/coff-x86_64.c b/bfd/coff-x86_64.c
index 4e6420a..9d7c845 100644
--- a/bfd/coff-x86_64.c
+++ b/bfd/coff-x86_64.c
@@ -138,59 +138,61 @@ coff_amd64_reloc (bfd *abfd,
#define DOIT(x) \
x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask))
- if (diff != 0)
- {
- reloc_howto_type *howto = reloc_entry->howto;
- unsigned char *addr = (unsigned char *) data + reloc_entry->address;
-
- /* FIXME: We do not have an end address for data, so we cannot
- accurately range check any addresses computed against it.
- cf: PR binutils/17512: file: 1085-1761-0.004.
- For now we do the best that we can. */
- if (addr < (unsigned char *) data || addr > ((unsigned char *) data) + input_section->size)
+ if (diff != 0)
+ {
+ reloc_howto_type *howto = reloc_entry->howto;
+ unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+
+ /* FIXME: We do not have an end address for data, so we cannot
+ accurately range check any addresses computed against it.
+ cf: PR binutils/17512: file: 1085-1761-0.004.
+ For now we do the best that we can. */
+ if (addr < (unsigned char *) data
+ || addr > ((unsigned char *) data) + input_section->size)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return bfd_reloc_notsupported;
+ }
+
+ switch (howto->size)
+ {
+ case 0:
+ {
+ char x = bfd_get_8 (abfd, addr);
+ DOIT (x);
+ bfd_put_8 (abfd, x, addr);
+ }
+ break;
+
+ case 1:
+ {
+ short x = bfd_get_16 (abfd, addr);
+ DOIT (x);
+ bfd_put_16 (abfd, (bfd_vma) x, addr);
+ }
+ break;
+
+ case 2:
{
- bfd_set_error (bfd_error_bad_value);
- return bfd_reloc_notsupported;
+ long x = bfd_get_32 (abfd, addr);
+ DOIT (x);
+ bfd_put_32 (abfd, (bfd_vma) x, addr);
}
+ break;
- switch (howto->size)
+ case 4:
{
- case 0:
- {
- char x = bfd_get_8 (abfd, addr);
- DOIT (x);
- bfd_put_8 (abfd, x, addr);
- }
- break;
-
- case 1:
- {
- short x = bfd_get_16 (abfd, addr);
- DOIT (x);
- bfd_put_16 (abfd, (bfd_vma) x, addr);
- }
- break;
-
- case 2:
- {
- long x = bfd_get_32 (abfd, addr);
- DOIT (x);
- bfd_put_32 (abfd, (bfd_vma) x, addr);
- }
- break;
- case 4:
- {
- long long x = bfd_get_64 (abfd, addr);
- DOIT (x);
- bfd_put_64 (abfd, (bfd_vma) x, addr);
- }
- break;
-
- default:
- bfd_set_error (bfd_error_bad_value);
- return bfd_reloc_notsupported;
+ long long x = bfd_get_64 (abfd, addr);
+ DOIT (x);
+ bfd_put_64 (abfd, (bfd_vma) x, addr);
}
- }
+ break;
+
+ default:
+ bfd_set_error (bfd_error_bad_value);
+ return bfd_reloc_notsupported;
+ }
+ }
/* Now let bfd_perform_relocation finish everything up. */
return bfd_reloc_continue;
diff --git a/bfd/configure b/bfd/configure
index cf3c746..7411c6d 100755
--- a/bfd/configure
@ -871,12 +1109,12 @@ index 59c51cc..d83dc1b 100644
value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
signed_addend, weak_undef_p);
diff --git a/bfd/version.h b/bfd/version.h
index ed51cc9..cd412b9 100644
index ed51cc9..1f2c665 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20160125
+#define BFD_VERSION_DATE 20160229
+#define BFD_VERSION_DATE 20160309
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
#define REPORT_BUGS_TO @report_bugs_to@
@ -888,10 +1126,17 @@ index 9fb81c5..607d328 100644
-m4_define([BFD_VERSION], [2.26])
+m4_define([BFD_VERSION], [2.26.0])
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 2250b30..4648d93 100644
index 2250b30..b04c745 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,14 @@
@@ -1,3 +1,21 @@
+2016-03-09 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/19775
+ * testsuite/binutils-all/ar.exp (proc empty_archive): New proc.
+ Run the new proc.
+ * testsuite/binutils-all/empty: New, empty, file.
+
+2016-02-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from master
@ -906,7 +1151,7 @@ index 2250b30..4648d93 100644
2016-01-25 Tristan Gingold <gingold@adacore.com>
* configure: Regenerate.
@@ -238,12 +249,12 @@
@@ -238,12 +256,12 @@
2015-07-10 H.J. Lu <hongjiu.lu@intel.com>
@ -1050,6 +1295,67 @@ index c579c69..52ddadc 100644
2015-07-10 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
index 4c33874..e971350 100644
--- a/binutils/testsuite/binutils-all/ar.exp
+++ b/binutils/testsuite/binutils-all/ar.exp
@@ -555,6 +555,45 @@ proc move_an_element { } {
pass $testname
}
+# PR 19775: Test creating and listing archives with an empty element.
+
+proc empty_archive { } {
+ global AR
+ global srcdir
+ global subdir
+
+ set testname "archive with empty element"
+
+ # FIXME: There ought to be a way to dynamically create an empty file.
+ set empty $srcdir/$subdir/empty
+
+ if [is_remote host] {
+ set archive artest.a
+ set objfile [remote_download host $empty]
+ remote_file host delete $archive
+ } else {
+ set archive tmpdir/artest.a
+ set objfile $empty
+ }
+
+ remote_file build delete tmpdir/artest.a
+
+ set got [binutils_run $AR "-r -c $archive ${objfile}"]
+ if ![string match "" $got] {
+ fail $testname
+ return
+ }
+
+ # This commmand used to fail with: "Malformed archive".
+ set got [binutils_run $AR "-t $archive"]
+ if ![string match "empty " $got] {
+ fail $testname
+ return
+ }
+
+ pass $testname
+}
+
# Run the tests.
# Only run the bfdtest checks if the programs exist. Since these
@@ -574,6 +613,7 @@ argument_parsing
deterministic_archive
delete_an_element
move_an_element
+empty_archive
if { [is_elf_format]
&& ![istarget "*-*-hpux*"]
diff --git a/binutils/testsuite/binutils-all/empty b/binutils/testsuite/binutils-all/empty
new file mode 100644
index 0000000..e69de29
diff --git a/elfcpp/ChangeLog b/elfcpp/ChangeLog
index 0f54787..f95130a 100644
--- a/elfcpp/ChangeLog
@ -3419,10 +3725,29 @@ index 0aee194..87d4653 100644
2005-07-27 Jan Beulich <jbeulich@novell.com>
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 75fd708..4f6abb9 100644
index 75fd708..1ee2dfa 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,128 @@
@@ -1,3 +1,147 @@
+2016-03-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from master
+ 2016-03-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/19739
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
+ merge flags of other input sections for relocatable link.
+ * emultempl/mmo.em (mmo_place_orphan): Likewise.
+ * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+ * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+
+2016-03-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from master
+ 2016-03-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ * testsuite/ld-plugin/lto.exp: Update PR ld/12365 test for GCC 6.
+
+2016-02-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from master
@ -3551,7 +3876,7 @@ index 75fd708..4f6abb9 100644
2016-01-25 Tristan Gingold <gingold@adacore.com>
* configure: Regenerate.
@@ -89,7 +214,7 @@
@@ -89,7 +233,7 @@
decide placement.
2015-10-27 Laurent Alfonsi <laurent.alfonsi@st.com>
@ -3560,7 +3885,7 @@ index 75fd708..4f6abb9 100644
* ld.texinfo: Add description of the STM32L4xx erratum
workaround.
@@ -129,7 +254,7 @@
@@ -129,7 +273,7 @@
2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
@ -3569,7 +3894,7 @@ index 75fd708..4f6abb9 100644
* emulparams/call_nop.sh: New file.
* emulparams/elf_i386_be.sh: Source
${srcdir}/emulparams/call_nop.sh.
@@ -165,7 +290,7 @@
@@ -165,7 +309,7 @@
2015-10-15 Simon Dardis <Simon.Dardis@imgtec.com>
@ -3578,7 +3903,7 @@ index 75fd708..4f6abb9 100644
(exp_fold_tree_1): Here. Cope with ternary operator in
assignments. Use new helper.
@@ -308,7 +433,7 @@
@@ -308,7 +452,7 @@
2015-09-09 James Bowman <james.bowman@ftdichip.com>
* scripttempl/ft32.sc: default linker script RAM and
@ -3587,7 +3912,7 @@ index 75fd708..4f6abb9 100644
2015-09-09 Nick Clifton <nickc@redhat.com>
@@ -359,58 +484,58 @@
@@ -359,58 +503,58 @@
2015-08-18 H.J. Lu <hongjiu.lu@intel.com>
@ -3804,6 +4129,189 @@ index 188172d..e28f38e 100644
AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.])
fi
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 0405d4f..809b27c 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1946,25 +1946,32 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
return os;
}
+ flags = s->flags;
+ if (!bfd_link_relocatable (&link_info))
+ {
+ nexts = s;
+ while ((nexts = bfd_get_next_section_by_name (nexts->owner, nexts))
+ != NULL)
+ if (nexts->output_section == NULL
+ && (nexts->flags & SEC_EXCLUDE) == 0
+ && ((nexts->flags ^ flags) & (SEC_LOAD | SEC_ALLOC)) == 0
+ && (nexts->owner->flags & DYNAMIC) == 0
+ && nexts->owner->usrdata != NULL
+ && !(((lang_input_statement_type *) nexts->owner->usrdata)
+ ->flags.just_syms)
+ && _bfd_elf_match_sections_by_type (nexts->owner, nexts,
+ s->owner, s))
+ flags = (((flags ^ SEC_READONLY)
+ | (nexts->flags ^ SEC_READONLY))
+ ^ SEC_READONLY);
+ }
+
/* Decide which segment the section should go in based on the
section name and section flags. We put loadable .note sections
right after the .interp section, so that the PT_NOTE segment is
stored right after the program headers where the OS can read it
in the first page. */
- flags = s->flags;
- nexts = s;
- while ((nexts = bfd_get_next_section_by_name (nexts->owner, nexts)) != NULL)
- if (nexts->output_section == NULL
- && (nexts->flags & SEC_EXCLUDE) == 0
- && ((nexts->flags ^ flags) & (SEC_LOAD | SEC_ALLOC)) == 0
- && (nexts->owner->flags & DYNAMIC) == 0
- && nexts->owner->usrdata != NULL
- && !(((lang_input_statement_type *) nexts->owner->usrdata)
- ->flags.just_syms)
- && _bfd_elf_match_sections_by_type (nexts->owner, nexts, s->owner, s))
- flags = (((flags ^ SEC_READONLY) | (nexts->flags ^ SEC_READONLY))
- ^ SEC_READONLY);
place = NULL;
if ((flags & (SEC_ALLOC | SEC_DEBUGGING)) == 0)
place = &hold[orphan_nonalloc];
diff --git a/ld/emultempl/mmo.em b/ld/emultempl/mmo.em
index 8949aed..3a382ec 100644
--- a/ld/emultempl/mmo.em
+++ b/ld/emultempl/mmo.em
@@ -107,22 +107,28 @@ mmo_place_orphan (asection *s,
return os;
}
+ flags = s->flags;
+ if (!bfd_link_relocatable (&link_info))
+ {
+ nexts = s;
+ while ((nexts = bfd_get_next_section_by_name (nexts->owner, nexts))
+ != NULL)
+ if (nexts->output_section == NULL
+ && (nexts->flags & SEC_EXCLUDE) == 0
+ && ((nexts->flags ^ flags) & (SEC_LOAD | SEC_ALLOC)) == 0
+ && (nexts->owner->flags & DYNAMIC) == 0
+ && nexts->owner->usrdata != NULL
+ && !(((lang_input_statement_type *) nexts->owner->usrdata)
+ ->flags.just_syms))
+ flags = (((flags ^ SEC_READONLY) | (nexts->flags ^ SEC_READONLY))
+ ^ SEC_READONLY);
+ }
+
/* Check for matching section type flags for sections we care about.
A section without contents can have SEC_LOAD == 0, but we still
want it attached to a sane section so the symbols appear as
expected. */
- flags = s->flags;
- nexts = s;
- while ((nexts = bfd_get_next_section_by_name (nexts->owner, nexts)) != NULL)
- if (nexts->output_section == NULL
- && (nexts->flags & SEC_EXCLUDE) == 0
- && ((nexts->flags ^ flags) & (SEC_LOAD | SEC_ALLOC)) == 0
- && (nexts->owner->flags & DYNAMIC) == 0
- && nexts->owner->usrdata != NULL
- && !(((lang_input_statement_type *) nexts->owner->usrdata)
- ->flags.just_syms))
- flags = (((flags ^ SEC_READONLY) | (nexts->flags ^ SEC_READONLY))
- ^ SEC_READONLY);
+
if ((flags & (SEC_ALLOC | SEC_READONLY)) != SEC_READONLY)
for (i = 0; i < sizeof (holds) / sizeof (holds[0]); i++)
if ((flags & holds[i].nonzero_flags) != 0)
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 0370c5a..bddd9a8 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -2225,21 +2225,27 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
orphan_init_done = 1;
}
+ flags = s->flags;
+ if (!bfd_link_relocatable (&link_info))
+ {
+ nexts = s;
+ while ((nexts = bfd_get_next_section_by_name (nexts->owner,
+ nexts)))
+ if (nexts->output_section == NULL
+ && (nexts->flags & SEC_EXCLUDE) == 0
+ && ((nexts->flags ^ flags) & (SEC_LOAD | SEC_ALLOC)) == 0
+ && (nexts->owner->flags & DYNAMIC) == 0
+ && nexts->owner->usrdata != NULL
+ && !(((lang_input_statement_type *) nexts->owner->usrdata)
+ ->flags.just_syms))
+ flags = (((flags ^ SEC_READONLY)
+ | (nexts->flags ^ SEC_READONLY))
+ ^ SEC_READONLY);
+ }
+
/* Try to put the new output section in a reasonable place based
on the section name and section flags. */
- flags = s->flags;
- nexts = s;
- while ((nexts = bfd_get_next_section_by_name (nexts->owner, nexts)))
- if (nexts->output_section == NULL
- && (nexts->flags & SEC_EXCLUDE) == 0
- && ((nexts->flags ^ flags) & (SEC_LOAD | SEC_ALLOC)) == 0
- && (nexts->owner->flags & DYNAMIC) == 0
- && nexts->owner->usrdata != NULL
- && !(((lang_input_statement_type *) nexts->owner->usrdata)
- ->flags.just_syms))
- flags = (((flags ^ SEC_READONLY) | (nexts->flags ^ SEC_READONLY))
- ^ SEC_READONLY);
place = NULL;
if ((flags & SEC_ALLOC) == 0)
;
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index 91de501..5ddeffc 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -1996,21 +1996,27 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
orphan_init_done = 1;
}
+ flags = s->flags;
+ if (!bfd_link_relocatable (&link_info))
+ {
+ nexts = s;
+ while ((nexts = bfd_get_next_section_by_name (nexts->owner,
+ nexts)))
+ if (nexts->output_section == NULL
+ && (nexts->flags & SEC_EXCLUDE) == 0
+ && ((nexts->flags ^ flags) & (SEC_LOAD | SEC_ALLOC)) == 0
+ && (nexts->owner->flags & DYNAMIC) == 0
+ && nexts->owner->usrdata != NULL
+ && !(((lang_input_statement_type *) nexts->owner->usrdata)
+ ->flags.just_syms))
+ flags = (((flags ^ SEC_READONLY)
+ | (nexts->flags ^ SEC_READONLY))
+ ^ SEC_READONLY);
+ }
+
/* Try to put the new output section in a reasonable place based
on the section name and section flags. */
- flags = s->flags;
- nexts = s;
- while ((nexts = bfd_get_next_section_by_name (nexts->owner, nexts)))
- if (nexts->output_section == NULL
- && (nexts->flags & SEC_EXCLUDE) == 0
- && ((nexts->flags ^ flags) & (SEC_LOAD | SEC_ALLOC)) == 0
- && (nexts->owner->flags & DYNAMIC) == 0
- && nexts->owner->usrdata != NULL
- && !(((lang_input_statement_type *) nexts->owner->usrdata)
- ->flags.just_syms))
- flags = (((flags ^ SEC_READONLY) | (nexts->flags ^ SEC_READONLY))
- ^ SEC_READONLY);
place = NULL;
if ((flags & SEC_ALLOC) == 0)
;
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 1dd7492..2389661 100644
--- a/ld/ld.texinfo
@ -4726,6 +5234,32 @@ index 18021e7..2ce53a9 100644
#ld: -r -melf_x86_64
#readelf: -r --wide
#target: x86_64-*-*
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 81e72b4..982ffee 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -400,9 +400,20 @@ if { [at_least_gcc_version 4 7] } {
|| [istarget "x86_64-*-linux*"]
|| [istarget "amd64-*-linux*"]) } {
set testname "PR ld/12365"
- set exec_output [run_host_cmd "$CC" "-O2 -flto -flto-partition=none -fuse-linker-plugin tmpdir/pr12365a.o tmpdir/pr12365b.o tmpdir/pr12365c.o"]
+ set exec_output [run_host_cmd "$CC" "-O2 -flto -flto-partition=none -fuse-linker-plugin -o tmpdir/pr12365 tmpdir/pr12365a.o tmpdir/pr12365b.o tmpdir/pr12365c.o"]
if { [ regexp "undefined reference to `my_bcopy'" $exec_output ] } {
+ # Linker should catch the reference to undefined `my_bcopy'
+ # error caused by a GCC bug.
pass $testname
+ } elseif { [ string match "" $exec_output ] } {
+ global READELF
+ set exec_output [run_host_cmd "$READELF" "-s -W tmpdir/pr12365"]
+ if { [ regexp "my_bcopy" $exec_output ] } {
+ # Verify that there is no `my_bcopy' symbol in executable.
+ fail $testname
+ } {
+ pass $testname
+ }
} {
fail $testname
}
diff --git a/ld/testsuite/ld-x86-64/call1a.d b/ld/testsuite/ld-x86-64/call1a.d
index 2a63b1c..2b131ee 100644
--- a/ld/testsuite/ld-x86-64/call1a.d

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 9 11:11:48 UTC 2016 - rguenther@suse.com
- Update binutils-2.26-branch.diff, updates to branch head.
(swo#19739) (swo#19775)
-------------------------------------------------------------------
Mon Feb 29 12:49:50 UTC 2016 - rguenther@suse.com