頗有趣,在一些場合也頗有用的東西,昨天從老張那裏淘來了。
test.cspa
#include <stdio.h> #include <stdlib.h>
extern char * _binary_test_c_start; int main() { printf("%s", (char *)&_binary_test_c_start); } code
|
Makefile對象
SRC = test.c TAR = t ALL:test.c objcopy -I binary -O elf32-i386 -B i386 test.c test.bin gcc -o t test.c test.bin ci
|
objcopy很方便的能夠把文本文件作成能夠鏈接器能夠鏈接的對象,進而鏈進可執行程序裏面。io