Thanks Richard,

I tried outputting the echo of the ld command and it's linking all of the .5 
files together along with the few archive files to produce the raw kernel file. 
I'll go hunting to see if there is some other unbound symbol.

I think the reason why I'm confused is that I don't understand how the linker 
can possibly pick the "right" symbol here given that C doesn't allow 
overloading. There are two sleep symbols. Why does the linker generally know to 
pick the one from the .5 file and not the one from the libc.a. Is it that the 
linker prefers a symbol from a .5 file over the .a file?

Chris

On Sep 2, 2016, at 6:20 AM, Richard Miller <9f...@hamnavoe.com> wrote:

>> I have recently run into a problem when compiling the kernel where the 
>> linker complains about duplicate symbols and fails. The symbol is sleep(), 
>> which is exported in libc.a but is also exported in another file in port, 
>> but with different parameters (both number and type).
> 
> Shouldn't happen (TM).  The duplicate sleep may be a side effect of
> some other error (undefined symbol?) which is getting ld confused.
> I suggest finding the invocation of ld (or $LD) in the mkfile and
> inserting a copy of the command with "echo" prepended, to see exactly
> what's being linked; then have a good look at all the error messages
> and see if there's anything obvious you can clear up which could make
> the duplicate sleep go away too.
> 
> Otherwise you could post the ld line and error messages to get more
> eyes looking at the problem ...
> 
> 


Reply via email to