From: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: ltp-list@lists.sourceforge.net,
Andrew Morton <akpm@linux-foundation.org>,
ltp-coverage@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/6] kernel: call constructors
Date: Tue, 06 May 2008 13:50:23 +0200 [thread overview]
Message-ID: <482045FF.8070109@de.ibm.com> (raw)
In-Reply-To: <20080505195301.GB8868@uranus.ravnborg.org>
Sam Ravnborg wrote:
> On Mon, May 05, 2008 at 05:24:04PM +0200, Peter Oberparleiter wrote:
>> From: Peter Oberparleiter <peter.oberparleiter@de.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.
next prev parent reply other threads:[~2008-05-06 11:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-05 15:24 [RFC PATCH 1/6] kernel: call constructors Peter Oberparleiter
2008-05-05 19:53 ` Sam Ravnborg
2008-05-06 11:50 ` Peter Oberparleiter [this message]
2008-05-06 4:19 ` Andrew Morton
2008-05-06 11:56 ` Peter Oberparleiter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=482045FF.8070109@de.ibm.com \
--to=peter.oberparleiter@de.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ltp-coverage@lists.sourceforge.net \
--cc=ltp-list@lists.sourceforge.net \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox