[llvm-dev] Link using a linker script

44 views
Skip to first unread message

Sky Flyer via llvm-dev

unread,
Apr 20, 2016, 11:17:50 AM4/20/16
to LLVM Developers Mailing List
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

Sky Flyer via llvm-dev

unread,
Apr 20, 2016, 11:23:17 AM4/20/16
to LLVM Developers Mailing List
for instance, where is the internal default linker script located? How can I change the default values, for example the star address...

Rafael Espíndola

unread,
Apr 20, 2016, 2:05:24 PM4/20/16
to Sky Flyer, LLVM Developers Mailing List
There is no default linker script.

Cheers,
Rafael


On 20 April 2016 at 11:23, Sky Flyer via llvm-dev

> _______________________________________________
> LLVM Developers mailing list
> llvm...@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Sky Flyer via llvm-dev

unread,
Apr 20, 2016, 2:18:17 PM4/20/16
to Rafael Espíndola, LLVM Developers Mailing List
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.

Rafael Espíndola

unread,
Apr 20, 2016, 2:38:57 PM4/20/16
to Sky Flyer, LLVM Developers Mailing List
search for VAStart.

Cheers,
Rafael

Sky Flyer via llvm-dev

unread,
Apr 20, 2016, 3:09:03 PM4/20/16
to Rafael Espíndola, LLVM Developers Mailing List
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?

Sky Flyer via llvm-dev

unread,
Apr 20, 2016, 3:13:33 PM4/20/16
to Rafael Espíndola, LLVM Developers Mailing List
For example something like STARTUP (http://wiki.osdev.org/Linker_Scripts#STARTUP) is not accepted by the LLVM LLD. :-/

Rafael Espíndola

unread,
Apr 20, 2016, 3:33:24 PM4/20/16
to Sky Flyer, LLVM Developers Mailing List
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

Sky Flyer via llvm-dev

unread,
Apr 22, 2016, 7:16:20 AM4/22/16
to Rafael Espíndola, LLVM Developers Mailing List
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


Reply all
Reply to author
Forward
0 new messages