[llvm-bugs] [Bug 41058] Allow linking against shared objects without section headers

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Mar 21 12:19:11 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=41058

Fangrui Song <i at maskray.me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |i at maskray.me
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #13 from Fangrui Song <i at maskray.me> ---
Comment #11 seems to include most information about how to reconstruct linking
view from execution view for linkable shared objects :)
I'll just make a complement:

Find the number of dynamic symbols with DT_HASH (--hash-style=gnu) is trivial.
With DT_GNU_HASH, it is a bit tricky but still doable:
find the chain with the largest symbol index, then linearly probe the bucket
started with this index until an odd hash value is found.
The last index plus 1 is the number of dynamic symbols.

Recently binutils discusses a similar topic:
https://sourceware.org/pipermail/binutils/2020-March/110103.html
RFC: [PATCH] ELF: Don't require section header on ELF objects

* Many people agree that without a section header table, a shared object will
be a runtime only object.
https://sourceware.org/pipermail/binutils/2020-March/110144.html
* They will add --strip-sections to readelf (it was originally different... I
requested a name change because of eu-strip/llvm-objcopy's --strip-sections:) )
* readelf will learn how to dump symbols in the absence of a section header
table. llvm-readobj has a similar feature request
https://bugs.llvm.org/show_bug.cgi?id=41058

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200321/0f5cb930/attachment.html>


More information about the llvm-bugs mailing list