Skip to content

Runtime: Refactor platform-dependent image inspection code. #5846

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 1 commit into from
Nov 18, 2016

Conversation

jckarter
Copy link
Contributor

The code we use to interface with the platform dynamic linker is turning into a rat's nest of conditionals that's hard to maintain and extend. Since ELF, Mach-O, and PE platforms have pretty fundamentally different dynamic linker interfaces and capabilities, it makes sense to factor that code into a separate file per-platform, instead of trying to conditionalize the logic in-line. This patch factors out a much simpler portable interface for lazily kicking off the protocol conformance and type metadata lookup caches, and factors the guts out into separate MachO, ELF, and Win32 backends. This should also be a much cleaner interface to interface static binary behavior into, assisting #5349.

@jckarter
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 58393ae85becfaacfc7b8228cc7a39b28adffd78
Test requested by - @jckarter

@jckarter jckarter force-pushed the refactor-section-registration branch from 58393ae to c8655e3 Compare November 17, 2016 22:46
@jckarter
Copy link
Contributor Author

@compnerd I had to eyeball the Cygwin and MSVC stuff since I don't have a Windows build environment set up. Would you be able to take a look and ensure this works?

@jckarter
Copy link
Contributor Author

@swift-ci Please test Linux

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 58393ae85becfaacfc7b8228cc7a39b28adffd78
Test requested by - @jckarter

@jckarter
Copy link
Contributor Author

@compnerd The Windows module lookup stuff also looks like it could be cleaned up quite a bit by using the Win32 API directly instead of trying to emulate the Linux dl_iterate_phdr interface.

@jckarter jckarter force-pushed the refactor-section-registration branch from c8655e3 to dbe323d Compare November 17, 2016 22:49
@jckarter
Copy link
Contributor Author

@swift-ci Please test Linux

@jckarter
Copy link
Contributor Author

@jckarter
Copy link
Contributor Author

@swift-ci Please smoke test

The code we use to interface with the platform dynamic linker is turning into a rat's nest of conditionals that's hard to maintain and extend. Since ELF, Mach-O, and PE platforms have pretty fundamentally different dynamic linker interfaces and capabilities, it makes sense to factor that code into a separate file per-platform, instead of trying to conditionalize the logic in-line. This patch factors out a much simpler portable interface for lazily kicking off the protocol conformance and type metadata lookup caches, and factors the guts out into separate MachO, ELF, and Win32 backends. This should also be a much cleaner interface to interface static binary behavior into, assisting swiftlang#5349.
@jckarter jckarter force-pushed the refactor-section-registration branch from dbe323d to 87b27c6 Compare November 18, 2016 00:50
@jckarter
Copy link
Contributor Author

@swift-ci Please smoke test

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