Closed yvt closed 2 years ago
Man that loop has all the bugs. Do you have a binary showing the problem we can add to those test cases?
And does this by any chance close https://github.com/jacobrosenthal/hf2-rs/issues/38 can we get @sinyo-matu to confirm if so?
Do you have a binary showing the problem we can add to those test cases?
The problem is exhibited by an example from my RTOS, but I think I can whip up a smaller test case.
And does this by any chance close #38 can we get @sinyo-matu to confirm if so?
No, it's unrelated.
I threw a commit on unifying the if statements that I think is an improvement.
Is this done? It tested a pygamer and it still works with this patch so seems ok
Yep, it's ready to merge.
Just as a datapoint: The linker script changes in cortex-m-rt
0.7 seem to reliably trigger this bug. Glad it's fixed!
This PR fixes a bug in the
elf_to_bin
function.When processing the
i
-th section (wherei > 0
),start[i] - (start[0] + len[i - 1])
zero bytes are inserted after that section. This doesn't make any sense and causes sections to be written at incorrect locations under certain circumstances.This PR updates the code so that
start[i] - (start[i - 1] + len[i - 1])
=start[i] - end[i - 1]
zero bytes are inserted before each section.