-
Notifications
You must be signed in to change notification settings - Fork 325
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
rimage: manifest: Improve handling of empty segments #8531
Conversation
If a given output segment type did not contain any input section (was empty), its size was incorrectly calculated as 1 and then rounded to the page size (4096). This resulted in an unnecessary segment in a output file. Signed-off-by: Adrian Warecki <[email protected]>
We only have one section in the manifest, that contains both .data and .rodata, right? This is in fact not good, can this be fixed? |
If the RODATA segment does not contain any data, its type is marked as empty. Cleared the readonly flag because this segment also contains .data sections. Signed-off-by: Adrian Warecki <[email protected]>
4c361b6
to
194a810
Compare
I'm afraid there is no good solution for this. The manifest only supports max three segments. Currently we use them like this:
|
I don't really understand this assumption - modules are allowed to have .rodata, i.e. |
I think we have been merging .rodata and .data in the same manifest section to date using the linker and rimage. |
SOFCI TEST |
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.
Looks ok. @lyakh please take a look at the clarifications.
questions remain, but none of them are critical
Fixed output segment size calculation. If a given output segment type did not contain any input section (was empty), its size was incorrectly calculated as 1 and then rounded to the page size (4096). This resulted in an unnecessary segment in a output file.
Improved handling of empty RODATA segment. If the RODATA segment does not contain any data, its type is now marked as empty. Cleared the readonly flag of RODATA segment because this segment also contains .data sections.