我在Linux下创建微小的可执行文件。我注意到来自Muppetlabs.com的一个以前使用过的工具,名为ELFkickers集合中的sstrip(http://www.muppetlabs.com/~breadbox/software/elfkickers.html) 它从ELF可执行文件中剥离的单个字节数多于单独的单个字节。 似乎它是在Ubuntu的饲料,直到HardyHeron,但现在它没有踪影。 所以,我想自己编译,但ASM/elf.h中头似乎是一个新的位置和gcc捞出用:从ELFkickers编译Ubuntu10.04的sstrip:asm/elf.h问题
gcc -ggdb -Wall -W -o sstrip sstrip.c
sstrip.c:12:21: error: asm/elf.h: No such file or directory
sstrip.c: In function 'readelfheader':
sstrip.c:70: error: 'ELF_DATA' undeclared (first use in this function)
sstrip.c:70: error: (Each undeclared identifier is reported only once
sstrip.c:70: error: for each function it appears in.)
sstrip.c:72: error: 'ELF_CLASS' undeclared (first use in this function)
sstrip.c:77: error: 'ELF_ARCH' undeclared (first use in this function)
sstrip.c: In function 'getmemorysize':
sstrip.c:138: warning: assignment from incompatible pointer type
sstrip.c: In function 'modifyheaders':
sstrip.c:205: warning: assignment from incompatible pointer type
make: *** [sstrip] Error 1
关于如何解决此问题有什么建议?
还是有人知道在哪里可以找到PPA中的sstrip? 也许是另一种选择?
也许http://lxr.linux.no/linux+v2.6.38/arch/x86/include/asm/elf.h。 – 2011-05-12 21:16:41
错误可能并不意味着elf.h“处于新位置”,这可能意味着您需要*安装*它。尝试安装内核头文件。 – 2011-05-12 22:54:18
我确实安装了所有内核头文件,并指出编译器使用它们。但是,编译失败时会出现大量错误消息。 – Rock 2011-05-13 11:19:57