Subject: port-m68k/5335: GAS 2.8.1 complains about syntax in crt0.c
To: None <gnats-bugs@gnats.netbsd.org>
From: None <ivanenko@ctpa03.mit.edu>
List: netbsd-bugs
Date: 04/21/1998 11:19:32
>Number:         5335
>Category:       port-m68k
>Synopsis:       GAS 2.8.1 complains about syntax in crt0.c
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 21 08:20:01 1998
>Last-Modified:
>Originator:     
>Organization:
working for myself
	
>Release:        <NetBSD-current source date> current as ofTue Apr 21 10:46:55 EDT 1998
>Environment:
	
Cross-compiling SunOS 4.1.3 to 
NetBSD/mac68k, gas configured with 
./configure --target=m68k-apple-netbsd
System: SunOS 4.1.3 2 sun4c
Architecture: sun4

>Description:
	

Here is a fragment in question from src/lib/libc/csu/m68k/crt0.c

#ifdef DYNAMIC
__asm("
        .text
        .align  2
___syscall:
        movel   a7@+,a0
        movel   a7@,d0
        movel   a0,a7@
        trap    #0
        bcs     1f
        jmp     a0@
1:
        moveq   #-1,d0
        jmp     a0@
");
#endif /* DYNAMIC */

GAS 2.8.1 does not understand the statement "bcs 1f" and does not 
allow numerical labels. When the label 1 is replaced with well-formed 
label, the output is the same and the assembler is happy.

>How-To-Repeat:
>Fix:
	

Here is the diff -c
pwd=/syjet/src/lib/csu/m68k

*** crt0.c.orig	Tue Apr 21 11:10:47 1998
--- crt0.c	Tue Apr 21 11:11:33 1998
***************
*** 106,114 ****
  	movel	a7@,d0
  	movel	a0,a7@
  	trap	#0
! 	bcs	1f
  	jmp	a0@
! 1:
  	moveq	#-1,d0
  	jmp	a0@
  ");
--- 106,114 ----
  	movel	a7@,d0
  	movel	a0,a7@
  	trap	#0
! 	bcs	Local_Label_1
  	jmp	a0@
! Local_Label_1:
  	moveq	#-1,d0
  	jmp	a0@
  ");
>Audit-Trail:
>Unformatted:
    GAS 2.8.1 does not understand syntax in crt0.c
	sw-bug