[LLVMdev] [lld] [mach-o]: RFC: representing LC_REEXPORT_DYLIB

Tim Northover
Tue, 01 Jul 2014 16:41:17 -0000

Hi Shankar,

On 1 July 2014 17:25, Shankar Easwaran <shankare at codeaurora.org>
wrote:
> You could build a Dynamic library node and have the symbol returned when
the
> shared library is called for a symbol, that needs to be resolved using the
> below API.
>
> const SharedLibraryAtom *exports(StringRef name, bool dataSymbolOnly)
>
> Will this work ?

I did actually consider something along those lines, but it seemed
like even more of a hack so I didn't mention it in my message.

It could be made to work, but would involve reading new files in
either MachONormalizedFileToAtoms or the exports function itself. Both
of those seem like they're at the wrong level: we'd need to largely
re-implement the FileNode I/O handling and graph descent that already
exists.

I'm also not convinced the lifetime and ownership issues work out well
in that scheme. lld as a whole seems to keep the MemoryBuffers
associated with files around, which makes that location even less
pleasant from a layering point of view.

Cheers.

Tim.