[Top] [All Lists]

Re: Globals not getting initialized

To: "Bradley D. LaRonde" <>
Subject: Re: Globals not getting initialized
From: Ralf Baechle <>
Date: Thu, 22 Jul 1999 05:03:50 +0200
In-reply-to: <029f01bed3dd$1c57c5a0$>; from Bradley D. LaRonde on Wed, Jul 21, 1999 at 08:57:02PM -0400
References: <029f01bed3dd$1c57c5a0$>
On Wed, Jul 21, 1999 at 08:57:02PM -0400, Bradley D. LaRonde wrote:

> OK, I just checked the program headers for the executable.  There are
> multiple segments in the executable:  three in the one that works, and two
> in the one that doesn't.  In the one that works, the last segment does
> include my global variable initialization, but it's not there in the one
> that doesn't.  Oddly enough, though, the data is in the executable, but just
> not in a loadable segment.
> So, in summary, it appears that the linker is putting my global
> initialization data into the executable, but not including it a loadable
> segment in the program headers, so the bootloader isn't loading it, and it
> has something to do with ld.script.little.

The flags (load, allocate etc.) for a new section are set by the first
input section going into that output section.  So maybe you're linking
some section with weird settings as the frist one into .data?

Oh, you're not getting trapped by the -N linker option bug?  Don't pass
it to ld or you'll get a bad kernel binary.  I haven't yet tracked down


<Prev in Thread] Current Thread [Next in Thread>