Thread (126 messages) 126 messages, 10 authors, 2011-02-18
STALE5581d

[PATCH v2] ARM: Avoid discarding sections that might have SMP_ON_UP fixups SMP_ON_UP fixups

From: Russell King - ARM Linux <hidden>
Date: 2011-01-27 16:46:01
Also in: linux-omap

On Thu, Jan 27, 2011 at 02:37:09PM +0000, Dave Martin wrote:
On Wed, Jan 26, 2011 at 04:31:37PM -0500, Nicolas Pitre wrote:
quoted
Since discarded sections are by definition not used, we should at least 
put them into the .init section so to discard them at run time.  And 
only the EXIT_TEXT and EXIT_DATA would need to be kept (see x86 for 
example).


Nicolas
I'll check up on whether we need to care about writable data.
For now I've just attempted to move stuff to .init.
You can keep the discarding of the unwind data for exit sections as
the exit sections don't depend on the unwind data.

It's all to do with sections being referenced from other sections.  If
a section being kept references a section being discarded, then the
linker will error out.  You need to keep any section that is being
referenced - but you don't need to keep sections which only reference
those being kept.

I'd also prefer to see a 'KEEP_EXIT' macro as I think we can discard
these sections in more cases than just SMP_ON_UP.  I think it's:

SMP_ON_UP && !DEBUG_SPINLOCK

which requires it.  So if you have spinlock debugging enabled you can
discard the exit sections.  See include/linux/spinlock.h.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help