[LLVMdev] [lld] Linker script findings.

Nick Kledzik kledzik at apple.com
Wed Jan 2 13:53:56 PST 2013


Sean,

Thanks for doing this research and writing up that summary!  

The SECTION and MEMORY seem doable in lld as part of the ELF
Writer.  The one tricky part will be if the linker script defines symbols
(e.g.  __text_size), because those symbol names might be
referenced by some object file atom. Thus they need an atom 
representation for lld's Resolver to see.  So, the ELF Writer will need
to make a first pass at the linker script and make "proxy" atoms for 
any symbols the linker script defines.  These atoms won't actually
have a value assigned until the Resolver is done and the atoms are 
handed to the ELF Writer to complete.  

-Nick 


On Dec 30, 2012, at 8:53 PM, Sean Silva wrote:
> Hi all, I have been investigating linker scripts and the functionality
> needed to support them in lld. I have attached my findings about the
> usage of ldscripts. My findings have been collected from:
> 
> - Reading all the GNU ld manual sections about linker scripts.
> - Looking at the GNU ld and gold source code.
> - Digging through a couple embedded programming tutorials.
> - Reading through all of the linker scripts in the Linux kernel tree.
> - Other random sources across the net that I'm forgetting about.
> 
> In particular, the second to last section (comprising about half the
> document) describes all of the functionality that LLD API's will have
> to expose to the ldscript language processor in order to link the
> Linux kernel.
> 
> -- Sean Silva
> <ldscript-usage.txt>_______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list