Skip to content
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

Combine data sections with equal names #76

Merged
merged 2 commits into from
Jun 19, 2024
Merged

Conversation

AetiasHax
Copy link
Contributor

Some compilers such as mwccarm can generate multiple .data sections in the same object file, but clicking a data symbol in objdiff shows a hex view for only the first .data section. Meanwhile, the target object has only one .data section, so the hex view is diffing all of the target data with only a single chunk of base object data.

My proposed solution is to "combine" sections with equal names, ordered from lowest to highest section index. There's a checkbox under "Diff Options" to enable this when needed.

Copy link
Owner

@encounter encounter left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

relocations.push(ObjReloc {
flags: reloc.flags,
address: (reloc.address as i64 + address_change).try_into()?,
target: reloc.target, // TODO: Should be updated?
Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, this is tricky. Would probably require keeping track of every symbol and their adjusted address. Luckily this only affects the relocation display on hover, so this can be revisited later.

@encounter encounter merged commit 1fd901a into encounter:main Jun 19, 2024
10 checks passed
@AetiasHax AetiasHax deleted the combine branch June 19, 2024 19:44
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.

2 participants