[PATCH] D77919: [MC][ELF] Add section flags to diagnostic

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 21:09:48 PDT 2020


MaskRay added inline comments.


================
Comment at: llvm/lib/MC/MCParser/ELFAsmParser.cpp:290
+          Twine(((flags & ELF::SHF_TLS) != 0) ? "T" : "") +
+          Twine(((flags & ELF::XCORE_SHF_CP_SECTION) != 0) ? "c" : "") +
+          Twine(((flags & ELF::XCORE_SHF_DP_SECTION) != 0) ? "d" : "") +
----------------
It is incorrect to mix OS/processor specific flags here. Hard coding generic flags and their strings are also error-prone. I left this as a TODO because it is not very easy to reuse `lib/MC/MCSectionELF.cpp#L53` code. I'll check more carefully how to reuse.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77919





More information about the llvm-commits mailing list