[LLVMdev] Modeling ELF linker with lld/Chunks.

Shankar Easwaran shankarke at gmail.com
Fri Jun 5 16:48:19 PDT 2015


Hi All,

I have a design question of how your linker would be suitable for modeling
ELF semantics.

The ELF linker needs the functionality of reading relocations ahead of
symbol resolution for the following usecases :-

- Add linker defined symbols if there is a relocation to the symbol
(Examples are : defsym, PROVIDE)
- Dont halt the linker operation if there are undefined symbols but they
are not called from the root set (Do garbage collection and then report
whether symbols are really undefined)
- A reference to a symbol inside a group, from outside a group need to be
through an undefined symbol
- For string merging, relocations are needed in advance before they can be
merged.
- For identical code folding, relocations are needed in advance before they
can be merged.

There are also more usecase where there is not a symbol but a section,
examples of them are :-

- sections that contain mergeable strings (.rodata)
- sections that contain Eh Frame information, where FDE's are discarded for
functions that are garbage collected.

So I was trying to figure out how the Chunks and relocations would be
related in the Reader, which means that it would be very similiar to what
we have with the Atom model.

Thoughts / opinions ?

Shankar Easwaran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150605/c0d0b8c0/attachment.html>


More information about the llvm-dev mailing list