Why ld strips debug info when combining many static libraries into one dynamic one?

Yuri yuri@rawbw.com
Sat May 8 01:03:00 GMT 2010


I am running the command line (below).
All .a libraries supplied have debug info.
Resulting .so library doesn't.

man page says: use --strip-debug to omit debudgger symbol information.
This option isn't in the command line.

Why debugging information is stripped?

GNU ld version 2.15 [FreeBSD] 2004-05-23

Yuri


--- command line ---
/usr/bin/ld --eh-frame-hdr -Bshareable -o 
/tmp/llvm-build/2.7/llvm-objects/Debug/lib/libLLVM-2.7.so 
/usr/lib/crti.o 
/usr/local/gcc/4.5.0/lib/gcc/i386-unknown-freebsd8.0/4.5.0/crtbeginS.o 
-L/usr/local/lib -L/tmp/llvm-build/2.7/llvm-objects/Debug/lib 
-L/tmp/llvm-build/2.7/llvm-objects/Debug/lib 
-L/usr/local/gcc/4.5.0/lib/gcc/i386-unknown-freebsd8.0/4.5.0 
-L/usr/local/gcc/4.5.0/lib/gcc/i386-unknown-freebsd8.0/4.5.0/../../.. -R 
/tmp/llvm-build/2.7/llvm-objects/Debug/lib --whole-archive 
--library=LLVMARMAsmParser --library=LLVMARMAsmPrinter 
--library=LLVMARMCodeGen --library=LLVMARMInfo 
--library=LLVMAlphaAsmPrinter --library=LLVMAlphaCodeGen 
--library=LLVMAlphaInfo --library=LLVMAnalysis --library=LLVMArchive 
--library=LLVMAsmParser --library=LLVMAsmPrinter --library=LLVMBitReader 
--library=LLVMBitWriter --library=LLVMBlackfinAsmPrinter 
--library=LLVMBlackfinCodeGen --library=LLVMBlackfinInfo 
--library=LLVMCBackend --library=LLVMCBackendInfo 
--library=LLVMCellSPUAsmPrinter --library=LLVMCellSPUCodeGen 
--library=LLVMCellSPUInfo --library=LLVMCodeGen --library=LLVMCore 
--library=LLVMCppBackend --library=LLVMCppBackendInfo 
--library=LLVMExecutionEngine --library=LLVMInstCombine 
--library=LLVMInstrumentation --library=LLVMInterpreter 
--library=LLVMJIT --library=LLVMLinker --library=LLVMMBlazeAsmPrinter 
--library=LLVMMBlazeCodeGen --library=LLVMMBlazeInfo --library=LLVMMC 
--library=LLVMMCParser --library=LLVMMSIL --library=LLVMMSILInfo 
--library=LLVMMSP430AsmPrinter --library=LLVMMSP430CodeGen 
--library=LLVMMSP430Info --library=LLVMMipsAsmPrinter 
--library=LLVMMipsCodeGen --library=LLVMMipsInfo 
--library=LLVMPIC16AsmPrinter --library=LLVMPIC16CodeGen 
--library=LLVMPIC16Info --library=LLVMPowerPCAsmPrinter 
--library=LLVMPowerPCCodeGen --library=LLVMPowerPCInfo 
--library=LLVMScalarOpts --library=LLVMSelectionDAG 
--library=LLVMSparcAsmPrinter --library=LLVMSparcCodeGen 
--library=LLVMSparcInfo --library=LLVMSupport --library=LLVMSystem 
--library=LLVMSystemZAsmPrinter --library=LLVMSystemZCodeGen 
--library=LLVMSystemZInfo --library=LLVMTarget 
--library=LLVMTransformUtils --library=LLVMX86AsmParser 
--library=LLVMX86AsmPrinter --library=LLVMX86CodeGen 
--library=LLVMX86Disassembler --library=LLVMX86Info 
--library=LLVMXCoreAsmPrinter --library=LLVMXCoreCodeGen 
--library=LLVMXCoreInfo --library=LLVMipa --library=LLVMipo 
--library=LLVMpic16passes --no-whole-archive --no-undefined 
--library=pthread --library=ffi --library=stdc++ --library=m --library=c 
--library=gcc_s --library=gcc_s 
/usr/local/gcc/4.5.0/lib/gcc/i386-unknown-freebsd8.0/4.5.0/crtendS.o 
/usr/lib/crtn.o



More information about the Binutils mailing list