I am hoping that some one can help me understand why I am getting a link error of an undefined reference to "_fini" in function "__libc_fini_array"? I am using MCUXpresso v 10.1.1. with a K65 processor and hardware floating point.
c:/nxp/mcuxpressoide_10.1.1_606/ide/tools/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libc.a(lib_a-fini.o): In function `__libc_fini_array':
fini.c:(.text.__libc_fini_array+0x26): undefined reference to `_fini'
collect2.exe: error: ld returned 1 exit status
Thanks,
Elizabeth
Elizabeth,
are you using C++ code? Usually the .fini is for the C++ global constructors, see The .init and .fini Sections
Check your linker file if it has something like this:
KEEP (*(.init)) KEEP (*(.fini))
in it.
Erich
Erich,
No , I'm not using C++ code. I'm in the process of moving from the IAR IDE (eclipse version) to MCUXpresso. The project is a combination of my C code and copied code from KDS using SDK v1.3 and PE for the k65 processor (which seems to have fallen through the cracks with respect to PE and SDK v2). I am trying to start out using the managed linker script. I don't see any statements with KEEP (*(.fini)) in the .ld file.
Thanks,
Elizabeth
Hello Elizabeth Russell ,
Could you please share your project or a simple one that can reproduce the error, thanks.
BR
Alice