This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld --section-start prevents merging sections
- From: Papalagi Pakeha <papalagi dot pakeha at gmail dot com>
- To: binutils at sourceware dot org
- Date: Fri, 13 Nov 2009 22:47:21 +1300
- Subject: ld --section-start prevents merging sections
Hi all,
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
gcc -Wl,--section-start=.cryptext=0x12345678
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
specified address.
This behaviour has been observed on x86 with gcc 4.3.1 and binutils
2.18.50. Is there a way to make ld merge the section even with
--section-start?
Thanks!
PaPa