Subject: Problems Cross-Assembling w/ Generic gas
To: NetBSD-current Users <current-users@NetBSD.ORG>
From: Curt Sampson <curt@portal.ca>
List: current-users
Date: 10/16/1996 16:31:51
I've just built a cross-compilation system hosted sparc-netbsd and
targeted i386-netbsd. Unfortunately, something appears to be wrong
with gas on the sparc. The cross-gcc and cc on the native platform
produce exactly the same assembler file, but the two assemblers do
not produce the same object file.

I've appended a context diff of the differences that objdump shows
me.  The relocation records are in reverse order in one file compared
to the other, but still the same. What concerns me is the second
field after the type in the symbol table; it's different between
the two files for a couple of symbols. I don't know what this field
is (yet).

This is using gas from binuils-2.7 (July 1996). I notice that the
version we are using is four months older (March 1996). It could
be something to do with this.

Before I go digging into gas, I wanted to ask a couple of questions.
First, is there some reason we're not using the more recent version
of gas avilable in bintutils-2.7. (Like, it doesn't generate .o
files that work for us? :-)) Second, have we made any local
modifications to gas?

cjs

Curt Sampson    curt@portal.ca		Info at http://www.portal.ca/
Internet Portal Services, Inc.	
Vancouver, BC   (604) 257-9400		De gustibus, aut bene aut nihil.


*** o.i386	Wed Oct 16 16:12:48 1996
--- o.sparc	Wed Oct 16 16:12:54 1996
***************
*** 1,6 ****
  
! y.o.i386:     file format a.out-i386-netbsd
! y.o.i386
  architecture: i386, flags 0x0000003f:
  HAS_RELOC, EXEC_P, HAS_LINENO, HAS_DEBUG, HAS_SYMS, HAS_LOCALS
  start address 0x00000000
--- 1,6 ----
  
! y.o.sparc:     file format a.out-i386-netbsd
! y.o.sparc
  architecture: i386, flags 0x0000003f:
  HAS_RELOC, EXEC_P, HAS_LINENO, HAS_DEBUG, HAS_SYMS, HAS_LOCALS
  start address 0x00000000
***************
*** 16,23 ****
  SYMBOL TABLE:
  00000000 l       .text 0000 00 04 gcc2_compiled.
  00000000 l       .text 0000 00 04 ___gnu_compiled_c
! 00000060 g       .data 0000 01 07 _external_var
! 00000020 g       .text 0000 02 05 _main
  00000000         *UND* 0000 00 01 ___main
  00000000         *UND* 0000 00 01 _printf
  00000004 g       *COM* 0000 00 01 _nontref_external_var
--- 16,23 ----
  SYMBOL TABLE:
  00000000 l       .text 0000 00 04 gcc2_compiled.
  00000000 l       .text 0000 00 04 ___gnu_compiled_c
! 00000060 g       .data 0000 00 07 _external_var
! 00000020 g       .text 0000 00 05 _main
  00000000         *UND* 0000 00 01 ___main
  00000000         *UND* 0000 00 01 _printf
  00000004 g       *COM* 0000 00 01 _nontref_external_var
***************
*** 25,34 ****
  
  RELOCATION RECORDS FOR [.text]:
  OFFSET   TYPE              VALUE 
- 00000055 DISP32            _printf
- 00000050 32                .text
- 00000043 DISP32            _printf
- 0000003e 32                .text
  00000027 DISP32            ___main
  
  
--- 25,34 ----
  
  RELOCATION RECORDS FOR [.text]:
  OFFSET   TYPE              VALUE 
  00000027 DISP32            ___main
+ 0000003e 32                .text
+ 00000043 DISP32            _printf
+ 00000050 32                .text
+ 00000055 DISP32            _printf