I've just started learning some ARM programming and I've got stuck in a slightly annoying problem. The toolchain I'm using to compile my sources is Sourcery CodeBench Lite 2013.05-23 (can be found here: https://sourcery.mentor.com/GNUToolchain/release2449)
What I would need is to tell GCC or LD or OBJCOPY to put the compiled bytecode of the 'main' function at the beginning of the .text section.
Is there any way to achieve this? (maybe through a linker script?)
Thank you
Solved the problem. For whoever faces it:
Secondly, use a linker script to order these "function-sections" into the final big .text section. As an example, putting the main function at the beginning of the .text section would result in an LD script that looks approximately like this:
ENTRY(main)
SECTIONS
{
.text :
{
*(.text.main);
*(.text*);
}
}