section lma overlaps previous sections
大家好!最近因为某种原因,换了交叉编译工具链,以前是3.4.3,现在是4.2.3。同样的源码,在编译应用程序模块时部分模块出现了类似如下的错误信息。
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .interp lma 0x4000f4 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .reginfo lma 0x400108 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .dynamic lma 0x400120 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .hash lma 0x400200 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .dynsym lma 0x400c28 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .dynstr lma 0x402438 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .rel.dyn lma 0x403460 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .init lma 0x403488 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .text lma 0x403510 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .MIPS.stubs lma 0x42f2e0 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .fini lma 0x42f9a0 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .rodata lma 0x42fa00 overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section .eh_frame lma 0x435e9c overlaps previous sections
BFD: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: section `.rodata' can't be allocated in segment 3
/opt/toolchains/uclibc-crosstools-gcc-4.2.3-3/usr/bin/mips-linux-uclibc-strip: /home/***/HG553V100R001/targets/fs.src/bin/stALGP14: Bad value
我上网查了一下,是
segment太大,覆盖了后面的segment。好像可以通过linker script来解决这个问题。
但我不知道怎么去修改linker script,来改变segment,请问有谁可以告诉我,怎么改,或者到哪里去改吗?
或者告诉我应该怎么去解决这个问题的思路也可以。好像也有人说可以通过设置工具链的编译选项来改变应用程序的大小和segment,但看了很多。
我还是不太明确到底怎么去解决这个问题。求救啊 这么多溢出啊。这个,先readelf看看各个section的情况。 怎么看
我是linux环境下面编译的 能不能细细说说。谢谢了。 本帖最后由 heixia108 于 2010-06-19 22:53 编辑
make clean 以后,重新编译还会出现这个问题吗?
关于 Linker Scripts , http://sourceware.org/binutils/docs/ld/上面有介绍,不知道对你有没有用 stALGP14是个可执行程序么?
$ readelf -h stALGP14
下一步,我也不是很清楚该如何。 我想应该是链接脚本的问题吧 你试着make clean之后重新编译一下试试
页:
[1]