[PATCH][GOLD] Handle -Ttext, -Tdata and -Tbss options in scripts.

H.J. Lu hjl.tools@gmail.com
Thu Oct 15 14:52:00 GMT 2009


On Thu, Oct 15, 2009 at 7:43 AM, Ian Lance Taylor <iant@google.com> wrote:
> "Doug Kwan (關振德)" <dougkwan@google.com> writes:
>
>>     This patch adds support of -Ttext, -Tdata and -Tbss options in
>> scripts.  Basically, it does a dot assignment at the first section of
>> the appropriate type.
>
>> 2009-10-15  Doug Kwan  <dougkwan@google.com>
>>
>>         * script-sections.cc (Script_sections::set_section_addresses):
>>         Handle -Ttext, -Tdata and -Tbbs options.
>>         (Script_sections::create_segments): If the -Tbss option is used,
>>         begin a new segment when seeing a new run of BBS sections.
>
> I don't think we should do this.  The patch is well-written, and there
> is a sense in which it is clearly correct: -Ttext really should set
> the address of the text segment, even when using a linker script.
> However, the purpose of supporting linker scripts in gold is to be
> compatible with the GNU linker, and this is not how the GNU linker
> handles -Ttext, et. al.  In the GNU linker, -Ttext sets the address of
> the .text section, not the text segment, and similarly -Tdata and
> -Tbss set the addresses of the .data and the .bss sections.

There is this option:

  -Ttext-segment ADDRESS      Set address of text segment


-- 
H.J.



More information about the Binutils mailing list