From: Sam Ravnborg <sam@ravnborg.org>
To: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
vgoyal@in.ibm.com, kexec@lists.infradead.org,
Bernhard Walle <bwalle@suse.de>,
linux-kernel@vger.kernel.org
Subject: Re: [patch 1/3] Add BSS to resource tree
Date: Fri, 19 Oct 2007 00:18:13 +0200 [thread overview]
Message-ID: <20071018221813.GA23801@uranus.ravnborg.org> (raw)
In-Reply-To: <20071018220048.GB3459@bingen.suse.de>
On Fri, Oct 19, 2007 at 12:00:48AM +0200, Andi Kleen wrote:
> On Thu, Oct 18, 2007 at 11:58:27PM +0200, Sam Ravnborg wrote:
> > On Thu, Oct 18, 2007 at 11:48:37PM +0200, Andi Kleen wrote:
> > > > > +extern char _text[], _end[], _etext[], _edata[], _bss[];
> > > >
> > > > These should be in a header file.
> > >
> > > Normally the "no externs in .c" rule doesn't apply to assembler or linker
> > > script defined labels. That's because the point of the header file is to
> > > type check them, but there is nothing to type check here.
> >
> > For linker generated symbols we have sections.h for this purpose.
> > The above symbols are all available if we do an:
> > #include <asm/sections.h>
> >
> > This is the right fix in this case.
>
> The problem is that they're often the wrong type here. E.g. wrong signedness
> etc. I ran into problems in the past where using this required ugly casts.
But then we should fix them instead of working around the problem - no?
Grepping for _text shows that there are plenty of different ways to declare
that symbol extern - this does not look correct.
And I recall that extern char sym[] is considered correct by binutils
people - but I'm not 100% sure and google did not give me an appropriate hit.
Sam
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: Sam Ravnborg <sam@ravnborg.org>
To: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Bernhard Walle <bwalle@suse.de>,
linux-kernel@vger.kernel.org, kexec@lists.infradead.org,
vgoyal@in.ibm.com
Subject: Re: [patch 1/3] Add BSS to resource tree
Date: Fri, 19 Oct 2007 00:18:13 +0200 [thread overview]
Message-ID: <20071018221813.GA23801@uranus.ravnborg.org> (raw)
In-Reply-To: <20071018220048.GB3459@bingen.suse.de>
On Fri, Oct 19, 2007 at 12:00:48AM +0200, Andi Kleen wrote:
> On Thu, Oct 18, 2007 at 11:58:27PM +0200, Sam Ravnborg wrote:
> > On Thu, Oct 18, 2007 at 11:48:37PM +0200, Andi Kleen wrote:
> > > > > +extern char _text[], _end[], _etext[], _edata[], _bss[];
> > > >
> > > > These should be in a header file.
> > >
> > > Normally the "no externs in .c" rule doesn't apply to assembler or linker
> > > script defined labels. That's because the point of the header file is to
> > > type check them, but there is nothing to type check here.
> >
> > For linker generated symbols we have sections.h for this purpose.
> > The above symbols are all available if we do an:
> > #include <asm/sections.h>
> >
> > This is the right fix in this case.
>
> The problem is that they're often the wrong type here. E.g. wrong signedness
> etc. I ran into problems in the past where using this required ugly casts.
But then we should fix them instead of working around the problem - no?
Grepping for _text shows that there are plenty of different ways to declare
that symbol extern - this does not look correct.
And I recall that extern char sym[] is considered correct by binutils
people - but I'm not 100% sure and google did not give me an appropriate hit.
Sam
next prev parent reply other threads:[~2007-10-18 22:17 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-18 11:15 [patch 0/3] Protect crashkernel against BSS overlap Bernhard Walle
2007-10-18 11:15 ` Bernhard Walle
2007-10-18 11:15 ` [patch 1/3] Add BSS to resource tree Bernhard Walle
2007-10-18 11:15 ` Bernhard Walle
2007-10-18 21:26 ` Andrew Morton
2007-10-18 21:26 ` Andrew Morton
2007-10-18 21:48 ` Andi Kleen
2007-10-18 21:48 ` Andi Kleen
2007-10-18 21:58 ` Sam Ravnborg
2007-10-18 21:58 ` Sam Ravnborg
2007-10-18 22:00 ` Andi Kleen
2007-10-18 22:00 ` Andi Kleen
2007-10-18 22:18 ` Sam Ravnborg [this message]
2007-10-18 22:18 ` Sam Ravnborg
2007-10-18 22:20 ` Andi Kleen
2007-10-18 22:20 ` Andi Kleen
2007-10-18 22:37 ` Andrew Morton
2007-10-18 22:37 ` Andrew Morton
2007-10-18 22:45 ` Andi Kleen
2007-10-18 22:45 ` Andi Kleen
2007-10-19 0:27 ` Jeremy Fitzhardinge
2007-10-19 0:27 ` Jeremy Fitzhardinge
2007-10-19 12:52 ` Bernhard Walle
2007-10-19 12:52 ` Bernhard Walle
2007-10-19 14:48 ` Bernhard Walle
2007-10-19 14:48 ` Bernhard Walle
2007-10-19 14:48 ` Bernhard Walle
2007-10-18 11:15 ` [patch 2/3] Introduce BOOTMEM_EXCLUSIVE Bernhard Walle
2007-10-18 11:15 ` Bernhard Walle
2007-10-18 11:15 ` [patch 3/3] Use BOOTMEM_EXCLUSIVE on x86 Bernhard Walle
2007-10-18 11:15 ` Bernhard Walle
-- strict thread matches above, loose matches on Subject: below --
2007-10-16 16:28 [patch 0/3] Protect crashkernel against BSS overlap Bernhard Walle
2007-10-16 16:28 ` [patch 1/3] Add BSS to resource tree Bernhard Walle
2007-10-16 16:28 ` Bernhard Walle
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=20071018221813.GA23801@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=bwalle@suse.de \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vgoyal@in.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.