#include
// VC6 版本
#pragma comment(linker, "/SECTION:.text,RWS") // 创建自定义的 shared Section
#pragma data_seg(".text")
int g_iShared = 0x37;
#pragma data_seg()
// int g_iShared __attribute__ ((section(".text"))) = 0x37; // GCC 版本
// int g_iShared = 0x37;
int main()
{
g_iShared = 200;
int iLocal = 300;
printf("%d,0x%p\n",g_iShared,&g_iShared);
printf("%d,0x%p\n",iLocal,&iLocal);
return 0;
}
阅读(1163) | 评论(0) | 转发(0) |