使用vsnprintf后链接错误及解决方法

/home/merlin/swinstall/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin/../lib/gcc/arm-none-eabi/4.8.1/../../../../arm-none-eabi/bin/ld: section .ARM.exidx loaded at [0801314c,08013153] overlaps section .data loaded at [0801314c,080137f3]

错误提示如上所示。这里看到.ARM.exidx与.data段已经重叠了。。。

这个逗逼摊上和我一样的事了!http://stackoverflow.com/questions/21527256/when-is-arm-exidx-is-used

还有一些参考资料(大多是说链接文件出的问题,需要加上.ARM.exidx这个段):

http://sourcery.mentor.com/archives/arm-gnu/msg02743.html

http://sourcery.mentor.com/archives/arm-gnu/msg02673.html

http://forum.stellarisiti.com/topic/512-newlib-problems-with-printf/

看看这个.ARM.exidx是啥东西

4.4.1 Sections
An object producer must generate:
* One fragment of index table for each code section.
* One exception-handling table entry corresponding to each function that may need to be unwound.

Each fragment of index table (read-only data) must be generated in its own ELF section. It must contain an index entry for each non-leaf function in the associated code section, in the same order as that of the functions in the code section. The index table section name must be .ARM.exidx optionally followed by further characters. The section type must be SHT_ARM_EXIDX (see [AAELF]). It must have the SHF_LINK_ORDER flag set in the sh_flags field of its section header and be linked to its associated code section via the sh_link field of its section header.

An object producer may generate exception-handling table entries (read-only data) in one ELF section, or one section per function. The name of a section containing an exception table fragment must be .ARM.extab optionally followed by further characters. The section type must be  HT_PROGBITS.

Note Tables are not required for ABI compliance at the C/Assembler level but are required for C++.

 截取自:Exception Handling ABI for the ARM® Architecture (ARM IHI 0038A)

 另外,ABI还定义了其它一些特殊段(来自ELF for the ARM® Architecture文件):

原文地址:https://www.cnblogs.com/tfanalysis/p/3652788.html