Re: missing .data.shared_align placement in vmlinux

From: Mike Frysinger
Date: Wed Aug 04 2010 - 14:12:34 EST


On Wed, Aug 4, 2010 at 07:56, Sam Ravnborg wrote:
> On Fri, May 21, 2010 at 04:58:53PM -0400, Mike Frysinger wrote:
>> am i missing something or does the .data.shared_align section lack
>> definition in vmlinux.lds.h and all arch vmlinux.lds.S files ?
>>
>> with the recent change "net: remove time limit in process_backlog()",
>> the softnet_data variable changed from "DEFINE_PER_CPU()" to
>> "DEFINE_PER_CPU_ALIGNED()" which moved it from the .data section to
>> the .data.shared_align section. Âi'm not saying this patch is wrong,
>> just that is what caused me to notice this larger problem. Âno one
>> else in the kernel is using this aligned macro variant, so i imagine
>> that's why no one has noticed yet.
>>
>> since .data.shared_align isnt declared in any vmlinux files that i can
>> see, the linker just places it last. Âthis "just works" for most
>> people, but when building a ROM kernel on Blackfin systems, it causes
>> section overlap errors:
>> bfin-uclinux-ld.real: section .init.data [00000000202e06b8 ->
>> 00000000202e48b7] overlaps section .data.shared_aligned
>> [00000000202e06b8 -> 00000000202e0723]
>> i imagine other arches which support the ROM config option and thus do
>> funky placement would see similar issues ...
>>
>> on x86, it is stuck in a dedicated section:
>>  [ 8] .data       PROGBITS    Âffffffff810ec000 2ec000
>> 0303a8 00 ÂWA Â0 Â 0 4096
>> Â [ 9] .data.shared_alig PROGBITS Â Â Â Âffffffff8111c3c0 31c3c0
>> 0000c8 00 ÂWA Â0 Â 0 64
>>
>> the ifdef forest in asm-generic/percpu.h is beyond a quick glance &
>> fix, so i leave it up to someone else ;)
>
> as there any resolution on this?
> I briefly looked at it some time ago.
> And it looks like a plain oversight.

no, it's still broken in 2.6.35 :(
$ make ARCH=blackfin BF537-STAMP_defconfig
$ make ARCH=blackfin -s -j4
$ readelf -WS vmlinux | grep '\<data\>'
[10] .data PROGBITS 0018369c 17269c 012964 00 WA 0 0 4
[11] .data..shared_aligned PROGBITS 00196000 185000 00006c 00
WA 0 0 4
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/