Menu

#497 elfcopy/strip fails on Clang 3.7.0-compiled objects (that lack a distinct .shstrtab)

RELEASE_1_0
closed
Kai Wang
None
FIXED
2015-07-31
2015-06-02
Ed Maste
No

As of r238073[1] Clang will combine string tables:

Produce a single string table in a ELF .o

Normally an ELF .o has two string tables, one for symbols, one for section
names.

With the scheme of naming sections like ".text.foo" where foo is a symbol,
there is a big potential saving in using a single one.

elfcopy/strip fails when stripping such an object with:
strip: 692 gelf_getshdr() failed: Invalid argument

[1] http://llvm.org/viewvc/llvm-project?view=revision&revision=238073

Related

Tickets: #502

Discussion

  • Ed Maste

    Ed Maste - 2015-06-02

    Attaching empty.o, a Clang 3.7-built object from an empty .c file.

     
  • Kai Wang

    Kai Wang - 2015-06-06

    Quick fix [r3225] made elfcopy/strip able to work on these objects:
    .shstrtab section is created when input object does not have it.

    We will support the same optimization as Clang 3.7.0 later.

     

    Related

    Commit: [r3225]

  • Ed Maste

    Ed Maste - 2015-06-23

    The [r3225] fix is now in FreeBSD here: https://svnweb.freebsd.org/base?view=revision&revision=284339

    It solves the failure with clang 3.7.0-compiled objects. Should we close this and create a new ticket for introducing the optimization?

     

    Related

    Commit: [r3225]

  • Ed Maste

    Ed Maste - 2015-07-31
    • status: new --> closed
    • assigned_to: Kai Wang
    • Milestone: 2.0 --> RELEASE_1_0
    • Resolution: --> FIXED
     
  • Ed Maste

    Ed Maste - 2015-07-31

    Failure is fixed as indicated; see [#502] for enhancement to add the same optimization.

     

    Related

    Tickets: #502


Log in to post a comment.