From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: joel@merlin.gcs.redstone.army.mil Cc: gas2@cygnus.com Subject: Re: possible bug in bfd/sunos.c Date: Tue, 28 May 1996 09:07:00 -0000 Message-id: <199605281607.MAA13904@sanguine.cygnus.com> References: X-SW-Source: 1996/msg00031.html Date: Tue, 28 May 1996 10:50:25 -0500 (CDT) From: Joel Sherrill I am configured for sparc-rtems which is essentially the same as sparc-aout with different CPP_PREDEFINES. I use the following assembly file (cut down to the point of uselessness :) ): .text sethi %hi(stack_space + 16 * 1024), %g1 call _main .comm stack_space, 16 * 1024 I then run this script on it: sparc-rtems-as -o test.o test.s sparc-rtems-ld test.o and get the following message: bfd assertion fail ../../src/bfd/sunos.c:1839 If you configure for a SunOS target, the linker will automatically generate a shared library if there are any undefined symbols in the link. This odd behaviour is for compatibility with the SunOS linker. In the current snapshots, the sparc-aout target does not have this behaviour, since shared libraries are not useful for embedded systems, but in 2.6 the sparc-aout target is the same as SunOS. In your example, the linker is created a shared library. The assertion failure you are getting is, as you guessed, a bug in the assertion condition. You can just replace the BFD_ASSERT with one from a current snapshot to avoid it. It is likely, though, that you do not want to create a shared library at all. Ian