duplicate symbol table entries in libc.a 
Author Message
 duplicate symbol table entries in libc.a

[posted and emailed]

Quote:

>/home/jharlan> nm /lib/libc.a | grep "^mkdir "
>mkdir                U          -
>mkdir                d     268448       4
>/home/jharlan> nm /lib/libc.a | grep "^umask "
>umask                U          -
>umask                d     268444       4
>/home/jharlan>

>I'm no expert, but this seems to be telling me that the same symbol is both
>defined and undefined at the same time?

If I'm interpreting your output correctly, each name is undefined in one
module within the library, and defined in a different module in the same
library.

In other words, some other library routine(s) in the same library is(are)
calling mkdir( ) and umask( ).

--
Stan Brown, Oak Road Systems, Cleveland, Ohio, USA
                      http://www.*-*-*.com/ %7eBrownsta/
My reply address is correct as is. The courtesy of providing a correct
reply address is more important to me than time spent deleting spam.
--



Sat, 06 Jan 2001 03:00:00 GMT  
 duplicate symbol table entries in libc.a

Quote:

> /home/jharlan> nm /lib/libc.a | grep "^mkdir "
> mkdir                U          -
> mkdir                d     268448       4
> /home/jharlan> nm /lib/libc.a | grep "^umask "
> umask                U          -
> umask                d     268444       4
> /home/jharlan>

> this seems to be telling me that the same symbol is both
> defined and undefined at the same time?

UNIX files whose names end in '.a' are almost always 'archive'
files.  Look up the 'ar' command.  Most operating systems have
something similar, a way to package a collection of files as a
single file.  (MVS, VMS, DOS, all have something similar.)
You can keep source files in them, but what people usually keep
in them is compiled-linkable (.o, .OBJ) files.  The full output
of 'nm' shows you the names of the subfiles, but your 'grep'
command has hidden those lines from you.

What nm is telling you here is the completely unsurprising fact
that *one* subfile defines umask and another refers to it, and
*one* subfile defines umask and another refers to it.

On the Solaris 2.5.something system I use, nm /usr/lib/libc.a
tells me that mkdir is defined in
        /usr/lib/libc.a[mkdir.o]
compiled from mkdir.s, and that umask is defined in
   /usr/lib/libc.a[umask.o]
compiled from umask.s and referenced in
   /usr/lib/libc.a[tmpfile.o]
compiled from tmpfile.c

A simple way to check what I've said would be to change your
first command to
   nm /lib/libc.a | egrep '^(/|mkdir)'
and then you'd see all the subfile entries and the lines you
already have.
--



Mon, 15 Jan 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. NULL table entries to terminate tables

2. LIBC.lib(crt0.obj) : error LNK2001: unresolved external symbol _main

3. exporting duplicate symbols

4. Turbo C 3.0, duplicated symbols when linking

5. Template Expansions produce duplicate symbol errors in Linker

6. duplicate 'new' symbols

7. Duplicate symbols when linking

8. Duplicate Resource Symbols

9. duplicate resource symbols in vc5

10. Add entry to the ROUTING table

11. Adding new entries to an Access table

12. Only one tooltip shows, though entries are in String Table

 

 
Powered by phpBB® Forum Software