>> This is doable in asm, yes. For .bss, we need to not forget about
You are right, in assembly we can specify needed attributes.
I am more concerned about C:
arch/x86/include/asm/cache.h:
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
If we change it to
#define __read_mostly __attribute__((__section__(".data-read_mostly")))
What makes this section have correct attributes?
With current gcc, __attribute__((__section__(".bss-page_aligned")))
does get wrong attributes. That's why we settled on .bss..foo
scheme.
When I was working on a older iteration of this patch,
I renamed .bss.page_aligned to .page_aligned.bss
and was bitten by linker bug: linker tried to merge
the sections and corrupted them.
Aha, here is it:
http://sourceware.org/bugzilla/show_bug.cgi?id=5006
It was since fixed, and if I read the ld patch correctly,
now ld emits a warning and switches entire target section
to PROGBITS - not what we want to happen to bss.
--
vda
--