-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fix fixed flash address calculation (alternative version) #49
Conversation
We want to use the address of the first section in the segment, regardless of its name.
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 think this looks good. I tried to reason through any scenario where not filtering for the .start section would be a problem and could not think of one. I assume that if a segment is an executable segment, all sections in it should be executable?
I don't even understand what
and for arm:
|
#39 was written under the assumption that libtock-c used the same section name to store the entry point as libtock-rs does |
We should fix this bug, is this fix ok? |
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.
#39 was written under the assumption that libtock-c used the same section name to store the entry point as libtock-rs does
With that reasoning, I'm sufficiently convinced that this fix is obviously a strict improvement over what we have upstream now, probably not breaking libtock-rs
apps and better than #48. I will not say that this might not break on some other binaries which rely on diverging layouts.
If you know anyone who wants to do some really tedious coding, I think the only real fix is to actually properly parse ELF files, instead of using the ad-hoc methods we have currently. |
I think let's merge this |
We want to use the address of the first section in the segment, regardless of its name.
Rather than looking for
.start
, we just look for whatever the first section is in the segment as use that address, not the segment address.