This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: link script question - adding sections at specific addresses
- To: Becky Gill <bgill at ibmoto dot com>
- Subject: Re: link script question - adding sections at specific addresses
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Sat, 5 Aug 2000 13:18:38 +1000 (EST)
- cc: binutils at sourceware dot cygnus dot com
On Fri, 4 Aug 2000, Becky Gill wrote:
> I also
> noticed that once I defined my own PHDRS, that if I didn't explicitly put these
> sections (__libc_atexit, for example) into my script with a :phdr, then I got
> really strange behavior.
What sort of strange behaviour, and exactly which version of binutils are
you using? binutils-2.10 does handle orphan sections differently from CVS
binutils.
> The .note.ABI-tag section is in the text segment and the note segment. My
> linker script specifies the .note section like this:
>
> .note.ABI-tag :
> {
> *(note.ABI-tag)
> } :note :text
>
> My PHDRS are defined as:
> PHDRS
> {
> text PT_LOAD FILEHDR PHDRS;
> data PT_LOAD;
> note PT_NOTE;
> fake PT_LOAD;
> };
>
> Yet readelf for the build with my ld.script shows it only in the text segment.
> What am I doing wrong here?
I'm afraid I don't know :-( Maybe someone else on the list can answer this one?
What you're doing implies that you want a note segment inside your text
segment, as that is the only way a section can be assigned to multiple
segments. Perhaps this needs to be specified by setting the segment
addresses explicitly.
Alan Modra
--
Linuxcare. Support for the Revolution.