This is the mail archive of the
mailing list for the binutils project.
Re: ld --section-start prevents merging sections
- From: Michael Hennebry <hennebry at web dot cs dot ndsu dot nodak dot edu>
- To: Papalagi Pakeha <papalagi dot pakeha at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 13 Nov 2009 14:12:31 -0600 (CST)
- Subject: Re: ld --section-start prevents merging sections
- References: <email@example.com>
On Fri, 13 Nov 2009, Papalagi Pakeha wrote:
I put some functions of my program into a separate text section called
.cryptext and I want to have this section start at a fixed address. To
achieve that I should probably be using
That works all right as long as .cryptext is only defined in a single
object file. When there are functions in multiple object files placed
in .cryptext then without -Wl,--section-start all the .cryptext
sections are merged into a single one in the final binary, that's what
I want. However with -Wl,--section-start created .cryptext,
.cryptext.1, .cryptext.2, etc and only the first one is placed at the
The problem isn't --section-start .
The problem is that .cryptext is an orphan section,
i.e. one not mentioned in the linker script.
For whatever reason, the linker does that with orphan sections.
So far as I know,
the only documentation on the subject is in bugzilla somewhere.
"Pessimist: The glass is half empty.
Optimist: The glass is half full.
Engineer: The glass is twice as big as it needs to be."