public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jerry Van Baren <gvb.uboot@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Non-static global variables cause relocation to fail
Date: Sun, 22 Jun 2008 13:17:34 -0400	[thread overview]
Message-ID: <485E892E.9040803@gmail.com> (raw)
In-Reply-To: <485BC2E5.8040101@freescale.com>

Timur Tabi wrote:
> Jerry Van Baren wrote:

[snip]

>> I'm guessing from the name "eeprom" that you have a non-zero initializer 
>> on it???  
> 
> No, no initializer.
> 
>> Does it make a difference if it is uninitialized, initialized 
>> to {0}, or initialized to non-zero values?
> 
> I don't know, I haven't considered it.
> 
> I did notice this code in fsl_i2c.c:
> 
> #ifdef CFG_SPD_BUS_NUM
> static unsigned int i2c_bus_num __attribute__ ((section ("data"))) =
> CFG_SPD_BUS_NUM;
> #else
> static unsigned int i2c_bus_num __attribute__ ((section ("data"))) = 0;
> #endif
> 
> I wrote this code, but I don't remember why I added the "__attribute__ ((section
> ("data")))".  I guess I should have commented it, but I wonder if it applies to
> my current problem.

It doesn't apply in the original complaint and may be flat out wrong, 
but I recall having a problem forcing a zero initializer into the data 
section.  Gcc insisted on putting it in bss and, after playing language 
lawyer with the gcc manual/descriptions/etc, I concluded it was expected 
behavior of gcc.

[snip]

> When I post the full patch, I'll revisit this problem.  Sorry for all the noise.

Interesting quirk.  We may give you a hard time, but that just betrays 
our curiosity.  ;-)

Best regards,
gvb

      parent reply	other threads:[~2008-06-22 17:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19 18:44 [U-Boot-Users] Non-static global variables cause relocation to fail Timur Tabi
2008-06-19 20:45 ` Wolfgang Denk
2008-06-19 20:47   ` Timur Tabi
2008-06-19 20:52     ` Wolfgang Denk
2008-06-19 21:12       ` Timur Tabi
2008-06-19 21:55         ` Wolfgang Denk
2008-06-20  3:33     ` Jerry Van Baren
2008-06-20 14:47       ` Timur Tabi
2008-06-21  0:27         ` Wolfgang Denk
2008-06-22 17:17         ` Jerry Van Baren [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=485E892E.9040803@gmail.com \
    --to=gvb.uboot@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox