LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Tomas Carnecky <tom@dbservice.com>,
linux-kernel@vger.kernel.org,
Alon Bar-Lev <alon.barlev@gmail.com>
Subject: Re: [patch 03/26] Dynamic kernel command-line - arm
Date: Mon, 22 Jan 2007 22:27:25 +0000 [thread overview]
Message-ID: <20070122222725.GB32085@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20070122221400.GE6262@strauss.suse.de>
On Mon, Jan 22, 2007 at 11:14:00PM +0100, Bernhard Walle wrote:
> * Russell King <rmk+lkml@arm.linux.org.uk> [2007-01-18 16:23]:
> > On Thu, Jan 18, 2007 at 04:31:51PM +0100, Tomas Carnecky wrote:
> > > Russell King wrote:
> > > > On Thu, Jan 18, 2007 at 01:58:52PM +0100, Bernhard Walle wrote:
> > > >> -static char command_line[COMMAND_LINE_SIZE];
> > > >> +static char __initdata command_line[COMMAND_LINE_SIZE];
> > > >
> > > > Uninitialised data is placed in the BSS. Adding __initdata to BSS
> > > > data causes grief.
> > > >
> > >
> > > Static variables are implicitly initialized to zero. Does that also
> > > count as initialization?
> >
> > No. As I say, they're placed in the BSS. The BSS is zeroed as part of
> > the C runtime initialisation.
> >
> > If you want to place a variable in a specific section, it must be
> > explicitly initialised. Eg,
> >
> > static char __initdata command_line[COMMAND_LINE_SIZE] = "";
>
> Why? It must be initialised if you rely on a initialised value in the
> code.
That comment most certainly is 100% incorrect. The following:
static char foo[16];
has a well defined value when you read from it before writing to it.
If you think otherwise, suggest you read any specification of the C
language.
> But I don't think that this in in case here. Can you tell me the
> code where you read from command_line before writing to it?
That wasn't my point.
Anyway, here's what the GCC manual has to say about use of
__attribute__((section)) on variables:
`section ("SECTION-NAME")'
Use the `section' attribute with an _initialized_ definition of a
_global_ variable, as shown in the example. GCC issues a warning
and otherwise ignores the `section' attribute in uninitialized
variable declarations.
You may only use the `section' attribute with a fully initialized
global definition because of the way linkers work. The linker
requires each object be defined once, with the exception that
uninitialized variables tentatively go in the `common' (or `bss')
section and can be multiply "defined". You can force a variable
to be initialized with the `-fno-common' flag or the `nocommon'
attribute.
which reflects precisely what I've been saying concerning the addition
of __initdata.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
next prev parent reply other threads:[~2007-01-22 22:27 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-18 12:58 [patch 00/26] Dynamic kernel command-line Bernhard Walle
2007-01-18 12:58 ` [patch 01/26] Dynamic kernel command-line - common Bernhard Walle
2007-01-18 12:58 ` [patch 02/26] Dynamic kernel command-line - alpha Bernhard Walle
2007-01-18 12:58 ` [patch 03/26] Dynamic kernel command-line - arm Bernhard Walle
2007-01-18 14:14 ` Russell King
2007-01-18 14:48 ` Alon Bar-Lev
2007-01-18 15:31 ` Tomas Carnecky
2007-01-18 15:23 ` Russell King
2007-01-18 15:31 ` Alon Bar-Lev
2007-01-19 12:38 ` Bernhard Walle
2007-01-22 19:56 ` Andrew Morton
2007-01-22 20:00 ` Russell King
2007-01-22 20:31 ` Alon Bar-Lev
2007-01-22 20:44 ` Andrew Morton
2007-01-22 20:58 ` Bernhard Walle
2007-01-22 21:02 ` Alon Bar-Lev
2007-01-22 22:14 ` Bernhard Walle
2007-01-22 22:27 ` Russell King [this message]
2007-01-22 22:42 ` Bernhard Walle
2007-01-23 10:37 ` Alon Bar-Lev
2007-01-23 10:41 ` Russell King
2007-01-23 10:50 ` Alon Bar-Lev
2007-01-23 10:53 ` Russell King
2007-01-23 10:59 ` Alon Bar-Lev
2007-01-23 11:31 ` Alon Bar-Lev
2007-01-23 11:54 ` Russell King
2007-01-23 11:59 ` Alon Bar-Lev
2007-01-23 12:43 ` Russell King
2007-01-18 12:58 ` [patch 04/26] Dynamic kernel command-line - arm26 Bernhard Walle
2007-01-18 12:58 ` [patch 05/26] Dynamic kernel command-line - avr32 Bernhard Walle
2007-01-18 12:58 ` [patch 06/26] Dynamic kernel command-line - cris Bernhard Walle
2007-01-18 12:58 ` [patch 07/26] Dynamic kernel command-line - frv Bernhard Walle
2007-01-18 12:58 ` [patch 08/26] Dynamic kernel command-line - h8300 Bernhard Walle
2007-01-18 12:58 ` [patch 09/26] Dynamic kernel command-line - i386 Bernhard Walle
2007-01-18 12:58 ` [patch 10/26] Dynamic kernel command-line - ia64 Bernhard Walle
2007-01-18 12:59 ` [patch 11/26] Dynamic kernel command-line - m32r Bernhard Walle
2007-01-18 12:59 ` [patch 12/26] Dynamic kernel command-line - m68k Bernhard Walle
2007-01-18 12:59 ` [patch 13/26] Dynamic kernel command-line - m68knommu Bernhard Walle
2007-01-18 12:59 ` [patch 14/26] Dynamic kernel command-line - mips Bernhard Walle
2007-01-18 12:59 ` [patch 15/26] Dynamic kernel command-line - parisc Bernhard Walle
2007-01-18 12:59 ` [patch 16/26] Dynamic kernel command-line - powerpc Bernhard Walle
2007-01-18 12:59 ` [patch 17/26] Dynamic kernel command-line - ppc Bernhard Walle
2007-01-18 12:59 ` [patch 18/26] Dynamic kernel command-line - s390 Bernhard Walle
2007-01-18 12:59 ` [patch 19/26] Dynamic kernel command-line - sh Bernhard Walle
2007-01-18 12:59 ` [patch 20/26] Dynamic kernel command-line - sh64 Bernhard Walle
2007-01-18 12:59 ` [patch 21/26] Dynamic kernel command-line - sparc Bernhard Walle
2007-01-18 12:59 ` [patch 22/26] Dynamic kernel command-line - sparc64 Bernhard Walle
2007-01-18 12:59 ` [patch 23/26] Dynamic kernel command-line - um Bernhard Walle
2007-01-18 12:59 ` [patch 24/26] Dynamic kernel command-line - v850 Bernhard Walle
2007-01-18 12:59 ` [patch 25/26] Dynamic kernel command-line - x86_64 Bernhard Walle
2007-01-18 12:59 ` [patch 26/26] Dynamic kernel command-line - xtensa Bernhard Walle
[not found] <7EFbN-34r-3@gated-at.bofh.it>
[not found] ` <7EFbV-34r-45@gated-at.bofh.it>
[not found] ` <7EGhI-4Rq-11@gated-at.bofh.it>
[not found] ` <7EGKC-5vh-15@gated-at.bofh.it>
2007-01-18 19:56 ` [patch 03/26] Dynamic kernel command-line - arm Bodo Eggert
2007-01-22 11:38 ` Alon Bar-Lev
-- strict thread matches above, loose matches on Subject: below --
2006-12-02 10:47 [PATCH 00/26] Dynamic kernel command-line Alon Bar-Lev
2006-12-02 10:49 ` [PATCH 03/26] Dynamic kernel command-line - arm Alon Bar-Lev
2006-09-03 22:15 [PATCH 00/26] Dynamic kernel command-line - Resend please ignore last Alon Bar-Lev
2006-09-03 22:17 ` [PATCH 03/26] Dynamic kernel command-line - arm Alon Bar-Lev
2006-09-03 21:50 [PATCH 00/26] Dynamic kernel command-line Alon Bar-Lev
2006-09-03 21:53 ` [PATCH 03/26] Dynamic kernel command-line - arm Alon Bar-Lev
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=20070122222725.GB32085@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=alon.barlev@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tom@dbservice.com \
--subject='Re: [patch 03/26] Dynamic kernel command-line - arm' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).