Skip to content

Fix ARM trailing data directive size#383

Open
floze-the-genius wants to merge 1 commit into
encounter:mainfrom
floze-the-genius:fix/issue-382-arm-data-directive
Open

Fix ARM trailing data directive size#383
floze-the-genius wants to merge 1 commit into
encounter:mainfrom
floze-the-genius:fix/issue-382-arm-data-directive

Conversation

@floze-the-genius

Copy link
Copy Markdown

Summary

  • initialize ARM mapping symbols before inferring zero-sized function spans
  • preserve terminal word-sized $d data directives while retaining trailing halfword padding removal
  • add the issue ARM/Thumb: Final data directive size is incorrect #382 object fixture and regression test

Testing

  • cargo test

Closes #382

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread objdiff-core/src/arch/arm.rs Outdated
@floze-the-genius
floze-the-genius force-pushed the fix/issue-382-arm-data-directive branch from d69d306 to 8027551 Compare July 19, 2026 19:17
@floze-the-genius
floze-the-genius force-pushed the fix/issue-382-arm-data-directive branch from 8027551 to e2b98eb Compare July 20, 2026 13:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +493 to +496
&& !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
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARM/Thumb: Final data directive size is incorrect

1 participant