[PATCH] D90108: [MC] Error for .weak/.globl/.local which change the symbol binding

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 14:31:55 PDT 2020


MaskRay added a comment.

In D90108#2354374 <https://reviews.llvm.org/D90108#2354374>, @nickdesaulniers wrote:

> I wonder how many Linux kernel targets will break when using `LLVM_IAS=1` with this?  We should be able to fix up any instances we find in kernel sources though. Thanks for the patch.

`./build.sh -t X86 -s path/to/my/linux -p path/to/my/llvm/build/bin` succeeds. I suspect there are few issues.

In D90108#2354373 <https://reviews.llvm.org/D90108#2354373>, @psmith wrote:

> Personally I'd err on the side of consistency with binutils. If they are happy to go to an error then we can. If they aren't then I recommend that we warn rather than error as we risk breaking builds for working software and it isn't always easy to get source code fixed. Not got a strong opinion though so happy to go with the consensus.

If we issue a warning, users will only notice the issue when they use `-Wa,--fatal-warnings`. We can classify the potential risks on whether .local is used:

- .local is used: .local is a very rare directive.
- .local is not used: the issue is about .weak and .globl . This represents a semantic difference between MC and GNU ld. There may be a few more but I doubt there can be more than a few. Can we try error first and switch to a warning if it turns out to be a problem?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90108/new/

https://reviews.llvm.org/D90108



More information about the llvm-commits mailing list