link script question - adding sections at specific addresses

Alan Modra alan@linuxcare.com.au
Fri Aug 4 20:19:00 GMT 2000


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.



More information about the Binutils mailing list