https://sourceware.org/bugzilla/show_bug.cgi?id=16563

            Bug ID: 16563
           Summary: Corrupt .eh-frame section created when linking LTO and
                    non-LTO objects
           Product: binutils
           Version: 2.25 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: nickc at redhat dot com

Created attachment 7405
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7405&action=edit
Files needed to reproduce problem

Linking together LTO and non-LTO objects can result in a corrupt
.eh_frame section.  To reproduce this run the following command on the
uploaded x86_64 object files:

  % g++ -o broken.exe -O0 -flto -fno-fat-lto-objects -flto-partition=none \
    a.o b.o -Wl,--no-demangle

Then examine the contents of the .eh_frame section with:

  % readelf -w broken.exe > /dev/null

  Warning: Invalid CIE pointer 0xfffffccc in FDE at 0x000040

The a.o and b.o object files were produced as follows (sources also
uploaded):

  % g++ -c -O0 -flto -fno-fat-lto-objects a.cpp
  % g++ -c -O0 b.cpp

Note - compiling both a.cpp and b.cpp with LTO results in a working
binary.  So does compiling them both without LTO.  Also if the
-Wl,-traditional linker command line option is included on the g++
command line then the link works.  (This is because traditional linking
disables the optimization of the .eh_frame section).

-- 
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

Reply via email to