From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Thu, 19 Jun 2008 23:33:35 -0400 Subject: [U-Boot-Users] Non-static global variables cause relocation to fail In-Reply-To: <485AC5C5.5080709@freescale.com> References: <20080619204505.48ABD248D2@gemini.denx.de> <485AC5C5.5080709@freescale.com> Message-ID: <485B250F.6090600@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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