This is the mail archive of the
mailing list for the binutils project.
Re: bad sh linking error with test case
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 2 Apr 2002 10:31:15 -0500
- Subject: Re: bad sh linking error with test case
- References: <3CA9BF84.86C0C73E@OARcorp.com>
On Tue, Apr 02, 2002 at 08:26:12AM -0600, Joel Sherrill wrote:
> I have come across a bad linking error in sh-rtems (sh-coff)
> for 2.12. sh-rtems-ld is failing to fail when linking an
> executable that has undefined symbols. As I reported earlier,
> this is enough to prevent gcc from building because autoconf
> assumes linking a program with an undefined symbol is the
> the way to determine if a library routine exists or not.
> I have put together a test program that demonstrates this
> failure for externs in both the text and data segments.
> The attached test case demonstrates this. To reproduce this
> use the following command sequence:
> sh-rtems-as test-sh-undefined.s -o test-sh-undefined.o
> sh-rtems-nm test-sh-undefined.o
> sh-rtems-ld test-sh-undefined.o
> sh-rtems-nm a.out | grep give_error
> Both undefined symbols show up in the final a.out as "U"
> so they are not resolved and there is no error on the ld.
> I tried to reproduce this for sh-coff but get an error
> about the file format of the .o produced by sh-coff-as
> being ambiguous to sh-coff-ld. I suspect this indicates
> another problem.
No comment on your other problem right now, but - I remember that for
some time you were using a snapshot from a week or two before release.
Is this actually 2.12? I'm fairly sure I'd fixed it.
> Advice, patches, appreciated. As best I can tell, this
> renders sh-coff/sh-rtems broken in 2.12.
> Joel Sherrill, Ph.D. Director of Research & Development
> joel@OARcorp.com On-Line Applications Research
> Ask me about RTEMS: a free RTOS Huntsville AL 35805
> Support Available (256) 722-9985
> .long _ld_should_give_error_on_this_text_symbol
> .long _ld_should_give_error_on_this_data_symbol
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer