This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Adding custom sections to default linker script
- From: Jonas Maebe <jonas dot maebe at elis dot ugent dot be>
- To: binutils at sourceware dot org
- Date: Sun, 30 Aug 2015 18:40:40 +0200
- Subject: Re: Adding custom sections to default linker script
- Authentication-results: sourceware.org; auth=none
- References: <55E1BBA7 dot 7080202 at elis dot ugent dot be> <20150830132130 dot GA3518 at ratatosk>
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