Skip to content

Define Linking ABI for common symbols#267

Open
dschuff wants to merge 1 commit into
mainfrom
common-symbol
Open

Define Linking ABI for common symbols#267
dschuff wants to merge 1 commit into
mainfrom
common-symbol

Conversation

@dschuff
Copy link
Copy Markdown
Member

@dschuff dschuff commented May 22, 2026

As discussed in llvm/llvm-project#196641

So far there is not support for initialized common symbols.

As discussed in llvm/llvm-project#196641
So far there is not support for initialized common symbols.
@dschuff dschuff requested a review from sbc100 May 22, 2026 00:44
@dschuff
Copy link
Copy Markdown
Member Author

dschuff commented May 22, 2026

I have an implementation which I will post shortly.

@sbc100 This version uses the combined bitmask of BINDING_GLOBAL and BINDING_WEAK (which are mutually exclusive) to mean BINDING_COMMON. Do you think this is better than just allocating another bit at the end?

@sbc100
Copy link
Copy Markdown
Member

sbc100 commented May 22, 2026

Combining BINDING_GLOBAL and BINDING_WEAK makes some logical sense to me.

But I don't quite understand since WASM_SYM_BINDING_GLOBAL is zero how can you know if its included in the bitmask along with WASM_SYM_BINDING_WEAK?

@dschuff
Copy link
Copy Markdown
Member Author

dschuff commented May 22, 2026

Sorry, I meant the combination of BINDING_LOCAL (0b01) and BINDING_WEAK(0b10), means BINDING_COMMON (0b11). Currently LOCAL is exclusive with WEAK (explicitly disallowed in the current doc), and of course both of those are exclusive with GLOBAL by the construction of the encoding.

@sbc100
Copy link
Copy Markdown
Member

sbc100 commented May 22, 2026

Yes, I suppose LOCAL + WEAK is less intuitive.. is it hard to add another bit to the encoding?

@dschuff
Copy link
Copy Markdown
Member Author

dschuff commented May 22, 2026

No, I don't think it would be. With the current formulation, the first 2 bits encode one of 4 possible bindings, which become mutually exclusive by construction. That's nice; but the downside is that these are no longer one-bit "flags" in the same sense that the rest of the bits are now. And of course if we ever add another binding, then it will be even weirder, since we'll have these 4 possibilities, plus another bit.

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