This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bad sh linking error with test case


On Tue, Apr 02, 2002 at 08:26:12AM -0600, Joel Sherrill wrote:
> 
> Hi,
> 
> 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
> 	.text
> 	.long	_ld_should_give_error_on_this_text_symbol
> 	.data
> 	.long	_ld_should_give_error_on_this_data_symbol


-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]