lkml.org 
[lkml]   [2007]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch 1/3] Add BSS to resource tree
    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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-10-19 00:19    [W:0.026 / U:32.252 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site