How to make seperate debuginfo file
2017-10-25 00:00
288 查看
Some versions of Linux allow you to place debugging information in a separate file. These files, which can have any name, are called gnu_debuglink files. Because this information is stripped from the program's file, it almost always greatly reduces the size of your program. In most cases, you would create gnu_debuglink files for system libraries or other programs for which it is inappropriate to ship versions have debugging information.
you create an unstripped executable or shared library, you can prepare the gnu_debuglink file. Here's an overview:
The following example creates the gnu_debuglink file for a program named hello. It also strips the debugging information from hello:
objcopy --only-keep-debug hello hello.gnu_debuglink.debug
objcopy --strip-all hello hello.gnu_debuglink
objcopy --add-gnu-debuglink=hello.gnu_debuglink.debug \
you create an unstripped executable or shared library, you can prepare the gnu_debuglink file. Here's an overview:
Create a .debug copy of the file. This second file will only contain debugging symbol table information. That is, it differs from the original in that it does not contain code or data. Create this file on Linux systems that support the --add-gnu-debuglink and --only-keep-debug command-line options. If objcopy -- -help mentions --add-gnu-debuglink, you should be able to create this file. See man objcopy for more details. Create a stripped copy of the image file, and add a .gnu_debuglink section to the stripped file that contains the name of the .debug file and the checksum of the .debug file. Distribute the stripped image and .debug files separately. The idea is that the stripped image file will normally take up less space on the disk, and if you want the debug information, you can also install the corresponding .debug file.
The following example creates the gnu_debuglink file for a program named hello. It also strips the debugging information from hello:
objcopy --only-keep-debug hello hello.gnu_debuglink.debug
objcopy --strip-all hello hello.gnu_debuglink
objcopy --add-gnu-debuglink=hello.gnu_debuglink.debug \
hello.gnu_debuglink
相关文章推荐
- How to generate an AP debug log file
- c# how to make app use a specified configure file
- JDev: How to make JDev run ant script in debug mode permanently
- How to make a direct download link to a static file
- How to Make an Exe File
- how to convert a object to json file immediately during debug?
- C++ debug "cannot find the file Debug\***.pch" & how to debug multi-projects under one solution
- How to generate an AP debug log file
- How To Debug Qmake Pro File
- How to make a KML/KMZ file in Google Earth?
- How to make Universal Static library (.a file) in iOs using xCode
- How to generate an GL debug log file
- How to generate core dump file and debug with it?
- How To Get Application Path,And How To Get The Path's Directory,File Name,And Type Info(如何得到运行程序的路径,以及如何得到路径的文件夹,文件名,以及类型等等信息)
- how to make a JAR file
- Linux-Makefile(how to convert .out file to make .bin .elf, .hex file format)
- How to create SVAs in a seperate file
- How to unlock xcode file to make edits from different computers?
- How to Create a Debug File in Shipping Execution [ID 290432.1]
- Make sure the Makefile and distinfo file(/usr/ports/graphics/jpeg/distinfo) are up to date