ld - linker
摘要:【ld - linker】NAME ld -- linkerSYNOPSIS ld files... [options] [-o outputfile]DESCRIPTION The ld command combines several object files and libraries, resolves references, and produces an ouput file. ld can produce a final linked image (executable, dylib, or bundle), or with the -r option, produce...
阅读全文
Symbol Table
摘要:【Symbol Table】 In order for GDB to be useful to us, it needs to be able to refer to variable and function names, not their addresses. Humans use names likemain()ori. Computers use addresses like0x804b64dor0xbffff784. To that end, we can compile code with "debugging information" which tells
阅读全文
-g vs -rdynamic
摘要:【-g vs -rdynamic】-g选项与-rdynamic选项的差别:1,-g选项新添加的是调试信息(一系列.debug_xxx段),被相关调试工具,比如gdb使用,可以被strip掉。2,-rdynamic选项新添加的是动态连接符号信息,用于动态连接功能,比如dlopen()系列函数、backtrace()系列函数使用,不能被strip掉,即强制strip将导致程序无法执行。添加-rdynamic选项后,.dynsym表就包含了所有的符号。backtrace就通过.dynsym来查找符号。参考:http://lenky.info/archives/2013/01/13/2190
阅读全文
符号表分离
摘要:【符号表分离】 gcc编译环境下,debug & release的区别主要在于-g选项,当指定-g后会生成大量调试信息。此时可通过objcopy把调试符号剥离。参考:http://blog.csdn.net/cyteven/article/details/13015511
阅读全文
invoking gdb
摘要:【invoking gdb】The most usual way to startgdbis with one argument, specifying an executable program: gdb programYou can also start with both an executable program and a core file specified: gdb program coreYou can, instead, specify a process ID as a second argument, if you want to debug a run...
阅读全文