I have a unique bootloader that has a GUI and offers up several flash bin images to install and run. The bin images have the trampoline that gets trimmed off when installed. That part works OK. The bootloader has some empty space at the end, that I want to put some permanent crypto code into, that is accessed from both bootloader and regular program.
The regular program therefore needs to link a section below the program_start_address. The trouble is my asm skills are not good enough. How to do this below please?
// This must be linked @ 0x80000000 if it is to be run upon reset.
.section .reset, "ax", @progbits
.type _trampoline, @function
// Jump to program start.
<< insert section here at 24K >>
.org PROGRAM_START_OFFSET // 32K
// Jump to the C runtime startup routine.
lda.w pc, _stext