-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an entry point when signing Arm images #163
Conversation
main.cpp
Outdated
std::shared_ptr<entry_point_item> entry_point = new_block.get_item<entry_point_item>(); | ||
if (entry_point == nullptr) { | ||
std::shared_ptr<vector_table_item> vtor = new_block.get_item<vector_table_item>(); | ||
uint32_t vtor_loc = elf->header().entry < SRAM_START ? 0x10000000 : 0x20000000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to check for XIP_SRAM-only binaries here? I forget if they can be signed (i believe so)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added support for this - although I'm not sure if we support XIP_SRAM binaries without a vector_table_item?
new_block.items.push_back(entry_point); | ||
} | ||
} | ||
|
||
hash_andor_sign( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reads the entry point and stack pointer from the vector table Assumes vector table is at 0x10000000 unless a vector_table metadata item is present
Reads the entry point and stack pointer from the vector table, and adds them to the image_def as a new entry_point item. This is only done for signing Arm executable images.
This assumes that the vector table is at 0x10000000 unless a vector_table metadata item is present, which the SDK adds for no_flash binaries, so it should work with all SDK binaries.