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

            Bug ID: 23817
           Summary: strip corrupts SHT_LLVM_ADDRSIG section (files built
                    with clang-7)
           Product: binutils
           Version: 2.31
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: slyfox at inbox dot ru
  Target Milestone: ---

Created attachment 11364
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11364&action=edit
t.tar.gz

Issue originally discovered in https://bugs.gentoo.org/667854 as a menacing
warning on x86_64 and arm64:

    $ echo 'void f(void){}' > a.c
    $ clang -c a.c -o a.o.clang
    $ cp a.o.clang a.o
    $ strip a.o
    strip: stTEWJ8A: failed to find link section for section 5
    strip: stTEWJ8A: failed to find link section for section 5
    $ sha1sum a.o.clang a.o
    34c07c978aeb3ef1fbe2083b5fbaf608c7fe63ec  a.o.clang
    2060df629d6b818cb1c56147dc9c89cfd5fbf5ad  a.o

The warning comes from .llvm_addrsig (SHT_LLVM_ADDRSIG) and attached
strtab/symtab. strip strips unreferenced symbols but does not touch
.llvm_addrsig rendering references invalid (I think).

https://reviews.llvm.org/D47744 has SHT_LLVM_ADDRSIG description.

I'm not sure what exactly binutils (or llvm) should do here. A few options:

1. avoid stripping binaries with unknown unhandled sections

2. Add support for SHT_LLVM_ADDRSIG handling

3. Come back to llvm and add some generic relocations(?) into .llvm_addrsig if
possible so binutiols' strip would just work.

Attaching t.tar.gz with a.c  a.o  a.o.clang

Thanks!

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