-
Notifications
You must be signed in to change notification settings - Fork 68
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
DynamicLinking.md: add notes about memory/table exports #234
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % comments
|
||
On the other hand, non-PIE executables need to export these instance | ||
resources as usual. | ||
|
||
## Implementation Status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can/should add something under this header for wasi now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean to update the implementation status section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we mention LLVM here and emscripten, perhaps you could mention wasi-sdk too? i.e. what is the status there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
DynamicLinking.md
Outdated
export them as well. For that reason, for PIE executables, we don't | ||
require these resources exported. | ||
|
||
Shared libraries don't need to export these instance resoures either |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Shared libraries should also import these resources, since they share a memory and function table with the main module."
@sbc100 It looks like you approved this; is this ready to land? |
DynamicLinking.md
Outdated
require these resources exported. | ||
|
||
Shared libraries don't need to export these resources either. | ||
They should also import these resources, since they share the memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, they should..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % comments
This is my attempt to capture the discussion in WebAssembly#232
c155913
to
faf6c9e
Compare
faf6c9e
to
96fc30b
Compare
DynamicLinking.md
Outdated
|
||
``` | ||
-fPIC \ | ||
-Xlinker -pie \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe -pie
is clang flag. No need to -Xlinker
here.
DynamicLinking.md
Outdated
-fPIC \ | ||
-shared \ | ||
-Xlinker --experimental-pic \ | ||
-Wl,--unresolved-symbols=import-dynamic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can combine these two lines, or at least be consistent. -Xlinker
and -Wl
basically do the same things but -Wl
allows you to specify more than one argument at time. e.g.:
-Wl,--experimental-pic,--unresolved-symbols=import-dynamic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think -Wl,
is the more widely used/recognized one, but I could be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure we want --unresolved-symbols=import-dynamic
here? I would hope that the default of requiring all symbols to be resolved would work in many cases.
Perhaps its best to just drop this section listing specific link options since there are many combinations that can work, and since this is all experimental it could becoming out of date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure we want
--unresolved-symbols=import-dynamic
here? I would hope that the default of requiring all symbols to be resolved would work in many cases.
i copy-and-pasted these options from my test scripts.
maybe it can be outdated and/or redundant.
Perhaps its best to just drop this section listing specific link options since there are many combinations that can work, and since this is all experimental it could becoming out of date.
ok. it makes sense. i will remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
DynamicLinking.md
Outdated
-Xlinker --export=__stack_pointer \ | ||
-Xlinker --export=__heap_base \ | ||
-Xlinker --export=__heap_end \ | ||
-z stack-size=16384 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to stack-size here right?
This is my attempt to capture the discussion in
#232