Fix ARM trailing data directive size#383
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d69d306dfb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d69d306 to
8027551
Compare
8027551 to
e2b98eb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2b98eb517
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| && !section.relocation_at(next_address.saturating_sub(4), 4).is_some_and(|relocation| { | ||
| relocation.address + self.data_reloc_size(relocation.flags) as u64 | ||
| > next_address - 2 | ||
| }) |
There was a problem hiding this comment.
Check all final-halfword relocations before trimming
When the last word contains multiple relocations, for example adjacent 16-bit relocations at next_address - 4 and next_address - 2, this only examines the first relocation returned for the 4-byte window. Section::relocation_at returns the first relocation at/after the start address, so the earlier relocation ending exactly at next_address - 2 makes this predicate false and the later relocation covering the halfword being trimmed is ignored, allowing the symbol-size inference to cut relocated data in half.
Useful? React with 👍 / 👎.
Summary
$ddata directives while retaining trailing halfword padding removalTesting
cargo testCloses #382