Fixed addresses for function pointers
I am having trouble putting const function pointers into specific addresses for a trampoline design,. I ran out of code space and was moving tested functions into a second project to be loaded into SDRAM from the NAND flash. I have wrote a custom linker script. I am able to get the pointers into it however the code is packed and does not match the linker symbols. The chip used is a LPC1788 with 32M SDRAM and 32M NAND flash. I am using ver 2.1 of Crossworks.
Linker file:
SECTIONS {
.code_vectors 0xA0000000 : AT(0xA0000000)
{
KEEP(*(.code_vectors .code_vectors .*))
FILL(0xfacefeed)
sample_pointer1 = 0xa0000000;
sample_pointer2 = 0xa0000010;
sample_pointer3 = 0xa0000020;
} }
Output of map file:
.code_vectors
0xa0000000 0x754
*(.code_vectors .code_vectors .*)
.code_vectors
0xa0000000 0x754 THUMB Flash Release/Graphic_api.o
FILL mask 0xfacefeed
0xa0000000 sample_pointer1 = 0xa0000000
0xa0000010 sample_pointer2 = 0xa0000010
0xa0000020 sample_pointer3 = 0xa0000020
Here is the killer part, the output in the elf:
00000000: 99 bb 01 a0 29 bd 01 a0 81 bb 01 a0 00 00 00 00 ....)...........
00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
The linker packed them into output, instead of filling the spaces and is lying in the map file. How do I get linker not to do this and put them where I want them?
Please sign in to leave a comment.
Comments
0 comments