Chinaunix首页 | 论坛 | 博客
  • 博客访问: 460739
  • 博文数量: 280
  • 博客积分: 337
  • 博客等级: 二等列兵
  • 技术积分: 1957
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-17 21:36
文章分类

全部博文(280)

文章存档

2017年(13)

2016年(38)

2015年(78)

2014年(67)

2013年(70)

2012年(14)

分类: C/C++

2017-07-09 17:47:35

 

很有趣,在一些场合也很有用的东西,昨天从老张那里淘来了。

test.c

#include <stdio.h>
#include <stdlib.h>

extern char * _binary_test_c_start;
int main()
{
        printf("%s", (char *)&_binary_test_c_start);
}

 

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

 

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

阅读(736) | 评论(0) | 转发(0) |
0

上一篇:linux下syslog使用说明

下一篇:没有了

给主人留下些什么吧!~~