From owner-freebsd-sparc  Tue Dec 22 14:36:55 1998
Return-Path: <owner-freebsd-sparc@FreeBSD.ORG>
Received: (from majordom@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id OAA08636
          for freebsd-sparc-outgoing; Tue, 22 Dec 1998 14:36:55 -0800 (PST)
          (envelope-from owner-freebsd-sparc@FreeBSD.ORG)
Received: from xylan.com (postal.xylan.com [208.8.0.248])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA08567
          for <freebsd-sparc@FreeBSD.ORG>; Tue, 22 Dec 1998 14:36:50 -0800 (PST)
          (envelope-from wes@softweyr.com)
Received: from mailhub.xylan.com by xylan.com (8.8.7/SMI-SVR4 (xylan-mgw 2.2 [OUT]))
	id OAA07882; Tue, 22 Dec 1998 14:35:50 -0800 (PST)
Received: from utah.XYLAN.COM by mailhub.xylan.com (SMI-8.6/SMI-SVR4 (mailhub 2.1 [HUB]))
	id OAA02592; Tue, 22 Dec 1998 14:35:49 -0800
Received: from softweyr.com by utah.XYLAN.COM (SMI-8.6/SMI-SVR4 (xylan utah [SPOOL]))
	id PAA06942; Tue, 22 Dec 1998 15:35:48 -0700
Message-ID: <36801EC4.26276FD6@softweyr.com>
Date: Tue, 22 Dec 1998 15:35:48 -0700
From: Wes Peters <wes@softweyr.com>
Organization: Softweyr LLC
X-Mailer: Mozilla 4.5 [en] (X11; U; FreeBSD 2.2.7-RELEASE i386)
X-Accept-Language: en
MIME-Version: 1.0
To: Alfred Perlstein <bright@hotjobs.com>
CC: Paolo Di Francesco <paipai@tin.it>, freebsd-sparc@FreeBSD.ORG
Subject: Re: Cross compiled code
References: <Pine.BSF.4.05.9812220941370.6331-100000@bright.fx.genx.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-freebsd-sparc@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.org

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