This is the mail archive of the binutils@sourceware.cygnus.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: Link error with today's CVS binutils


Geoff Keating wrote:

> > Date: Fri, 14 Jan 2000 10:39:34 -0600
> > From: Eric DeVolder <devolder@evsx.com>
>
> > I've built GCC 2.95.2 with today's CVS head for a ppc-elf as the target.
> > The software is a simple, fixed-address app that gets downloaded into
> > RAM of an eval board and then run. When linking, I get what I believe is
> > an error with the placement of the sections as directed by this linker
> > script:
> ...
> >     .klog (NOLOAD) :
> >     {
> >         PROVIDE (__KLOG_START = .);
> >         . = . + 0x00000400;
> >         PROVIDE (__KLOG_END = .);
> >     } > ram1
> >
> >     .data   :
> >     {
> >         PROVIDE (__DATA_RAM = .);
> >         PROVIDE (__DATA_ROM = .);
> >         PROVIDE (__DATA_START = .);
> >         *(.data)
> >         *(.got)                     /* to make the linker happy */
> >         PROVIDE (__DATA_END = .);
> >     } > ram1
> ...
> > The important thing to note here is that the .klog section is of length
> > 0x0400 and is placed into ram1, (0x00010000 to 0x000103FF). The .data
> > section is placed after .klog into ram1, and should start at 0x00010400.
>
> I'm not sure about that.  The .klog section isn't placed anywhere, you
> have specified NOLOAD.  Sections which are not loaded are allowed to
> overlap, for instance the stabs sections.  I may be wrong...
>
> --
> - Geoffrey Keating <geoffk@cygnus.com>

The GNU documentation says this:
The `(NOLOAD)' directive will mark a section to not be loaded at run time. The
linker will process the section normally, but will mark it so that a program
loader will not load it into memory.

I interpret this to mean that a NOLOAD section will still occupy space in the
memory map/image of the application, but won't get loaded (like .bss).

If my interpretation is correct (and the documentation is correct), then I
think NOLOAD isn't working correctly in the example I've provided.

Regardless, its behavior has changed from 2.9.1 to now. We need to correct
either the documentation or the linker.

Eric


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