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 18:40, Jonas Maebe wrote:
> On 30/08/15 15:21, Erik Christiansen wrote:
> > 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 :)

Ah, I missed the "custom compiler" context. In that case, maybe just
tweak the internal linker scripts? They're generated from
<eachtarget>.sc in the source, e.g. binutils-2.23/ld/scripttempl/ .
Tweaking templates causes your customisations to be not only fully
integral to the toolchain, for the specified targets, but also more
customisable than a generic INSERT. (And very easy)

Erik


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