Re: Help: YDL 1.2.1 gcc compiler/linker generates wierd errors


Subject: Re: Help: YDL 1.2.1 gcc compiler/linker generates wierd errors
From: Mike Melanson (melanson@pcisys.net)
Date: Sun May 27 2001 - 17:30:21 MDT


On Sun, 27 May 2001, D W wrote:

> When I try compiling and linking a test program using gcc,
> I'm getting various errors at link time and the link does not
> complete. (I also get the same linker errors if I try compiling
> using /usr/bin/cc ).

        Just for reference, cc and gcc are likely to be the same:
[melanson@b-wing melanson]$ dir /usr/bin/cc
lrwxrwxrwx 1 root root 3 Apr 29 10:05 /usr/bin/cc -> gcc

> /home/test2.c:9: undefined reference to `test1_fn'
> /home/test2.c:9: relocation truncated to fit: R_PPC_REL24 test1_fn
> /home/test2.c:10: test2_fn: undefined reference to `var11'

***** ^^^^^
        Your example sources didn't mention 'var11', but they did mention
'var1'. That might explain that.

>
>
> _________________________
> 5. Questions:
>
> What errors, if any, exist in the .c files or the compile
> command that would result in the errors:
>
> undefined reference
> relocation truncated to fit

        Just so you know, those 2 test source files you sent compile fine,
but not with your compile command (the .o files hadn't been built
yet). This worked:
  gcc -o test test1.c test2.c
So the test was probably not representative of your true problem. A few
questions for you:
1) Can we see the program, i.e., is it open source? This would be the
quickest way to solve the problem. If not...
2) What CPU arch/OS platform(s) and development environments (C compiler)
is it known to work on, just as a baseline for investigation.

That 'relocation truncated to fit' stumps me right now. But I can't get it
to happen.

> The actual app being compiled consists of many .c and .h
> files. Is there possibly some symbol table over-run taking
> place? If so, is there a way to increase the table size?

        I'm thinking that if it works with gcc on another platform (does
it?) then it should work with gcc on this platform as well. That's my
guess.

-- 
	-Mike Melanson



This archive was generated by hypermail 2a24 : Sun May 27 2001 - 16:36:22 MDT