📄 readme
字号:
sstrip is a small utility that removes the contents at the end of anELF file that are not part of the program's memory image.Most ELF executables are built with both a program header table and asection header table. However, only the former is required in orderfor the OS to load, link and execute a program. sstrip attempts toextract the ELF header, the program header table, and its contents,leaving everything else in the bit bucket. It can only remove parts ofthe file that occur at the end, after the parts to be saved. However,this almost always includes the section header table, and occasionallya few random sections that are not used when running a program.It should be noted that the GNU bfd library is (understandably)dependent on the section header table as an index to the file'scontents. Thus, an executable file that has no section header tablecannot be used with gdb, objdump, or any other program based upon thebfd library, at all. In fact, the program will not even recognize thefile as a valid executable. (This limitation is noted in the sourcecode comments for bfd, and is marked "FIXME", so this may change atsome future date. However, I would imagine that it is a prettylow-priority item, as executables without a section header table arerare in the extreme.) This probably also explains why strip doesn'toffer the option to do this.Shared library files may also have their section header table removed.Such a library will still function; however, it will no longer bepossible for a compiler to link a new program against it.As an added bonus, sstrip also tries to removes trailing zero bytesfrom the end of the file. (This normally cannot be done with anexecutable that has a section header table.)sstrip is a very simplistic program. It depends upon the commonpractice of putting the parts of the file that contribute to thememory image at the front, and the remaining material at the end. Thispermits it to discard the latter material without affecting fileoffsets and memory addresses in what remains. Of course, the ELFstandard permits files to be organized in almost any order, so if apathological linker decided to put its section headers at the top,sstrip would be useless on such executables.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -