Define Linking ABI for common symbols#267
Conversation
As discussed in llvm/llvm-project#196641 So far there is not support for initialized common symbols.
|
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? |
|
Combining But I don't quite understand since |
|
Sorry, I meant the combination of |
|
Yes, I suppose |
|
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. |
|
Based on our last conversation, I think we decided that combining the bits as described here (rather than adding more) was ok, but you also mentioned comparing to the way ELF does it. Here's the LLM's summary of the differences:
Keeping COMMON as a property of the symbol (rather than replacing with a defined symbol) seems cleaner to me? But not sure about that, I'm willing to defer to your opinion Gemini claims the ELF approach also results in problems when linking with
|
As discussed in llvm/llvm-project#196641
So far there is not support for initialized common symbols.