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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 29 01:51:49 PDT 2020


jhenderson accepted this revision.
jhenderson added a comment.

Looks good to me, with nits.



================
Comment at: llvm/lib/MC/MCELFStreamer.cpp:230
+    // traditionally set the binding to STB_GLOBAL. This is error-prone, so we
+    // error on such cases. Note, we also disallow changed binding from .local .
+    if (Symbol->isBindingSet() && Symbol->getBinding() != ELF::STB_GLOBAL)
----------------



================
Comment at: llvm/lib/MC/MCELFStreamer.cpp:240
   case MCSA_Weak:
+    // For `.globl x; .weak x`, both MC and GNU as set the binding to STB_WEAK.
+    // We emit a warning for now but may switch to an error in the future.
----------------
(for consistency with the comment above)


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