after stripping all debugging symbols in static lib, final link fails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tvnaidu
    Contributor
    • Oct 2009
    • 365

    after stripping all debugging symbols in static lib, final link fails

    creating execuable file in Linux by linking some static libraries (to link ibxyz.a, using -lxyz option). if I strip all symbols in static library (strip -s libxyz.a), then if try to link again, then I gets lot of "undefined reference", can't I do strip on static library using below command?

    strip -s xyz.a
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Erm if you strip all symbols using -s then there will be no symbols left in the library including all the functions you are expecting the linker to find.

    Comment

    • tvnaidu
      Contributor
      • Oct 2009
      • 365

      #3
      Looklike I ma using wrong one, I have to use -g option to remove debugging symbols.

      why -S option available, it is not useful at all?

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        It is eminently useful if you want to force a rebuild of your library from scratch.

        Comment

        • RRick
          Recognized Expert Contributor
          • Feb 2007
          • 463

          #5
          Typically, strip is used on a final product like an executable or program. This removes all symbolic information from prying eyes. It makes no sense to do this to a library (unless you really want to rebuild it, like Banfa suggested).

          -S might be the option you might want to use. It only removes debugging info.

          Comment

          • tvnaidu
            Contributor
            • Oct 2009
            • 365

            #6
            Thanks. Let me commant that "strip" command right now, let me enable only for final release, right now I just tried whether it is working or not, since my exeuatble file is almost 1.8 meg size, when I do strip on all static libraries, I got down file size to 800K, but currently let me disable strip command.

            Comment

            • tvnaidu
              Contributor
              • Oct 2009
              • 365

              #7
              but I have other thread, I have some issue with shared libs, I changed all to static libs, I created linux execuatble using -static option, somebody suggested not to use -static option at all, if I takeout that -static option, I can see segmentation fault.

              Comment

              Working...