-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
[Feature request] Feature to ensure a certain piece of data is within aligned boundary #999
Comments
Just use an
|
That would merely check for the problem, not fix the alignment automatically. Depending on the algorithm for placing floating sections, this could also trigger the assertion far more often than on average once for every 256 bytes of data added. |
You have to align the containing section in this case. Which makes sense, because if your section has an alignment requirement, you should be stating it at the top. |
No, the whole point of the FR is to not have to align the containing section. If you align the section, the data will be placed at the start of the section, or at some offset from the start, depending on what comes before the it. The point of the FR is to give an optimizing section placer more options to place data that doesn't need to be at a fixed offset from an aligned boundary, but also can't cross a boundary, such as the examples given. |
There is intra-section |
Again, this doesn't fulfill the goal of helping an optimizing section placer. Intra-section Just so I'm clear about what the FR suggests: For example, a 16 byte table with 256 byte alignment, could currently only placed at I don't realistically think this will be implemented any time soon since it would take a lot of effort for a pretty niche use case, but I thought I'd get the FR in for the record anyway. |
I don't the linker's greedy algorithm for section placement is currently capable of taking advantage of this extra freedom, but it's an interesting idea. |
This is not really easy to implement, but I though I'd post it before I forget again so it's on the record as a feature request.
The feature requested is the ability to make sure that a certain piece of data (for example a table or a short piece of data to be copied) doesn't cross a page boundary. This would allow optimizations in many cases where 8 bit math can be used without checking overflow, and without the need for hard alignment to a page boundary, which imposes more restrictions on the alignment than necessary. Consider something like:
Or:
The text was updated successfully, but these errors were encountered: