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: chained AT() in linker scripts?


Jonathan Larmour <jlarmour@redhat.com> writes:

> Ian Lance Taylor wrote:
> > 
> > It would also be nice to have options like -Ttext which worked for
> > ELF.  -Ttext doesn't work, because it only sets the address of the
> > .text section, whereas when using ELF people generally want to set the
> > address of the text segment.
> 
> Just to clarify something: if there is only a .text section in the
> executable, is there a distinction? Or rather, are there any other standard
> sections in the text segment? Obviously the user could provide their own.

In the standard elf.sc, the text segment includes every section from
.hash to .fini.

If an executable only has a .text section, then the text segment
includes only the .text section.  They are, however, logically
distinct; the text segment is a program segment defined in the ELF
program headers.  The .text section is a section defined in the ELF
section table.

> Out of interest, ld.texinfo claims that -Ttext does set the text segment
> address, not section.

Yeah, that's a bug.  In a.out there is no distinction between sections
and segments.  Or else the documentation is correct, and the code is
in error, but it would be hard to fix in an appropriately general way.

Ian

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