How do I check a .a file for multiply defined symbols?

How do I check a .a file for multiply defined symbols?

Post by Matthew Rabuz » Sun, 10 May 1992 02:32:32




writes:
    > Much of what I do is a set of source files scattered over many
    > directories, all of which give one .a library.  I have sometimes had
    > trouble because the same symbol was being used by more than one source
    > file.  It is a very * kind of bug to track down, too.
    >
    > Is there a better way in which I can do this?  What is the
    > organisation of __.SYMDEF?
    >

Use:
    nm theLibrary.a > tmp.nm # See nm(1).
    egrep -v "^  *U" tmp.nm | # Remove undefined references, leaving only the
    sort -t" " -f2 |          # defined symbols.
    uniq -d                     # Show duplicated defined symbols.
Then for each duplicate symbol output by the pipe,
look in the tmp.nm file to see what .o files define it.

 
 
 

1. How do I check a .a file for multiply defined symbols?

Much of what I do is a set of source files scattered over many
directories, all of which give one .a library.  I have sometimes had
trouble because the same symbol was being used by more than one source
file.  It is a very nasty kind of bug to track down, too.

Is there a better way in which I can do this?  What is the
organisation of __.SYMDEF?

        -ans.
--


2. Solaris X86 INstall Locking Up

3. ld: fatal error : symbols multiply-defined

4. Sound recording

5. solaris,apache,mod_perl,php: Make bombs symbol `Error' is multiply defined

6. ok...

7. Multiply defined symbols while linking with Workshop 6 ...

8. Netscape4.03 and Motif libraries

9. multiply defined symbols with -Bstatic, not with -Bdynamic

10. ld: fatal: symbol `_init' is multiply defined???

11. ld: multiply defined symbol

12. chasing down multiply-defined symbols

13. Reg multiply defined data symbols