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

            Bug ID: 32324
           Summary: Stripping BOLT'ed binaries leads to unwanted behaviour
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: avieira at gcc dot gnu.org
  Target Milestone: ---

Hi,

Similar to https://github.com/llvm/llvm-project/issues/56738 when we use
Binutil's strip to strip a binary optimized with BOLT it leads to diagnostic
messages like:
$ aarch64-none-linux-gnu-strip bolted_binary.out
aarch64-none-linux-gnu-strip: stRViEky: section `.eh_frame' can't be allocated
in segment 2
LOAD: .text .text.cold .eh_frame .eh_frame_hdr
aarch64-none-linux-gnu-strip: stRViEky: section `.eh_frame_hdr' can't be
allocated in segment 2
LOAD: .text .text.cold .eh_frame .eh_frame_hdr 

Upon inspection, just like was pointed out in the llvm ticket linked above it
seems the PHDR and LOAD header have been given the same offset but different
alignments. The resulting binary also segfaults when run.

I am not familiar enough with ELF specs to know whether BOLT is at wrong here,
or this should be allowed. I haven't checked how LLVM fixed this, but the
llvm-strip I used recently did not show this behaviour, so I'm guessing they
have at least worked around it. Any suggestions?

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

Reply via email to