[LLVMdev] [lld] Linker script findings.

Shankar Easwaran shankare at codeaurora.org
Mon Jan 7 06:50:31 PST 2013

On 1/6/2013 6:30 PM, Meador Inge wrote:
> On Jan 6, 2013, at 2:05 PM, Sean Silva wrote:
>> but since the script can define symbols, it has to be parsed earlier.
> It is more than just defining symbols.  There are many other directives that
> have command line option equivalents that are used to setup linking.  You can pull symbols
> with EXTERN, add other files to link with INPUT, add groups of archives to be searched
> with GROUP, name the output file with OUTPUT, add new library path directories
> with SEARCH_DIR, etc…
> Also keep in mind that that linker scripts are usually "inlined" with other command line
> options.  For example:
>     ld foo.o --defsym=x=12 -Lbar -T beagle-ram.ld -lbaz bar.o

This is different. There are things in the command line which would

a) add symbols into the output
     This is generic functionality which is needed by all the platforms. 
The symbols could be parsed and handed over to ELF Writer to add 
symbols, because types of symbols on what to add should be owned by the 
target specific format.

b) specify segment address by using (-Ttext=<n>)
     This functionality is only needed by ELF and should be contained in 

Overall, I think that the functionality should be accessed only by 
WriterELF and contained within.

Nick, Michael : What do you think ?


Shankar Easwaran

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation

More information about the llvm-dev mailing list