[LLVMdev] [lld] Linker script findings.

Nick Kledzik kledzik at apple.com
Wed Jan 9 17:47:10 PST 2013


On Jan 9, 2013, at 12:29 PM, Sean Silva wrote:
>> Maybe the first version could be just ELF centric.
> 
> The consensus in this thread seems to be that it should be in the
> frontend. Nick pointed out that since linker scripts can define
> symbols, they need to be handled before the writer; I don't see any
> way to avoid that. Could you elaborate on the concrete reasons why you
> think it should be in the ELF backend?

We need to be careful about what we mean by "frontend" and "backend"
of lld.    The Writer (backend?) actually gets a chance to contribute
atoms along with the Reader atoms which are fed to the Resolver.

So the linker script code could live in WriterELF and contribute atoms
for symbols defined by a linker script.  

That being said, some of the functionality of linker scripts is done via
command line options on other platforms, so we want to share common
functionality were possible. The linker script parsing may wind up 
being a thin layer (in WriterELF) on top of some shared functionality.

-Nick





More information about the llvm-dev mailing list