lkml.org 
[lkml]   [2000]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: exporting struct offsets to assembler
On Sat, Aug 05, 2000 at 10:09:11AM -0400, Michael Meissner wrote:
> 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 System.map.
>
> 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).

Uhm, so you actually want to change entry.S lines like:
movl %eax,EAX(%esp) # save the return value
to:
movl %eax,.LEAX(%esp) # save the return value
? That sounds seriously ugly.

> > 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.

Have you actually looked at offset.c ? It works fine with a cross-compiler,
and so does the $(NM) and sed solution, I suspect.

Philipp Rumpf

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.242 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site