[PATCH] ARM: Avoid discarding sections that might have SMP_ON_UP fixups
Russell King - ARM Linux
linux at arm.linux.org.uk
Thu Feb 10 14:11:25 EST 2011
On Thu, Feb 10, 2011 at 06:29:41PM +0000, Dave Martin wrote:
> On Thu, Feb 10, 2011 at 2:46 PM, Russell King - ARM Linux
> <linux at arm.linux.org.uk> wrote:
> > On Thu, Feb 10, 2011 at 02:13:13PM +0000, Dave Martin wrote:
> >> Note that this tree contains some extra patches (though I believe
> >> nothing is there which should cause the problem), and does not contain
> >> everything from rmk/devel -- so it's possible this has been fixed in
> >> the meantime or no longer occurs for some other reason...
> >
> > No need - I now have some modules which contain SMP alternatives, so we
> > do need to fix the module loader for this, and keep the SMP alternatives
> > replacement code around. It's not worth eliminating the code as if we
> > include an informative printk() to say why we're refusing to load the
> > module, the string would be larger than the code it eliminates. So, I
> > think we need to merge the patch below to avoid run-time problems.
>
> I thought the problem was not caused by removal of the fixup code, but
> rather by the removal of code referenced by fixups?
It is. But:
arm-linux-objdump -h sound/core/snd-timer.ko
sound/core/snd-timer.ko: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00002f34 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .exit.text 00000070 00000000 00000000 00002f68 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
2 .init.text 000001b4 00000000 00000000 00002fd8 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
3 .rodata 000000bc 00000000 00000000 0000318c 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
4 .rodata.str1.1 00000156 00000000 00000000 00003248 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .alt.smp.init 00000088 00000000 00000000 0000339e 2**0
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
...
Here we have a module which contains the spin_unlock assembly, which
contains the SMP alternatives. If we insert that into a kernel also
built with SMP alternatives support, but which is running on a UP
system, we need to run these fixups as well when the module is loaded.
More information about the linux-arm-kernel
mailing list