lkml.org 
[lkml]   [2009]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] kernel: constructor support
Andrew Morton wrote:
> On Tue, 02 Jun 2009 13:44:00 +0200
> Peter Oberparleiter <oberpar@linux.vnet.ibm.com> wrote:
>> ...
>>
>> --- linux-2.6.30-rc7.orig/include/asm-generic/vmlinux.lds.h 2009-06-02 10:34:37.000000000 +0200
>> +++ linux-2.6.30-rc7/include/asm-generic/vmlinux.lds.h 2009-06-02 10:35:20.000000000 +0200
>
> Sam's tree has mucked with this file in linux-next.
>
>> @@ -332,6 +332,14 @@
>> /* Section used for early init (in .S files) */
>> #define HEAD_TEXT *(HEAD_TEXT_SECTION)
>>
>> +#ifdef CONFIG_CONSTRUCTORS
>> +#define KERNEL_CTORS() VMLINUX_SYMBOL(__ctors_start) = .; \
>> + *(.ctors) \
>> + VMLINUX_SYMBOL(__ctors_end) = .;
>> +#else
>> +#define KERNEL_CTORS()
>> +#endif
>> +
>> /* init and exit section handling */
>> #define INIT_DATA \
>> *(.init.data) \
>> @@ -340,7 +348,8 @@
>> CPU_DISCARD(init.data) \
>> CPU_DISCARD(init.rodata) \
>> MEM_DISCARD(init.data) \
>> - MEM_DISCARD(init.rodata)
>> + MEM_DISCARD(init.rodata) \
>> + KERNEL_CTORS()
>>
>
> What we now have here is
>
> #define INIT_DATA \
> *(.init.data) \
> DEV_DISCARD(init.data) \
> CPU_DISCARD(init.data) \
> MEM_DISCARD(init.data) \
> *(.init.rodata) \
> DEV_DISCARD(init.rodata) \
> CPU_DISCARD(init.rodata) \
> MEM_DISCARD(init.rodata)
>
> and I don't think that you wanted KERNEL_DTORS() inside the .rodata
> section, so I did this:
>
> #define INIT_DATA \
> *(.init.data) \
> DEV_DISCARD(init.data) \
> CPU_DISCARD(init.data) \
> MEM_DISCARD(init.data) \
> KERNEL_CTORS() \
> *(.init.rodata) \
> DEV_DISCARD(init.rodata) \
> CPU_DISCARD(init.rodata) \
> MEM_DISCARD(init.rodata)
>
> Please check that?

Looks good, compiles and still works. So that's an ACK from me.



\
 
 \ /
  Last update: 2009-06-03 13:59    [W:1.689 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site