[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Overloading ld linker script is not working after 2_36
From: |
Nick Clifton |
Subject: |
Re: Overloading ld linker script is not working after 2_36 |
Date: |
Wed, 15 Feb 2023 09:08:40 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 |
Hi Phil,
I can't get NOLOAD working any more.
This used to work before binutils_2_36.
The behaviour of the 2.36 binutils may have been accidental rather than
intended...
The key thing here is that input source files that are actually linker
script fragments are interpreted as augmenting the *end* of the default
linker script, rather than the start. So even though your fragment file
contains:
.infoA (NOLOAD) : {} > INFOA
The default script contains:
.infoA : {} > INFOA /* MSP430 INFO FLASH MEMORY SEGMENTS */
And this is interpreted first. Hence the sections do not gain the NOLOAD
attribute.
The best way to solve this issue is to just override the default linker
script with your own version using the -T command line option.
If that is not feasible then the only other solution that I can think of
is to rename the .infoA sections (using objcopy's --rename-section command
line option) to something else, eg .renamed.infoA, as a pre-link step
and then use your script fragment to assign the renamed sections, eg:
.renamed.infoA (NOLOAD) : { *(.renamed.infoA) } > INFOA
Cheers
Nick