Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NWilson
Copy link
Contributor

@NWilson NWilson commented Mar 7, 2018

Weak undefined globals are prohibited; for functions we specify the use of a synthetic stub.

Resolves #46

Weak undefined globals are prohibited; for functions we specify the use of a synthetic stub.
jyknight pushed a commit to jyknight/llvm-monorepo that referenced this pull request Mar 9, 2018
earl pushed a commit to earl/llvm-mirror that referenced this pull request Mar 9, 2018
@@ -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,
Copy link
Member

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
Copy link
Member

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.)
Copy link
Member

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.

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