_binary_test_c_start

test.c

 

 

  1. #include <stdio.h>  
  2. #include <stdlib.h>  
  3.   
  4. extern char * _binary_test_c_start;  
  5. int main()  
  6. {  
  7.         printf("%s", (char *)&_binary_test_c_start);  
  8. }  

 

 

Makefile

 

 

  1. ALL:test.c  
  2.         objcopy -I binary -O elf32-i386 -B i386 test.c test.bin  
  3.         gcc -o t test.c test.bin  

 

objcopy很方便的可以把文本文件做成可以连接器可以连接的对象,进而链进可执行程序里面。

posted on 2011-11-09 17:47  lightsalt2011  阅读(316)  评论(0编辑  收藏  举报

导航