【发布时间】:2020-05-04 20:39:45
【问题描述】:
我已经 git 克隆了最新的 contiki-master。现在我需要打印来自sicslowpan.c 的调试消息。如果#define DEBUG DEBUG_NONE 模拟有效,但如果我在sicslowpan.c 中设置#define DEBUG DEBUG_PRINT,即使hello-world.c 在天空微尘上也会出现以下错误。我没有接触任何其他文件。
我该如何摆脱这个错误?
/usr/local/msp430/bin/../lib/gcc/msp430/4.7.0/../../../../msp430/bin/ld: hello-world.sky section `.rodata' will not fit in region `rom'
/usr/local/msp430/bin/../lib/gcc/msp430/4.7.0/../../../../msp430/bin/ld: section .vectors loaded at [0000ffe0,0000ffff] overlaps section .rodata loaded at [0000f590,000100b0]
/usr/local/msp430/bin/../lib/gcc/msp430/4.7.0/../../../../msp430/bin/ld: region `rom' overflowed by 456 bytes
/usr/local/msp430/bin/../lib/gcc/msp430/4.7.0/mmpy-16/libcrt0.a(_copy_data.o): In function `__do_copy_data':
/home/user/building-mspgcc/gcc-4.7.0-msp430/msp430/mmpy-16/libgcc/../../../../gcc-4.7.0/libgcc/config/msp430/crt0.S:208:(.init4+0x12): relocation truncated to fit: R_MSP430_16_BYTE against symbol `__data_load_start' defined in *ABS* section in hello-world.sky
obj_sky/contiki-sky-main.o: In function `main':
/home/user/contiki/examples/hello-world/../../platform/sky/./contiki-sky-main.c:302:(.init9+0x176): relocation truncated to fit: R_MSP430_16 against symbol `contikimac_driver' defined in .rodata section in contiki-sky.a(contikimac.o)
/home/user/contiki/examples/hello-world/../../platform/sky/./contiki-sky-main.c:303:(.init9+0x17a): relocation truncated to fit: R_MSP430_16 against symbol `csma_driver' defined in .rodata section in contiki-sky.a(csma.o)
/home/user/contiki/examples/hello-world/../../platform/sky/./contiki-sky-main.c:304:(.init9+0x17e): relocation truncated to fit: R_MSP430_16 against symbol `nullsec_driver' defined in .rodata section in contiki-sky.a(nullsec.o)
/home/user/contiki/examples/hello-world/../../platform/sky/./contiki-sky-main.c:307:(.init9+0x186): relocation truncated to fit: R_MSP430_16 against symbol `contikimac_driver' defined in .rodata section in contiki-sky.a(contikimac.o)
/home/user/contiki/examples/hello-world/../../platform/sky/./contiki-sky-main.c:307:(.init9+0x1b4): relocation truncated to fit: R_MSP430_16 against symbol `contikimac_driver' defined in .rodata section in contiki-sky.a(contikimac.o)
/home/user/contiki/examples/hello-world/../../platform/sky/./contiki-sky-main.c:307:(.init9+0x1b8): relocation truncated to fit: R_MSP430_16 against symbol `csma_driver' defined in .rodata section in contiki-sky.a(csma.o)
/home/user/contiki/examples/hello-world/../../platform/sky/./contiki-sky-main.c:307:(.init9+0x1bc): relocation truncated to fit: R_MSP430_16 against symbol `nullsec_driver' defined in .rodata section in contiki-sky.a(nullsec.o)
contiki-sky.a(cc2420.o): In function `cc2420_init':
/home/user/contiki/examples/hello-world/../../dev/cc2420/cc2420.c:635:(.text.process_thread_cc2420_process+0x3c): relocation truncated to fit: R_MSP430_16 against symbol `contikimac_driver' defined in .rodata section in contiki-sky.a(contikimac.o)
Process returned error code 2
contiki-sky.a(sicslowpan.o): In function `sicslowpan_get_last_rssi':
/home/user/contiki/examples/hello-world/../../core/net/ipv6/sicslowpan.c:1797:(.text.send_packet+0x12): relocation truncated to fit: R_MSP430_16 against symbol `nullsec_driver' defined in .rodata section in contiki-sky.a(nullsec.o)
/home/user/contiki/examples/hello-world/../../core/net/ipv6/sicslowpan.c:1797:(.text.output+0x32): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
make: *** [hello-world.sky] Error 1
P.S:对于试图在没有说明原因的情况下结束问题的人,请理解问题不是too-broad 或primarily opinion-based。
【问题讨论】:
-
当您定义
#define DEBUG DEBUG_PRINT时,您启用了一些会增加代码大小的调试代码。我猜你没有这个空间。 -
获取更大的设备或删除您的代码。信息非常清楚!
-
@Jean-FrançoisFabre:在 contiki 2.7 中,我可以打印来自 sicslowpan.c 的调试消息,用于 C 源文件的大小大于 hello-world.c。
-
我真的明白这个错误的含义,因为我曾经问过这个问题stackoverflow.com/questions/42020249/…。