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: Thu, 19 Jun 2008 23:33:35 -0400	[thread overview]
Message-ID: <485B250F.6090600@gmail.com> (raw)
In-Reply-To: <485AC5C5.5080709@freescale.com>

Timur Tabi wrote:
> Wolfgang Denk wrote:
> 
>> You  don't  seriously  expect  any  real  help  given  such  a  vague
>> description?  It  would be somewhat helpful if you said exactly which
>> changes cause the code to work or fail...
> 
> I did say that.  Simply making the global variable not static caused it to fail.
> 
> Works:
> 
> static struct __attribute__ ((__packed__)) eeprom {
> 
> Doesn't work:
> 
> struct __attribute__ ((__packed__)) eeprom {
> 
> Everything else is the same.

Hi Timur,

That isn't a variable, that is the first line of a struct declaration. 
You cut some pretty important information: what the struct is, the 
actual variable in question, and whether it is initialized.

I'm guessing from the name "eeprom" that you have a non-zero initializer 
on it???  Does it make a difference if it is uninitialized, initialized 
to {0}, or initialized to non-zero values?

Does it make a difference if it is packed or not (my guess: much less 
likely than initialization to cause works/broken).

Best regards,
gvb

  parent reply	other threads:[~2008-06-20  3:33 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 [this message]
2008-06-20 14:47       ` Timur Tabi
2008-06-21  0:27         ` Wolfgang Denk
2008-06-22 17:17         ` Jerry Van Baren

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=485B250F.6090600@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