Repository navigation
dylink: Remove dynamic linking startup code and allocation - #18643
Merged
Merged
Conversation
sbc100
force-pushed
the
dylink_simplify
branch
4 times, most recently
from
February 1, 2023 02:29
d2e398e to
3bfadad
Compare
sbc100
force-pushed
the
dylink_simplify
branch
from
February 1, 2023 22:01
3bfadad to
929df9d
Compare
sbc100
force-pushed
the
dylink_simplify
branch
4 times, most recently
from
February 2, 2023 00:49
2b5106f to
487391e
Compare
sbc100
force-pushed
the
dylink_simplify
branch
from
February 2, 2023 00:52
487391e to
b6dc4d5
Compare
With this change I completely remove the `ensure_init` function and the associated allocation in favor a static handle for the "main" dso. I also avoid the initial `_dlinit` call out to JS. This change relies on the fact that `dlopen(NULL, ..`) return a handle the is equivalent of `RTLD_DEFAULT` when passed to `dlsym`. See: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dlopen.3.html
sbc100
force-pushed
the
dylink_simplify
branch
from
February 2, 2023 00:57
b6dc4d5 to
2d1968a
Compare
sbc100
enabled auto-merge (squash)
February 2, 2023 05:34
Collaborator
Author
|
PTAL. I'd like to land this before #18376 |
tlively
approved these changes
Feb 2, 2023
tlively
left a comment
Member
There was a problem hiding this comment.
Not entirely versed in the context here, but I think I figured enough out that this LGTM.
| global: true, | ||
| }; | ||
| LDSO.loadedLibsByName[name] = dso; | ||
| if (handle != undefined) { |
Member
There was a problem hiding this comment.
When is the handle undefined? It would be simpler to reason about if the handle could always be assumed to exist.
Collaborator
Author
There was a problem hiding this comment.
This is for DSOs are loaded during the JS start process, before native code is run. We load all any needed shared libraries by name, but these don't have any native "dso" struct/handler associated with them. They get handles don't someone calls "dlopen" on them... which is often never in the case of load time dynamic libraries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this change I completely remove the
ensure_initfunction and the associated allocation in favor a static handle for the "main" dso.I also avoid the initial
_dlinitcall out to JS.This change relies on the fact that
dlopen(NULL, ..) return a handle the is equivalent ofRTLD_DEFAULTwhen passed todlsym. See: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dlopen.3.html