Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread H. Peter Anvin
Huang, Ying wrote: I think another method is to add a new attribute into GCC to prepend or append something to section name instead of just to replace it, like the example as follow: #define __initdata __attribute__((section_append(".init"))) Same difference, but less flexible.

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Huang, Ying
On Thu, 2008-02-21 at 10:53 +0100, Ingo Molnar wrote: > * Huang, Ying <[EMAIL PROTECTED]> wrote: > > > > > -int __initdata early_ioremap_debug; > > > > +int __initbss early_ioremap_debug; > > > > > > will we get some sort of build error if we accidentally do: > > > > > >int __initbss

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread H. Peter Anvin
Ingo Molnar wrote: well, that's bad. We'd silently ignore the " = 1" and boot up with that value at 0, right? At minimum we need some really prominent build-time _errors_ (i.e. aborted builds) if this ever happens. But ideally, shouldnt this whole thing be done at link time? Couldnt the

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Matt Mackall
On Thu, 2008-02-21 at 10:53 +0100, Ingo Molnar wrote: > * Huang, Ying <[EMAIL PROTECTED]> wrote: > > > > > -int __initdata early_ioremap_debug; > > > > +int __initbss early_ioremap_debug; > > > > > > will we get some sort of build error if we accidentally do: > > > > > >int __initbss

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Ingo Molnar
* Huang, Ying <[EMAIL PROTECTED]> wrote: > > > -int __initdata early_ioremap_debug; > > > +int __initbss early_ioremap_debug; > > > > will we get some sort of build error if we accidentally do: > > > >int __initbss early_ioremap_debug = 1; > > > > ? > > I tested it just now, and there is

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Huang, Ying
On Thu, 2008-02-21 at 10:05 +0100, Ingo Molnar wrote: > * Huang, Ying <[EMAIL PROTECTED]> wrote: > > > Uninitialized variable in init DATA sections are relocated into init > > BSS sections to reduce kernel image size. Several KB can be reduced. > > > -int __initdata early_ioremap_debug; > >

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Ingo Molnar
* Huang, Ying <[EMAIL PROTECTED]> wrote: > Uninitialized variable in init DATA sections are relocated into init > BSS sections to reduce kernel image size. Several KB can be reduced. > -int __initdata early_ioremap_debug; > +int __initbss early_ioremap_debug; will we get some sort of build

[PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Huang, Ying
Uninitialized variable in init DATA sections are relocated into init BSS sections to reduce kernel image size. Several KB can be reduced. Signed-off-by: Huang Ying <[EMAIL PROTECTED]> --- arch/x86/kernel/acpi/boot.c | 14 +++--- arch/x86/kernel/aperture_64.c |6

[PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Huang, Ying
Uninitialized variable in init DATA sections are relocated into init BSS sections to reduce kernel image size. Several KB can be reduced. Signed-off-by: Huang Ying [EMAIL PROTECTED] --- arch/x86/kernel/acpi/boot.c | 14 +++--- arch/x86/kernel/aperture_64.c |6 +++---

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Ingo Molnar
* Huang, Ying [EMAIL PROTECTED] wrote: Uninitialized variable in init DATA sections are relocated into init BSS sections to reduce kernel image size. Several KB can be reduced. -int __initdata early_ioremap_debug; +int __initbss early_ioremap_debug; will we get some sort of build error if

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Huang, Ying
On Thu, 2008-02-21 at 10:05 +0100, Ingo Molnar wrote: * Huang, Ying [EMAIL PROTECTED] wrote: Uninitialized variable in init DATA sections are relocated into init BSS sections to reduce kernel image size. Several KB can be reduced. -int __initdata early_ioremap_debug; +int __initbss

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Ingo Molnar
* Huang, Ying [EMAIL PROTECTED] wrote: -int __initdata early_ioremap_debug; +int __initbss early_ioremap_debug; will we get some sort of build error if we accidentally do: int __initbss early_ioremap_debug = 1; ? I tested it just now, and there is no build error.

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Matt Mackall
On Thu, 2008-02-21 at 10:53 +0100, Ingo Molnar wrote: * Huang, Ying [EMAIL PROTECTED] wrote: -int __initdata early_ioremap_debug; +int __initbss early_ioremap_debug; will we get some sort of build error if we accidentally do: int __initbss early_ioremap_debug = 1;

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread H. Peter Anvin
Ingo Molnar wrote: well, that's bad. We'd silently ignore the = 1 and boot up with that value at 0, right? At minimum we need some really prominent build-time _errors_ (i.e. aborted builds) if this ever happens. But ideally, shouldnt this whole thing be done at link time? Couldnt the linker

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread Huang, Ying
On Thu, 2008-02-21 at 10:53 +0100, Ingo Molnar wrote: * Huang, Ying [EMAIL PROTECTED] wrote: -int __initdata early_ioremap_debug; +int __initbss early_ioremap_debug; will we get some sort of build error if we accidentally do: int __initbss early_ioremap_debug = 1;

Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section

2008-02-21 Thread H. Peter Anvin
Huang, Ying wrote: I think another method is to add a new attribute into GCC to prepend or append something to section name instead of just to replace it, like the example as follow: #define __initdata __attribute__((section_append(.init))) Same difference, but less flexible. -hpa