Thread (30 messages) 30 messages, 4 authors, 2010-02-25
STALE5980d

[PATCH] Clean up ARM compressed loader

From: nico@fluxnic.net (Nicolas Pitre)
Date: 2010-02-25 18:30:56

On Thu, 25 Feb 2010, Hector Martin wrote:
Nicolas Pitre wrote:
quoted
Obviously.  But that's the core of the argument: we made sure that the 
previous implementation didn't use any static within functions.  Why do 
you need to do that?  This is usually a bad idea anyway as this makes 
the function non reentrant.
Static inside functions doesn't imply being non-reentrant (any more than
using global variables does).
Usually it does, unless as you mention those are used read-only.
I think we don't have to teach each other how a C compiler works, right?

But just to make sure we're on the same page: if you need a global 
variable, or a static variable within a function, it is preferable if 
they're truly read-only by marking them const.  This has the advantage 
of not having to bother with .data relocation in RAM when booting a 
kernel directly from ROM as they get allocated to the .rodata section 
which is included in .text by default by the linker.


Nicolas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help