GreenHills - 小数据区溢出 [英] GreenHills - small data area overflow

查看:1052
本文介绍了GreenHills - 小数据区溢出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人可以快速回答这个问题,但是基本上当我打开优化时,我会收到以下错误:


[elxr](错误)小数据区
overflow:0xfff9f6fc(signed)没有
适合16位,同时在文件test_main.o
中执行
重定位位置__sti___13_test_main_cpp_252229d3 + 0xc,引用符号oe_init_intconn


当我放入此链接器指令时也会出现类似的错误:


-auto_sda


他们的手册没有提到这个链接器错误。我正在使用Integrity 5.10

解决方案

此链接器错误通常 -Olink 优化 -auto_sda 。链接器看到您的整个程序,并将尽量不要通过autoSDAizing超过64K的数据来解决这个问题。 (它可能仍然是一个链接器错误,但是这不太可能)。



通常会发生此错误,因为某些不是作为链接器在连接器甚至有机会去之前,已将<64>多个64K字节放入SDA部分。不了解的个人可能是你,如果你做了这样的事情,你可以这样做:

  #pragma startsda 
int small_data [10000]; // 40Kbytes
int small_data_also [10000]; //另一个40K字节
#pragma endsda

(可能分割在多个文件中;实际上我如果您尝试在单个文件中创建超过64K的SDA,则会认为您将获得编译器或汇编程序诊断程序。)



但是,不了解的个人也可能是编译器如果你传递了一些选项,例如 -sda = 4 (这就像你抛出一个 #pragma startsda 围绕整个文件中4个字节或更小的每个全局变量),并且您拥有大量的全局变量。编译器将愉快地在20个单独的文件中的每个文件中SDAize 10,000个字节,然后链接器将抱怨您正在处理20万字节的SDA。 (链接器足够聪明,可将常规数据引用重写为SDA引用,但从未被教过如何在相反方向重写事物。)



最后,即使你认为您没有通过 -sda = ,您可能会感到惊讶。使用 - # -v 选项运行驱动程序。 IIRC, ccintppc 默认通过 -sda = 4 。你可以让司机停止帮助你只需通过 -sda = none -sda = 0 ,这应该覆盖驱动程序的默认值。您可能希望逐个传递此选项,从您的最冷的代码


I'm hoping maybe someone has a quick answer for this but essentially when I turn on optimizations, I get the following error:

[elxr] (error) small data area overflow: 0xfff9f6fc (signed) didn't fit in 16 bits while performing relocation in file test_main.o at location __sti___13_test_main_cpp_252229d3+0xc, to reference symbol oe_init_intconn

A similar error occurs when I put in this linker directive as well:

-auto_sda

Their manual doesn't make any mention of this linker error. I'm using Integrity 5.10

解决方案

This linker error is usually not related to the -Olink optimization -auto_sda. The linker sees your whole program and will try not to screw it up by autoSDAizing more than 64K of your data. (It might still be a linker bug, but that's unlikely.)

This error usually happens because someone who is not as perceptive as the linker has already put more than 64K bytes into SDA sections before the linker even gets a chance to have a go at it. The unperceptive individual might be you, if you did something like

#pragma startsda
int small_data[10000];  // 40Kbytes
int small_data_also[10000];  // another 40Kbytes
#pragma endsda

(possibly split across multiple files; in fact I think you'll get a compiler or assembler diagnostic if you try to create more than 64K of SDA in a single file).

But the unperceptive individual might also be the compiler, if you're passing options such as -sda=4 (which acts as if you threw a #pragma startsda around every global variable of 4 bytes or smaller in the entire file) and you have a ton of global variables. The compiler will happily SDAize 10,000 bytes in each of 20 individual files, and then the linker will complain that you're handing it 200,000 bytes of SDA. (The linker is smart enough to rewrite regular data references into SDA references, but has never been taught how to rewrite things in the opposite direction.)

Finally, even if you think you're not passing -sda=, you might be surprised. Run the driver with the -# or -v option. IIRC, ccintppc secretly passes -sda=4 by default. You can get the driver to stop "helping" you; just pass -sda=none or -sda=0, which should override the driver's default. You might want to pass this option on a file-by-file basis, starting with your coldest code.

这篇关于GreenHills - 小数据区溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆