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


Am Die, 2002-04-02 um 17.31 schrieb Daniel Jacobowitz:
> 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.
I can reproduce this problem with both using vanilla binutils-2.12 and
binutils-cvs (updated from sources a couple of minutes ago)
+ rtems-gcc-2.95.3 for sh-rtems (sh-coff).

# cat fred.c
main(){fred();}

# sh-rtems-gcc -o fred fred.c

# sh-rtems-ld --version
GNU ld version 2.12.90 20020402
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms
of
the GNU General Public License.  This program has absolutely no
warranty.

Ralf




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