Link using a linker script

Hi all,

How does the new lld implementation work with the “Linker Script” for the object file adjustment?

I couldn’t find enough resources on the web. Any help is highly appreciated.

Cheers,

ES

for instance, where is the internal default linker script located? How can I change the default values, for example the star address…

There is no default linker script.

Cheers,
Rafael

Hi Rafael,

Thanks a lot.

For example the start entry for me is 0x11000 by default which I don’t know where it come from! I thought there should be a default thing that sets this entry address.

search for VAStart.

Cheers,
Rafael

Yeah I found it, that’s nice. Thanks a milion.

Could you please tell me how can I specify my bootstrap (startup code) in the linking process?

For example something like STARTUP (http://wiki.osdev.org/Linker_Scripts#STARTUP) is not accepted by the LLVM LLD. :-/

Linker script support is still fairly incomplete.

Can you open a bug explaining which feature you are trying to use and
we are missing?

In this particular case, can't you just list Boot.o first in the command line?

Cheers,
Rafael

Hi Rafael,

I changed the VAStart to 0x0 to have the memory layout from address zero (I don’t know how to use the AT in the linkerscript with LLVM lld). But the result was that this time the .text section starts from 1000 instead of 11000.

Other problem, with linkerscript I would like to merge one custom section to the .text section, but what I get at the end is just my custom section renamed to .text without any merging.

Cheers,

ES