Skip to content

Remove erroneous ELF note. #61931

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

Merged
merged 2 commits into from
Nov 7, 2022
Merged

Conversation

al45tair
Copy link
Contributor

@al45tair al45tair commented Nov 4, 2022

On ELF platforms we currently output an ELF note but with totally invalid contents. I tried experimenting to see whether it was possible to do it properly and tie the result into ReflectionContext, but it turns out to be a hard problem because of issues to do with cross-segment symbol references and relocations.

The upshot is that I think for now it's best just to remove it.

We might revisit this in future at some point; it would be good to be able to reliably find the Swift metadata just from the ELF Phdrs.

rdar://101749382

On ELF platforms we currently output an ELF note but with totally invalid
contents.  I tried experimenting to see whether it was possible to do it
properly and tie the result into ReflectionContext, but it turns out to be a
hard problem because of issues to do with cross-segment symbol references and
relocations.

The upshot is that I think for now it's best just to remove it.

We might revisit this in future at some point; it would be good to be able to
reliably find the Swift metadata just from the ELF Phdrs.

rdar://101749382
@al45tair
Copy link
Contributor Author

al45tair commented Nov 4, 2022

@swift-ci Please smoke test

@al45tair al45tair requested a review from mikeash November 4, 2022 09:56
Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

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

Should also remove the #define SWIFT_REFLECTION_METADATA_ELF_NOTE_MAGIC_STRING since nothing else uses it.

We aren't using this constant any more either.

rdar://101749382
@al45tair
Copy link
Contributor Author

al45tair commented Nov 4, 2022

@swift-ci Please smoke test.

@al45tair al45tair merged commit 9c321c0 into swiftlang:main Nov 7, 2022
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