Skip to content

[LLDB][ELF] Fix section unification to not just use names. #8661

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

Closed

Conversation

al45tair
Copy link

Section unification cannot just use names, because it's valid for ELF binaries to have multiple sections with the same name. We should check other section properties too.

rdar://124467787

Section unification cannot just use names, because it's valid for ELF
binaries to have multiple sections with the same name.  We should check
other section properties too.

rdar://124467787
Fixed a couple of nits from review, and fixed up formatting.

Also added a test.

rdar://124467787
As pointed out by @labath, if you use `objcopy --only-keep-debug`, only
placeholder sections will be present so the file sizes won't match.

We already ignore file offsets when doing the comparison.

rdar://124467787
Rather than including a binary, use `yaml2obj` for the duplicate section
name test.

rdar://124467787
@al45tair al45tair requested a review from JDevlieghere April 30, 2024 14:23
@al45tair
Copy link
Author

This is a cherry pick of llvm#90099

@al45tair al45tair requested a review from etcwilde April 30, 2024 14:26
The section type can change when using `objcopy --only-keep-debug`,
apparently.

rdar://124467787
@al45tair al45tair force-pushed the eng/PR-124467787-20230725 branch from b08bd82 to a93ec79 Compare April 30, 2024 14:30
@al45tair
Copy link
Author

@swift-ci Please test

@al45tair
Copy link
Author

The macOS failure doesn't appear to be related to the changes in this PR.

@al45tair
Copy link
Author

al45tair commented May 1, 2024

@swift-ci Please test macOS platform

Copy link
Member

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

I think this looks like it should work. I don't know enough about LLDB details to feel comfortable approving though.

@al45tair
Copy link
Author

al45tair commented May 4, 2024

:-) I'm told we don't actually need this one anyway, because there's an auto merger that will take #8699 and apply it here.

@al45tair
Copy link
Author

al45tair commented May 7, 2024

Closing as #8699 has been merged and the auto merger has done its job.

@al45tair al45tair closed this May 7, 2024
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