This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Adding custom sections to default linker script


On 30/08/15 15:21, Erik Christiansen wrote:
> For more powerful augmentation like yours, the "INSERT" command seems
> called for, and it does appear to need "-T", according to "info ld".
> Ld's complaint serves as confirmation, I'd hazard.

That command does indeed seem to do exactly what we need! Too bad it's
only supported in 2.19 and later. We've decided to add a command line
option to the compiler that allows users to target older versions of
binutils if necessary.

> Admittedly, I have not tried such obscurity, preferring one integral
> script, for better documentation. (And fewer surprises) My bent has long
> been to take a copy of the default linker script;
> 
> $ ld --verbose | gawk -- '/^===/ { show = 1 - show ; next } \
>   { if (show) print }' > link.res
> 
> edit it to satisfaction, then use -T. Result: No sassy remarks from ld.

Doing that inside the compiler itself is a little less trivial though,
especially in a future-proof way :)

Thanks for the suggestion!


Jonas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]