Add support for encrypting elfs with section holes within segments #150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While looking at raspberrypi/pico-examples#558 I've discovered that no_flash binaries can end up with a 4 byte gap between the
.text
and.rodata
sections in the ELF file. This creates a gap between sections in the ELF file, within a single segment.This PR adds support to
picotool encrypt
for these binaries - without this patch there would be a word of 0s written to the ELF file between the.text
and.rodata
sections, rather than the encrypted 0s for that word.@kilograham Is this also a bug in the SDK linker scripts, as they contain
. = ALIGN(4);
, but the actual alignment of the.text
and.rodata
sections in the ELF files produced is 8 bytes? This seems to be what's causing the holey ELF files, and can be prevented with this diff to extend the.text
section up to the.rodata
section.