[PATCH] Clean up ARM compressed loader

Nicolas Pitre nico at fluxnic.net
Thu Feb 25 13:30:56 EST 2010


On Thu, 25 Feb 2010, Hector Martin wrote:

> Nicolas Pitre wrote:
> > 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



More information about the linux-arm-kernel mailing list