-
Notifications
You must be signed in to change notification settings - Fork 66
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
Handle weak undefined globals/functions #47
base: main
Are you sure you want to change the base?
Conversation
Weak undefined globals are prohibited; for functions we specify the use of a synthetic stub.
This implements WebAssembly/tool-conventions#47 Differential Revision: https://reviews.llvm.org/D44201 llvm-svn=327146
This implements WebAssembly/tool-conventions#47 Differential Revision: https://reviews.llvm.org/D44201 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327146 91177308-0d34-0410-b5e6-96231b3b80d8
@@ -221,6 +221,9 @@ The current set of valid flags for symbols are: | |||
discarded if any strong definitions exist; then if multiple weak definitions | |||
exist all but one (unspecified) are discarded; and finally it is an error if | |||
more than one definition remains. | |||
|
|||
It is an error to apply this flag to undefined global symbols; when linking, |
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.
How about just "This flag may not be applied to symbols of type SYMBOL_TYPE_GLOBAL"?
(Also I think the abort SYMTAB_XXX should be more like SYMBOL_TYPE_XX)
which may not be defined; a definition or import must exist for all global | ||
symbols in the linked output. | ||
`R_WEBASSEMBLY_FUNCTION_INDEX_LEB` relocations shall not fail to be processed. | ||
In case where the function symbol is weakly-undefined, there is no function |
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 don''t think you need the first sentence of this para.
must either be defined (weakly or strongly), or if undefined must be strong. | ||
Hence, there is always a global in the final output to use as the target of | ||
the relocation. (If weak undefined globals were permitted, there would be no | ||
Wasm global in the final output for the relocation to target.) |
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 don't think you need this last paragraph either. If you do want to keep it perhaps it can be at least shortened.
Weak undefined globals are prohibited; for functions we specify the use of a synthetic stub.
Resolves #46