Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Dec 1998 15:35:48 -0700
From:      Wes Peters <wes@softweyr.com>
To:        Alfred Perlstein <bright@hotjobs.com>
Cc:        Paolo Di Francesco <paipai@tin.it>, freebsd-sparc@FreeBSD.ORG
Subject:   Re: Cross compiled code
Message-ID:  <36801EC4.26276FD6@softweyr.com>
References:  <Pine.BSF.4.05.9812220941370.6331-100000@bright.fx.genx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Alfred Perlstein wrote:
> 
> Try -fomit-frampointer (or equiv)
> %fp offset looks offwhack, but i'm not sure.  the code looks ok and i
> commented it for you. (*) means i'm unsure, but i'll check my book on the
> way to work.

The 2027 and 2023 offsets are probably relocation symbols, not offsets.
Link this into an executable and then dump the code with objdump -d
from binutils if you want to see the real offsets.

Paolo Di Francesco coded:
> >
> > ----- the original program prova.c (c code) -------
> >
> >
> > main(){
> >  int a,b;
> >
> >  a = 10;
> >  b = 20 + a;
> > }
> >
> > --------------------------------------------
> >
> > compiled with xgcc -S
> >
> > --------------------------------------------
> >  .file        "prova.c"
> > .section      ".text"
> >  .align 4
> >  .global main
> >  .type         main,#function
> >  .proc        04
> > main:
> >  !#PROLOGUE# 0
> >  save %sp,-208,%sp    ! adjust stack fram
> >  !#PROLOGUE# 1
> >  mov 10,%o0           ! a = 10
> >  st %o0,[%fp+2027]    ! this looks fishy 2027 looks a bit high(*)
> >  ld [%fp+2027],%o0    ! fishy (*)
> >  add %o0,20,%o1       ! a + 20 ->
> >  st %o1,[%fp+2023]    ! fishy (*)
> > .LL1:
> >  return %i7+8
> >  nop
> > .LLfe1:
> >  .size         main,.LLfe1-main
> >  .ident       "GCC: (GNU) egcs-2.91.60 19981201 (egcs-1.1.1 release)"


-- 
             Where am I, and what am I doing in this handbasket?

Wes Peters                                                     +1.801.915.2061
Softweyr LLC                                                  wes@softweyr.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-sparc" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36801EC4.26276FD6>