This is the mail archive of the
mailing list for the binutils project.
Re: Linking error
naga raj <email@example.com> writes:
> On Fri, Jun 15, 2012 at 8:51 PM, Ian Lance Taylor <firstname.lastname@example.org> wrote:
>> naga raj <email@example.com> writes:
>>>>> ../../empty_cpp_bsp_0/lib/liblocal.a(close.o): In function `close':
>>>>> /proj/empty_cpp_bsp_0//libsrc/src/close.c:50: multiple definition of `close'
>>>>> first defined here
>>> ÂFrom map file I found that close() function is called from libc of
>>> toolchain and not from my local library. I dont know why it is still
>>> refering close in local library.
>> Something is causing both liblocal.a(close.o) and
>> libc.a(lib_a-sysclose.o) to be included. ÂThe map file should tell for
>> each object why it was pulled in to the link.
> From the map file I have observed that it is only being refered from
> libc.a library
The top of the map file lists, for each object included from an archive,
why that object was included. The section is headed
"Archive member included because of file (symbol)"
That is where you need to look.
I don't know why you are looking at fstat, earlier you said the problem
was with close.
I think you left out the next line, which would tell you which symbol
caused libc_a-fstartr.o to be included in the link.