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: ld --section-start prevents merging sections


On Sat, Nov 14, 2009 at 9:12 AM, Michael Hennebry
<hennebry@web.cs.ndsu.nodak.edu> wrote:
> 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
>> 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.
>
> 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.

But then .. how come the sections are properly merged when not using
--section-start ?

PaPa


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