This is the mail archive of the binutils@sources.redhat.com 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]

Re: ld -Ttext 0x80000 causes ld.so segfault on ppc-unknown-linux-gnu


   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

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