the linker script fragment
Code: Select all
SECTIONS
{
.text 0x0000F400 :
{
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(1024);
}
Code: Select all
extern "C"
{
void plugin_main (hubris::system::plugin::config_t* config,int index)
{
...
}
}
Code: Select all
00000000 55 push bp
00000001 89E5 mov bp,sp
00000003 81EC9801 sub sp,0x198
00000007 0000 add [bx+si],al
00000009 83EC0C sub sp,byte +0xc
...
Code: Select all
.text 0x000000000000f400 0x512 gen_pm_plugin.o
0x000000000000f400 plugin_main
Code: Select all
extern "C"
{
void plugin_main (hubris::system::plugin::config_t* config,int index)
{
...
header.programEntryForall
( []
(hubris::module::format::elf::ProgramEntry32* member) ->void
{
member->prepare();
}
);
}
}
Code: Select all
00000000 55 push bp
00000001 89E5 mov bp,sp
00000003 90 nop
00000004 5D pop bp
00000005 C3 ret
Code: Select all
.text 0x000000000000f400 0x79a gen_pm_plugin.o
0x000000000000f406 plugin_main
So the question is why the change given the linker script has not changed and yet the start location is moved inwards by the additional 6 bytes which are these mystery instructions.
I can work around the issue by jumping the 6 bytes but this is a fragile solution and I would like to understand why the additional instructions are appearing.