linux-mips-fnet
[Top] [All Lists]

Re: Globals not getting initialized

To: "Ralf Baechle" <ralf@uni-koblenz.de>
Subject: Re: Globals not getting initialized
From: "Bradley D. LaRonde" <brad@ltc.com>
Date: Thu, 22 Jul 1999 21:14:22 -0400
Cc: <linuxce-devel@linuxce.org>, <linux-mips@fnet.fr>
>> In case you missed the subtlety, I'll say it right out - yup, it was
the -N
>> bug.
>
>> Well, now that I'm an expert on this bug, need any help fixing it?  :)
>
>I'd appreciate if somebody'd pump some of his time into that.  Alternative,
>can you comeup with some minimal piece of code to demonstrate the problem?



Here's a summary of what I found when I linked with ld.script.little and -N:

1.  None of my arrays with initializer lists would get initialized.  For
example:

    int a[] = {1,2,3};

    would just end up being {0,0,0}.

2.  It affects local and global arrays, and possibly other kinds of
initializations.

3.  It only occurred with ld.script.little and -N combined.  Option -N works
fine with the NetBSD liker script, but not with ld.script.little.

4.  The initialzation data does make it into the executable.  The problem is
that it appears not to be referenced in the elf program headers, so the
bootloader won't load it.

I think the key is that it's the combination of ld.script.little and -N that
cause the initializations to fail, and not just the -N alone.  The other
clue is that the data makes it into the executable but appears to not be
referenced in the elf program headers.

I'm really focused right now on getting the kernel up to "Calibrating delay
loop", but when I get a lull I may produce a very simple demonstration as
you suggest.


Regards,
Brad

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