https://sourceware.org/bugzilla/show_bug.cgi?id=32271

--- Comment #8 from Nick Clifton <nickc at redhat dot com> ---
(In reply to Stas Sergeev from comment #7)

> > My bad.  The option is -Ttext-segment=... rather than --text-segment=... 
> > Sorry.
> 
> Wow!
> This actually works.
> So is it the same as just specifying
> the new load address for all segments?

Yes.  ish...

> For example if I use -Trodata-segment
> then not all segments are moved, but
> -Ttext-segment seems to move them all,
> including notes.
> Could you please explain why it is so,
> or just assure me it will always move all
> segments? This seems to be all I need.

OK, so the -Ttext-segment sets the start address for the text segment
and by default the other segments (rodata & data) are mapped to start
after the end of the text segment.  So just using -Ttext-segment
effectively moves all (loadable) segments, not just the code segment.

Of course if you combine -Ttext-segment and -Trodata-segment then the
read only segment will be set to where you specify and not after the
text segment.  (Assuming that there is read only data and that a
separate read only segment is being created.  It is possible to have
the linker put code and read only data into the same segment. In which
case only the -Ttext-segment option would be effective).

Notes are considered to be read only data so they will normally be
put into the read only data segment, if one is being created, or the
text segment otherwise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to