This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: linker generated "subsections"
On Fri, 30 Jan 2009, Weddington, Eric wrote:
Yeah, I don't know why ld starting doing that too. I've been bitten by that before. However, you can work around it with a custom linker script.
I think it was your complaint that I found.
For example from avr5.x, the .eeprom output section:
.eeprom :
{
*(.eeprom*)
__eeprom_end = . ;
} > eeprom
In the input section definition, the first asterisk matches any file, and the section name is .eeprom*, and that last asterisk will match anything after the initial ".eeprom", which means that it will grab any subsections like ".eeprom.1".
I have done this successfully for bootloader sections like what you're trying to do.
I'd read about linker scripts for some other reason,
but decided it wasn't worth the effort
and put everything in the same .c file.
I wonder whether -combine would have worked.
--
Michael hennebry@web.cs.ndsu.NoDak.edu
"Pessimist: The glass is half empty.
Optimist: The glass is half full.
Engineer: The glass is twice as big as it needs to be."