Subject: port-i386/6486: as dumps core
To: None <gnats-bugs@gnats.netbsd.org>
From: None <Anders.Hjalmarsson@economics.gu.se>
List: netbsd-bugs
Date: 11/23/1998 15:30:10
>Number:         6486
>Category:       port-i386
>Synopsis:       as dumps core
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 23 06:35:01 1998
>Last-Modified:
>Originator:     Anders Hjalmarsson
>Organization:
>Release:        NetBSD-current 19981122
>Environment:
System: NetBSD econahja.econ.gu.se 1.3H NetBSD 1.3H (ECONAHJA) #135: Wed Nov 11 10:08:12 CET 1998 econahja@econahja.econ.gu.se:/usr/src/sys/arch/i386/compile/ECONAHJA i386


>Description:
	as (gas.new) for i386 dumps core on the following code
	(cut down from mpn_add_n.S in gmp):

.text
L0:
	addl	$(Loop-L0-3),%eax
Loop:	movl	(%esi),%eax

fixP->fx_addsy is NULL so fixP->fx_addsy->bsym->flags & BSF_GLOBAL so the
process gets a SIGSEGV


>How-To-Repeat:

gdb /var/obj/gnu/usr.bin/gas.new/as
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386--netbsd), Copyright 1996 Free Software Foundation, Inc...
(gdb) run -k -o t.so t.s
Starting program: /var/obj/gnu/usr.bin/gas.new/as -k -o t.so t.s

Program received signal SIGSEGV, Segmentation fault.
0x22078 in md_apply_fix3 (fixP=0x43064, valp=0xefbfd5b4, seg=0x5d0ac)
    at /usr/src/gnu/usr.bin/gas.new/../../dist/gas/config/tc-i386.c:2734
2734      else if ((fixP->fx_r_type == BFD_RELOC_32)
(gdb) bt
#0  0x22078 in md_apply_fix3 (fixP=0x43064, valp=0xefbfd5b4, seg=0x5d0ac)
    at /usr/src/gnu/usr.bin/gas.new/../../dist/gas/config/tc-i386.c:2734
#1  0x13f32 in fixup_segment ()
#2  0x1283f in write_relocs ()
#3  0x400828b2 in bfd_map_over_sections ()
#4  0x133b5 in write_object_file ()
#5  0x46c5 in main ()
(gdb) 

>Fix:
>Audit-Trail:
>Unformatted: