[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <482045FF.8070109@de.ibm.com>
Date: Tue, 06 May 2008 13:50:23 +0200
From: Peter Oberparleiter <peter.oberparleiter@...ibm.com>
To: Sam Ravnborg <sam@...nborg.org>
CC: ltp-list@...ts.sourceforge.net,
Andrew Morton <akpm@...ux-foundation.org>,
ltp-coverage@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 1/6] kernel: call constructors
Sam Ravnborg wrote:
> On Mon, May 05, 2008 at 05:24:04PM +0200, Peter Oberparleiter wrote:
>> From: Peter Oberparleiter <peter.oberparleiter@...ibm.com>
>> +#define CONSTRUCTORS \
>> + __CTOR_LIST__ = .; \
>> + *(.ctors) \
>> + __CTOR_END__ = .; \
>> + __DTOR_LIST__ = .; \
>> + *(.dtors) \
>> + __DTOR_END__ = .;
>
> You shall use: VMLINUX_SYMBOL() here.
Ok, will do.
> And why those SHOUTING names?
> All other linker symbols are lowercase.
Here's the background for that: currently, almost all
arch/*/vmlinux.lds.S scripts contain reference to a CONSTRUCTORS
sections which is (as of yet) empty. The info pages for ld contain
a description of the contents of this section (section 3.6.6 Output
Section Keywords), including the following sample linker script:
__CTOR_LIST__ = .;
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
*(.ctors)
LONG(0)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
*(.dtors)
LONG(0)
__DTOR_END__ = .;
Apparently this sample script is buggy (namely the divide by 4 bit on
64 bit systems) so I changed it into the version found in the patch.
This is somewhat of a trade-off between the information which
should be present in a CONSTRUCTORS section according to the info
page and what really is needed to implement constructor support.
I guess changing the names would be an option if required, as well
as dropping the (unused) destructor bit of the linker script.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists