首页
社区
课程
招聘
[求助]multiple ".text" sections found with different attributes问题
发表于: 2008-1-3 14:22 6694

[求助]multiple ".text" sections found with different attributes问题

2008-1-3 14:22
6694
为了减小程序体积,加入了这些东西:
#pragma comment(linker, "/ENTRY:EntryPoint")
#pragma comment(linker,"/merge:.data=.text")
#pragma comment(linker,"/merge:.rdata=.text")
#pragma comment(linker,"/ALIGN:0x200")

编译时会提示下面警告信息,
LINK : warning LNK4078: multiple ".text" sections found with different attribute
s (C0000040)
LINK : warning LNK4078: multiple ".text" sections found with different attribute
s (40000040)

如果不使用全局变量,这个程序可以正常执行,但是当使用全局变量,对全局变量赋值时,就会报错。必须把上面的#pragma去掉才能正常执行。

我想可能是代码页禁止写入的问题。如何设定#pragma才能避免上述错误?
正常使用全局变量。

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回

账号登录
验证码登录

忘记密码?
没有账号?立即免费注册