Hi Experts,
There was undefined reference to the snprintf() function during linking using arm-none-eabi compiler.
Compiler version: arm none-eabi gcc 4.5.1
Compiler options: -nostdlib -nodefaultlibs -nostartfiles -msoft-float -mfloat-abi=soft -Wformat -mthumb -mfix-cortexm3-ldrd
looks like an attempt at putting spam links in a post ?
your answer is unclear
Hi Joey,
Thanks for the update. I re-checked and it uses the following sequences in linker file which collides in order vs unordered linking. Also this happens specifically when I am trying to access functions like snprintf() and vsnprintf().
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } > FLASH __exidx_start = .; .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } > FLASH __exidx_end = .;
Likely due to linker script problem. Most of linker usage problem can be resolved by following the sample projects delivered with toolchain. To do so you can go to share/gcc-arm-none-eabi/samples, and follow the command line and linker script in projects there. Hopeful it helpful.
Hi Andy,
Removing -nostdlib has no effect. But removing -nodefaultlibs lead to link error as follows,
.text has both ordered [`.ARM.extab' in libgcc.a(_divdi3.o)] and unordered [`.ARM.exidx' in libgcc.a(_divdi3.o)] sections
techguyz said:There was undefined reference to the snprintf() function
Isn't that exactly what you'd expect with:
techguyz said:-nostdlib -nodefaultlibs
https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
View all questions in GNU Toolchain forum