[PATCH] [lld][ELF] Add explictly exported atoms and export R_*_COPY'ed atoms.

Michael Spencer bigcheesegs at gmail.com
Tue Oct 1 12:51:33 PDT 2013


On Tue, Oct 1, 2013 at 12:30 PM, kledzik at apple.com <kledzik at apple.com>wrote:

>
>   Can you explain the "explicitly exported" concept.  Will it be needed
> elsewhere?   It sounds like this is logically an attribute of an atom, but
> it does not come from the object file.  Instead it is an attribute that
> came about during the link.  There are potentially other attributes like
> that.  For instance, liveness (used during dead stripping), or
> canBeNullAtRuntime (copied from Undefined atom to SharedLibraryAtom).   We
> should have a general solution for this.  (In ld64 I wound up adding these
> attributes to the base Atom class and const casting in the handful of
> places in the linker I needed to "set" them).
>
>   Also, it took some head scratching to figure out what ObjectAtom was.
>  The term "object" is way overloaded.  I think it is for data atoms that
> came from STT_OBJECT symbols...
>
> http://llvm-reviews.chandlerc.com/D1799
>

By default no symbols are dynamically exported from executables. Symbols
need to be exported in the case of interposition (such as what happens with
COPY relocations) and providing a symbol for shared libs to dlsym. There
are also two command line options that can be used to explicitly export
symbols by name.

I really dislike const_cast. It makes code much harder to reason about.

I agree that ObjectAtom isn't a great name. I couldn't think of a better
one.

- Michael Spencer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131001/9bfd3ff5/attachment.html>


More information about the llvm-commits mailing list