[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with partial linking (.rel)

On Tue, 27 Jul 1999, Trevor Higgins wrote:

> Using the h8 toolchain, trying to link with the libraries and .rel libs
> causes ld (collect2:) to exit with a seg fault and fails to resolve the 
> symbols (unix/posix works fine in this regard so I suspect the toolchain)

Your description sounds a lot like problems I remember form years ago when
we first starting doing this trick.  Some of the binutils targets were
setting something wrong when doing the .rel's and it was blowing up in a
similar way.

If this is indeed the problem, then try some stuff like this:

+ Can you run nm on the .rel's?

+ Does something like this work?

  sh-rtems-ld -U rtems_event_receive no-event.rel librtems.a

A hack around this is to take advantage of the fact that the no-XXX.rel is
generated from a single file no-XXX.c --> no-XXX.o.  Copy the no-XXX.o
to no-XXX.rel and the installed no-XXX.rel and see if it goes away.

It sounds like you have a tool problem which can probably be reproduced
with a small assembly files and a sequence like this:

as file1.s -o file1.o
ld -o file1.rel -r file1.o
ld -u symbol_in_file1 file1.rel  -o file1

If this is a problem in binutils, it needs to be duplicated in a simple
fashion and reported so it can be fixed.

Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985