[lkml]   [2000]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: exporting struct offsets to assembler
    On Sat, Aug 05, 2000 at 05:21:51AM +0100, Philipp Rumpf wrote:
    > On Sat, Aug 05, 2000 at 12:27:42PM +1000, Andrew Morton wrote:
    > > It uses some compiler tricks to export the structure offset
    > > into a global absolute symbol and uses that symbol in the
    > > assembly code.
    > So it introduces bogus symbols into

    Well use symbols that assembler will normally throw away (on most ELF ports,
    these symbols begin with .L, on most coff/a.out ports, these symbols begin with
    just L).

    > >
    > > This _should_ be arch-independent, but there is one potential
    > What's the point ? The assembly isn't architecture-independent anyway.
    > > This can be avoided if the assembler is smart enough with
    > >
    > > move some_label:b(a0),d0
    > >
    > > but I don't know if gas does that.
    > Or it can be avoided by using a header file that #defines the offsets -
    > which is exactly what mips does and other architectures did until some
    > time ago. See arch/mips/tools/offset.c.
    > I think it would be a better idea to generate the offsets automatically
    > and possibly in an architecture-independent way without falling back to
    > using symbols.

    However, you don't want to write a program that prints out the offsets, since
    then you are prohibiting building Linux with a cross compiler.

    Michael Meissner, Red Hat, Inc.
    PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
    Work: phone: +1 978-486-9304
    Non-work: fax: +1 978-692-4482

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:58    [W:0.020 / U:5.500 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site