|
|
|
|
| gcc从2.95.3升级到3.4.5后有哪些需要主意的地方? |
 gcc从2.95.3升级到3.4.5后有哪些需要主意的地方? - tchaikovsky [ 2008-01-31 17:23 | 556 byte(s)]
 Re: gcc从2.95.3升级到3.4.5后有哪些需要主意的地方? - abutter [ 2008-04-08 10:11 | 50 byte(s)]
 Re: gcc从2.95.3升级到3.4.5后有哪些需要主意的地方? - EricFisher [ 2008-02-01 17:11 | 426 byte(s)]
 Re: gcc从2.95.3升级到3.4.5后有哪些需要主意的地方? - tchaikovsky [ 2008-02-28 11:04 | 30 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
我的平台是PowerPC405, 我的编译器从gcc2.95.3升级到3.4.5后,发现连接出来的elf文件有一些变化。其中显示初始化成0的静态全局变量从.data段搬移到了.bss段:
static int xxx = 0;
在2.95.3中,xxx被放在.data段,而在3.4.5中,xxx被放在.bss了。我猜这样的目的是为了减小可执行文件大小。它认为既然是被初始化成0,那就放bss里,让程序运行的时候初始化,而不需要放在.data段里占地方。
我针对这个问题修改后,发现还是有其他不对劲的地方。但是没查处哪里不对。
我不知道该版本的升级还会导致哪些其他的变化,有谁知道吗?
|
|
|
----
醉生梦死
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
还是直接去http://gcc.gnu.org/gcc-3.4/changes.html#3.4.5上查查吧。
确实之后的版本是将初始化成0的全局变量从.data段搬移到了.bss段
GCC 3.4 automatically places zero-initialized variables in the .bss section on some operating systems. Versions of GNU Emacs up to (and including) 21.3 will not work correctly when using this optimization; you can use -fno-zero-initialized-in-bss to disable it.
|
|
|
[Original]
[Print]
[Top]
|
|
|