I have a common scenario: Some source files for an executable which depend on some standard libraries and some user libraries. All the user libraries are statically linked into the executable whereas the standard libraries are linked dynamically to it.
Problem: I believe that I have multiply defined symbols in my complete package (executable which already includes the user library code + shared standard libraries). The linker obviously has insight into it, but as I understand the linker won't complain unless it encounters multiple strong named symbols. My fear is that, while I am moving my code from solaris 8/sparc platform to solaris10/sparc platform, some standard unix functions have been implemented in the user libraries which are causing the app to crash at runtime. Note that the app runs fine in solaris 8/sparc platform
I have been facing weird issues which have led me to believe this might be the source
- Modifying one variable from one library is changing the value of another variable in another library
- Solaris 8-10: host2ip conversion problems
What I need:
Is there a way to easily list all multiply defined symbols?- Is there a way to easily list all multiply defined symbols stemming from user libraries?
- Do you guys think the issue #1 might be caused by linking issues, or you feel it might be a sign of some other issue?
Edit1: Since then I know that on generating map file using ld, it has a section of multiply defined symbol which I am going through to find names that look like standard library call. For people who do not know, the linker will only fail to link if it finds multiple symbols with the same name AND the names are strong names.