2013-03-01 95 views
0

我正在尝试为瑞萨RL78/G13系列MCU构建一个C++程序。我以前使用IAR工具链时没有问题,但现在我想使用GNU RL78工具链,因此我可以使用一些瑞萨库。RL78/G13链接C++应用程序:丢失符号

我的问题是,我现在无法获得程序链接,看起来是因为缺少符号。任何建议将非常感激。

下面是从连接器输出的控制台:

'Invoking: Linker' 
'Building target:' 
rl78-elf-ld -o "firmware_2.x" -T"C:\Projects\ms_monitor\firmware_2\HardwareDebug\firmware_2_HardwareDebug_auto.gsi" -T"C:\Projects\ms_monitor\firmware_2\HardwareDebug\LinkerSubCommand.tmp" libfirmware_2.a -M=firmware_2.map -e_PowerON_Reset -L"C:\Projects\ms_monitor\firmware_2\lib" -L"C:\Projects\ms_monitor\firmware_2\HardwareDebug" -L"C:\Renesas\e2studio\GNURL7~1.01-\rl78-elf\rl78-elf\lib" -L"C:\Renesas\e2studio\GNURL7~1.01-\rl78-elf\lib\gcc\rl78-elf\4.8-GNURL78_v13.01" --start-group -lstdc++ -lfirmware_2 -lgcc --end-group 
rl78-elf-ld: section .vects loaded at [00000004,0000007f] overlaps section .vec loaded at [00000000,00000005] 
libfirmware_2.a(gcrt0.o): In function `start': 
(.text+0x2): undefined reference to `_stack' 
libfirmware_2.a(gcrt0.o): In function `start': 
(.text+0x9): undefined reference to `_datastart' 
libfirmware_2.a(gcrt0.o): In function `start': 
(.text+0xc): undefined reference to `_romdatastart' 
libfirmware_2.a(gcrt0.o): In function `start': 
(.text+0x11): undefined reference to `_romdatacopysize' 
libfirmware_2.a(gcrt0.o): In function `start': 
(.text+0x29): undefined reference to `_bssstart' 
libfirmware_2.a(gcrt0.o): In function `start': 
(.text+0x31): undefined reference to `_bsssize' 
libfirmware_2.a(gcrt0.o): In function `start': 
(.text+0x4c): undefined reference to `etext' 
libfirmware_2.a(gcrt0.o): In function `start': 
(.text+0x65): undefined reference to `exit' 
libfirmware_2.a(gcrt0.o): In function `rl78_run_preinit_array': 
(.text+0x69): undefined reference to `_preinit_array_start' 
libfirmware_2.a(gcrt0.o): In function `rl78_run_preinit_array': 
(.text+0x6c): undefined reference to `_preinit_array_end' 
libfirmware_2.a(gcrt0.o): In function `rl78_run_init_array': 
(.text+0x74): undefined reference to `_init_array_start' 
libfirmware_2.a(gcrt0.o): In function `rl78_run_init_array': 
(.text+0x77): undefined reference to `_init_array_end' 
libfirmware_2.a(gcrt0.o): In function `rl78_run_fini_array': 
(.text+0x7f): undefined reference to `_fini_array_start' 
libfirmware_2.a(gcrt0.o): In function `rl78_run_fini_array': 
(.text+0x82): undefined reference to `_fini_array_end' 
./src/utilities/csv_loader.o: In function `CsvLoader_Create': 
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:75:(.text+0xe): relocation truncated to fit: R_RL78_DIR16S against `.LC0' 
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:75:(.text+0x18): relocation truncated to fit: R_RL78_DIR16S against `CsvLoader_Create::__PRETTY_FUNCTION__' 
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:75:(.text+0x1d): relocation truncated to fit: R_RL78_DIR16S against `.LC1' 
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:76:(.text+0x31): relocation truncated to fit: R_RL78_DIR16S against `.LC0' 
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:76:(.text+0x3b): relocation truncated to fit: R_RL78_DIR16S against `CsvLoader_Create::__PRETTY_FUNCTION__' 
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:76:(.text+0x40): relocation truncated to fit: R_RL78_DIR16S against `.LC2' 
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:77:(.text+0x56): relocation truncated to fit: R_RL78_DIR16S against `.LC0' 
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:77:(.text+0x60): relocation truncated to fit: R_RL78_DIR16S against `CsvLoader_Create::__PRETTY_FUNCTION__' 
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:77:(.text+0x65): relocation truncated to fit: R_RL78_DIR16S against `.LC3' 
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:78:(.text+0x79): relocation truncated to fit: R_RL78_DIR16S against `.LC0' 
C:\Projects\ms_monitor\firmware_2\HardwareDebug/../src/utilities/csv_loader.cpp:78:(.text+0x83): additional relocation overflows omitted from the output 
libfirmware_2.a(mcount.o): In function `_monstartup': 
(.text+0x67b): undefined reference to `ffs' 
libfirmware_2.a(printf.o): In function `_printf_r': 
(.text+0x30): undefined reference to `_vfprintf_r' 
libfirmware_2.a(printf.o): In function `printf': 
(.text+0x75): undefined reference to `_vfprintf_r' 
libfirmware_2.a(snprintf.o): In function `_snprintf_r': 
(.text+0x8d): undefined reference to `_svfprintf_r' 
libfirmware_2.a(snprintf.o): In function `snprintf': 
(.text+0x165): undefined reference to `_svfprintf_r' 
libfirmware_2.a(sprintf.o): In function `_sprintf_r': 
(.text+0x4f): undefined reference to `_svfprintf_r' 
libfirmware_2.a(sprintf.o): In function `sprintf': 
(.text+0xbf): undefined reference to `_svfprintf_r' 
libfirmware_2.a(vfiprintf.o): In function `_vfiprintf_r': 
(.text+0x1bed): undefined reference to `_free_r' 
libfirmware_2.a(vfiprintf.o): In function `_vfiprintf_r': 
(.text+0x1c83): undefined reference to `_free_r' 
libfirmware_2.a(wsetup.o): In function `__swsetup_r': 
(.text+0xf8): undefined reference to `_free_r' 
libfirmware_2.a(calloc.o): In function `calloc': 
(.text+0x16): undefined reference to `_calloc_r' 
libfirmware_2.a(fflush.o): In function `__sflush_r': 
(.text+0x324): undefined reference to `_free_r' 
libfirmware_2.a(findfp.o): In function `__sfmoreglue': 
(.text+0xf2): undefined reference to `_malloc_r' 
libfirmware_2.a(fvwrite.o): In function `__sfvwrite_r': 
(.text+0x25e): undefined reference to `_malloc_r' 
libfirmware_2.a(fvwrite.o): In function `__sfvwrite_r': 
(.text+0x2de): undefined reference to `_realloc_r' 
libfirmware_2.a(fvwrite.o): In function `__sfvwrite_r': 
(.text+0x2ff): undefined reference to `_free_r' 
libfirmware_2.a(makebuf.o): In function `__smakebuf_r': 
(.text+0x1a2): undefined reference to `_malloc_r' 
libfirmware_2.a(malloc.o): In function `malloc': 
(.text+0x10): undefined reference to `_malloc_r' 
libfirmware_2.a(malloc.o): In function `free': 
(.text+0x26): undefined reference to `_free_r' 
libfirmware_2.a(reent.o): In function `cleanup_glue': 
(.text+0x3c): undefined reference to `_free_r' 
libfirmware_2.a(reent.o): In function `_reclaim_reent': 
(.text+0xb1): undefined reference to `_free_r' 
libfirmware_2.a(reent.o): In function `_reclaim_reent': 
(.text+0xe6): undefined reference to `_free_r' 
libfirmware_2.a(reent.o): In function `_reclaim_reent': 
(.text+0x111): undefined reference to `_free_r' 
libfirmware_2.a(reent.o):(.text+0x172): more undefined references to `_free_r' follow 
C:\Projects\ms_monitor\firmware_2\HardwareDebug\libfirmware_2.a(realloc.o): In function `realloc': 
(.text+0x16): undefined reference to `_realloc_r' 
make: *** [firmware_2.x] Error 1 
+0

您可以通过运行'nm $ LIBNAME | fgrep $ SYMBOL'在你所有的库上。 – 2013-03-01 15:48:45

+0

我在Windows上运行,所以我不能使用'grep'。即使我要执行这个命令,那么这会给我什么启示,我将如何前进?我更加困惑的事实是,这些似乎是像“malloc”和“printf”这样的“systemy”函数? – 2013-03-01 16:43:52

+0

当然可以,可以使用U ** x工具的几种实现。安装cygwin和grep。如果您在某个库中找到这些符号,则可以将该库传递给链接器。 – 2013-03-01 17:00:45

回答

0

这个问题是从KPIT GNU球队很大的支持后回答。

我有我正在尝试编译的处理器的不正确的链接器文件(如在链接器文件是正确的,但其内容不是)。不仅如此,一些缺失的符号取决于工作空间的配置方式。

如果你自己看到这个问题,第一步是联系KPIT GNU,因为我不知道文件有问题而不询问它们。