All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] arm: wrong Relocation and not cleared BSS
@ 2010-10-30 13:08 Alexander Holler
  2010-10-30 13:36 ` Albert ARIBAUD
  2010-10-31  7:43 ` Heiko Schocher
  0 siblings, 2 replies; 37+ messages in thread
From: Alexander Holler @ 2010-10-30 13:08 UTC (permalink / raw)
  To: u-boot

Hello,

to give the topic a better meaning and to summarize what I think is 
currently happening along with some "pictures" for a better understanding:

We are starting with code (c) and data (d) somewhere in the memory:

----------
|cd      |
----------

The relocation in start.S should achieve this:

----------
|      cd|
----------

That means code and data should be moved upwards. What
currently is happening is the following:

----------
| d    c |
----------

The code is moved upwards, but that code still uses the data at d.
This results another problem: Some parts in the code are assuming that d 
is cleared (set to zero in start.S). But what start.S does it to clear
the new location (z in the picture below).

----------
| d    cz|
----------

Because the code (c) still uses the data (bss) in d and not in z, some 
hard to find errors might occur because the used data isn't set to zero 
as required.

I have almost no knowledge about how gcc and the binutils are handling 
relocation, therfore I can't help much further here. What I think is 
part of the problem, is that -fPIC was removed. Using -pie in LDFLAGS 
might be used to get relocatable code, but the data will not be 
relocated. And I would wonder if that is possible without instructing 
the compiler to build stuff for relocation (-fPIC).


I hope that brings some light into the problem.

Regards,

Alexander

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2010-11-03  2:29 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-30 13:08 [U-Boot] arm: wrong Relocation and not cleared BSS Alexander Holler
2010-10-30 13:36 ` Albert ARIBAUD
2010-10-30 13:45   ` Alexander Holler
2010-10-30 13:57     ` Albert ARIBAUD
2010-10-30 14:07       ` Alexander Holler
2010-10-30 14:39       ` Wolfgang Denk
2010-10-30 16:01         ` Albert ARIBAUD
2010-10-30 16:10           ` Wolfgang Denk
2010-10-30 14:37     ` Wolfgang Denk
2010-10-30 14:36   ` Wolfgang Denk
2010-10-31 10:59     ` Alexander Holler
2010-10-31 11:58       ` Wolfgang Denk
2010-10-31 12:21         ` Albert ARIBAUD
2010-10-31 16:18         ` Alexander Holler
2010-10-30 15:00   ` Wolfgang Denk
2010-10-30 17:21     ` Albert ARIBAUD
2010-10-30 18:01       ` Wolfgang Denk
2010-10-31  7:44     ` Heiko Schocher
2010-10-30 15:15   ` Darius Augulis
2010-10-30 16:44     ` Albert ARIBAUD
2010-10-30 20:03     ` Alexander Holler
2010-10-30 20:51       ` Alexander Holler
2010-10-31  7:47         ` Heiko Schocher
2010-11-02  5:39           ` V, Aneesh
2010-11-02  5:58             ` V, Aneesh
2010-11-02  6:32               ` Albert ARIBAUD
2010-11-02  7:18                 ` V, Aneesh
2010-11-02  7:37                   ` [U-Boot] Bad page state in process 'swapper' sywang
2010-11-02  7:44                     ` Albert ARIBAUD
2010-11-02  8:13                       ` sywang
2010-11-02  8:44                         ` Wolfgang Denk
2010-11-02  8:40                     ` Wolfgang Denk
2010-11-03  2:29                       ` sywang
2010-11-02  7:41                   ` [U-Boot] arm: wrong Relocation and not cleared BSS Albert ARIBAUD
2010-11-02  8:53                     ` V, Aneesh
2010-11-02  9:04                       ` Albert ARIBAUD
2010-10-31  7:43 ` Heiko Schocher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.