[Bug ld/16563] Corrupt .eh-frame section created when linking LTO and non-LTO objects

2014-09-22 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=16563

--- Comment #10 from cvs-commit at gcc dot gnu.org cvs-commit at gcc dot 
gnu.org ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gdb and binutils.

The branch, master has been updated
   via  49727e46175419c638251b39091f24c575568bee (commit)
  from  aa8f4d1e5e6c01420489a2dfba72495bbd8489be (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=49727e46175419c638251b39091f24c575568bee

commit 49727e46175419c638251b39091f24c575568bee
Author: Alan Modra amo...@gmail.com
Date:   Mon Sep 22 17:53:15 2014 +0930

Readelf: Handle forward references to CIEs

The linker side of pr16563 was fixed with commit 18cd5bce, but
unfortunately people continue to use older linkers with -flto.  This
means we have binaries with working .eh_frame that can't be dumped by
readelf, and I'm seeing internal IBM bug reports about this fact.

PR 16563
* dwarf.c (GET): Remove semicolon.
(read_cie): New function, extracted from..
(display_debug_frames): ..here.  Correctly handle signed offset
from FDE to CIE in .eh_frame.  Decode forward referenced CIEs too.

---

Summary of changes:
 binutils/ChangeLog |8 ++
 binutils/dwarf.c   |  241 +++-
 2 files changed, 169 insertions(+), 80 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16563] Corrupt .eh-frame section created when linking LTO and non-LTO objects

2014-08-15 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16563

Nick Clifton nickc at redhat dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Nick Clifton nickc at redhat dot com ---
Hi Alan,

  Thanks for the patch - it does indeed solve the problem.

  I believe however that readelf is/was correct in saying the CIE pointer was
invalid.  These pointers are offsets into the .debug_frame section of the CIE
entry to be used by the FDE that is being decoded.  But the offsets can never
be negative (ie pointing to before the start of .debug_frame), so readelf was
correct to complain with this particular testcase.

  You are correct however in saying that readelf does have a potential bug - it
will complain about FDEs that reference a CIE that is defined later on in the
.debug_frame section.  But I have never yet seen a binary that does this.  When
one turns up I will fix readelf. :-)

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16563] Corrupt .eh-frame section created when linking LTO and non-LTO objects

2014-08-13 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16563

--- Comment #4 from Alan Modra amodra at gmail dot com ---
There are a couple of things going on here, but the Invalid CIE pointer is a
readelf bug I'd say.  There's nothing prohibiting a FDE to be located before
its CIE.  The .eh_frame cie_id is a signed relative offset (gcc's unwinder
treats it that way), and .debug_frame cie_id is section relative.  So readelf
ought to be able to handle this ordering.

Of course it's unexpected to find CIEs and FDEs like this.  The reason appears
to be that the elf-eh-frame.c code finds a duplicate CIE in a.o and b.o, and
therefore causes the b.o copy to be removed and some b.o FDE's then use an a.o
CIE.  That's all quite nornal, use the CIE the elf-eh-frame.c sees as
earlier.
The problem is that a.o's lto recompiled object actually gets linked into the
output .eh_frame *after* b.o's .eh_frame.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16563] Corrupt .eh-frame section created when linking LTO and non-LTO objects

2014-08-13 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16563

--- Comment #5 from Alan Modra amodra at gmail dot com ---
I got that wrong.  a.o and b.o appear in the correct order in the output
.eh_frame.  Apparently it is the elf-eh-frame.c code that sees them in reverse
order.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16563] Corrupt .eh-frame section created when linking LTO and non-LTO objects

2014-08-13 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16563

Alan Modra amodra at gmail dot com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC|amodra at gmail dot com|
   Assignee|unassigned at sourceware dot org   |amodra at gmail dot com

--- Comment #6 from Alan Modra amodra at gmail dot com ---
I'll leave the readelf part of this bug to Nick.  Fixing ld ordering of
.eh_frame.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16563] Corrupt .eh-frame section created when linking LTO and non-LTO objects

2014-08-13 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=16563

--- Comment #7 from cvs-commit at gcc dot gnu.org cvs-commit at gcc dot 
gnu.org ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gdb and binutils.

The branch, master has been updated
   via  18cd5bce47dc4a33dd1d8e3036b99d2fa7e3234f (commit)
  from  b879806f2fdd2eca7092d7b854d6cbd0493b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=18cd5bce47dc4a33dd1d8e3036b99d2fa7e3234f

commit 18cd5bce47dc4a33dd1d8e3036b99d2fa7e3234f
Author: Alan Modra amo...@gmail.com
Date:   Thu Aug 14 13:49:31 2014 +0930

Linker part of PR16563 fix

Presents .eh_frame input sections to the optimisation machinery in
elf-eh-frame.c in the order they are given by the linker script.

PR 16563
bfd/
* elflink.c (bfd_elf_discard_info): Process .eh_frame and .stab
in the order they are mapped to output sections.
ld/
* ldlang.c (map_head_is_link_order): Rename from
stripped_excluded_sections.
(lang_clear_os_map): New function, extracted from..
(strip_excluded_output_sections): ..here.
* ldlang.h (lang_clear_os_map): Declare.
* ldwrite.c (ldwrite): Call lang_clear_os_map.
* emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation):
Likewise.

---

Summary of changes:
 bfd/ChangeLog   |6 +++
 bfd/elflink.c   |  109 ++
 ld/ChangeLog|   12 +
 ld/emultempl/sh64elf.em |3 +
 ld/ldlang.c |   42 +++---
 ld/ldlang.h |2 +
 ld/ldwrite.c|1 +
 7 files changed, 121 insertions(+), 54 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16563] Corrupt .eh-frame section created when linking LTO and non-LTO objects

2014-08-13 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16563

Alan Modra amodra at gmail dot com changed:

   What|Removed |Added

 Status|ASSIGNED|NEW
 CC||amodra at gmail dot com
   Assignee|amodra at gmail dot com|unassigned at 
sourceware dot org

--- Comment #8 from Alan Modra amodra at gmail dot com ---
Linker problem fixed mainline.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16563] Corrupt .eh-frame section created when linking LTO and non-LTO objects

2014-08-12 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16563

Nick Clifton nickc at redhat dot com changed:

   What|Removed |Added

   Attachment #7405|0   |1
is obsolete||

--- Comment #2 from Nick Clifton nickc at redhat dot com ---
Created attachment 7743
  -- https://sourceware.org/bugzilla/attachment.cgi?id=7743action=edit
Second test case

Second test case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16563] Corrupt .eh-frame section created when linking LTO and non-LTO objects

2014-07-27 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16563

Alan Modra amodra at gmail dot com changed:

   What|Removed |Added

 CC||amodra at gmail dot com

--- Comment #1 from Alan Modra amodra at gmail dot com ---
Hi Nick, this seems to no longer be a problem.  With current mainline gcc and
ld I see nothing unusal in .eh_frame.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16563] Corrupt .eh-frame section created when linking LTO and non-LTO objects

2014-02-12 Thread polacek at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16563

Marek Polacek polacek at redhat dot com changed:

   What|Removed |Added

 CC||polacek at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16563] Corrupt .eh-frame section created when linking LTO and non-LTO objects

2014-02-12 Thread law at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16563

law at redhat dot com changed:

   What|Removed |Added

 CC||law at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils