PATCH: Add -Ttext-segment ADDR to ELF linker
H.J. Lu
hjl.tools@gmail.com
Tue Jan 13 20:14:00 GMT 2009
On Tue, Jan 13, 2009 at 11:52 AM, Ian Lance Taylor <iant@google.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> On Tue, Jan 13, 2009 at 9:50 AM, Daniel Jacobowitz <drow@false.org> wrote:
>>> On Tue, Jan 13, 2009 at 09:34:16AM -0800, Ian Lance Taylor wrote:
>>>> > 2. ELF segment has no names. The name of
>>>> > the ELF segment doesn't mean anything.
>>>>
>>>> I'm not sure what you mean. Of course ELF segments have no names.
>>>> I'm suggesting that -Ttext should set the start of the text segment.
>>>> The current behaviour, of setting the address of the .text section, is
>>>> useless for ELF.
>>>
>>> Completely agreed, this would be useful...
>>>
>>
>> Some applications may depend the current behaviour as shown
>> in linker testcases.
>
> I am very skeptical that any real ELF code uses -Ttext without also
> using a custom linker script.
>
> Ian
>
I don't think we should take this risk to potentially break existing
applications. Here is a patch to add a new switch -Ttext-segment.
I can reuse -Ttext and update linker tests if it is preferred.
Thanks.
--
H.J.
---
ld/
2009-01-13 H.J. Lu <hongjiu.lu@intel.com>
* lexsup.c (option_values): Add OPTION_TTEXT_SEGMENT.
(ld_options): Add -Ttext-segment.
(parse_args): Handle OPTION_TTEXT_SEGMENT.
* ld.texinfo: Document -Ttext-segment.
* scripttempl/elf.sc (TEXT_START_ADDR): Use SEGMENT_START.
(SHLIB_TEXT_START_ADDR): Likewise.
ld/testsuite/
2009-01-13 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/textaddr1.d: New.
* ld-elf/textaddr2.d: Likewise.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ld-addr-2.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20090113/aaddd8be/attachment.ksh>
More information about the Binutils
mailing list