This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld -Ttext 0x80000 causes ld.so segfault on ppc-unknown-linux-gnu
- To: anton at mips dot complang dot tuwien dot ac dot at
- Subject: Re: ld -Ttext 0x80000 causes ld.so segfault on ppc-unknown-linux-gnu
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 9 Jul 2000 16:44:33 -0700
- CC: alan at linuxcare dot com dot au, anton at mips dot complang dot tuwien dot ac dot at, binutils at sourceware dot cygnus dot com
- References: <200007091740.TAA15310@a0.complang.tuwien.ac.at>
From: Anton Ertl <anton@a0.complang.tuwien.ac.at>
Date: Sun, 9 Jul 2000 19:40:25 +0200 (MET DST)
Ian Lance Taylor wrote:
> -Ttext is documented to set the start of the .text section. It's not
> very useful for ELF. For ELF, we might want to invent a new option,
> which somehow sets the address of the entire text segment.
I don't know ELF enough to know what the difference between sections
and segments is, but the documentation for ld-2.9.1, as well as 000705
says that -Ttext sets the start address of the text segment.
Hmmm, you're right. For older object file formats, ``section'' and
``segment'' mean the same thing. This should probably be fixed.
Also, with ld-2.9.5 on ppc-unknown-linux-gnu -Ttext seems to influnce
the start address of the following sections: .text .init .fini .rodata
.sdata2, and, probably indirectly, .data etc:
Yeah, that's because in the default linker script other sections take
their address from .text. But as you've seen that is not true of
every section.
My expectation wrt -Ttext is that the resulting binary works, and that
the executable code is behind, but not too far from the address given.
I.e., it should work like the ld script I created by setting
TEXT_START_ADDR in ld/emulparams/elf32ppc*.sh and running make.
That is what the imaginary new option to set the address of the text
segment should do.
Or I suppose we could change the implied definition of -Ttext.
Ian