I'm using the 20-bit development version of mspgcc and am blocked by a
linker error: "dangerous relocation: unaligned address":

make test.elf
msp430-gcc -I/usr/local/msp430/include -std=c99 -Wall -Os -g
-mmcu=msp430f5528 -mmemory-model=large -ffunction-sections -fdata-sections
-Ibuild -c file.c -o build/obj/file.o
msp430-gcc -mmcu=msp430f5528 -mmemory-model=large -Wl,-gc-sections <… many
.o files…> -o build/test.elf
build/obj/file.o: In function `sm_packet_handler':
/Users/andy/code/.../file.c:1569:(.any.text.sm_packet_handler+0x4ac):
dangerous relocation: unaligned address
collect2: error: ld returned 1 exit status
make: *** [test.elf] Error 1

I have no clue as to what's going on, or what I can do to fix it. The
function that appears to be generating the error is fairly large with a
number of nested switch statements. But I'm not sure if sm_packet_handler
is at fault, or whether a symbol it references is causing the problem.

One thing I noticed in dumping the .o file is that sm_packet_handler is
using two different ".rodata" sections:

$ msp430-objdump -h build/obj/file.o | grep sm_packet_handler
 17 .any.rodata.sm_packet_handler 00000011  00000000  00000000  0000096c
 2**0
 18 .any.text.sm_packet_handler 00000d94  00000000  00000000  0000097e  2**1
 19 .rodata.sm_packet_handler 00000154  00000000  00000000  00001714  2**2

Is that relevant at all? Has anyone else run into this error message?
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to