[llvm] [MC] Add support for `exclude` flag when parsing sun-style section flags (PR #77267)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 7 19:26:52 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mc
Author: Shilei Tian (shiltian)
<details>
<summary>Changes</summary>
Fix #<!-- -->64862.
---
Full diff: https://github.com/llvm/llvm-project/pull/77267.diff
2 Files Affected:
- (modified) llvm/lib/MC/MCParser/ELFAsmParser.cpp (+2)
- (added) llvm/test/MC/AsmParser/pr64862.s (+4)
``````````diff
diff --git a/llvm/lib/MC/MCParser/ELFAsmParser.cpp b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
index 93e1d2f44b8c56..b22d08dfedce0c 100644
--- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp
+++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
@@ -379,6 +379,8 @@ unsigned ELFAsmParser::parseSunStyleSectionFlags() {
flags |= ELF::SHF_WRITE;
else if (flagId == "tls")
flags |= ELF::SHF_TLS;
+ else if (flagId == "exclude")
+ flags |= ELF::SHF_EXCLUDE;
else
return -1U;
diff --git a/llvm/test/MC/AsmParser/pr64862.s b/llvm/test/MC/AsmParser/pr64862.s
new file mode 100644
index 00000000000000..1e0458129d9963
--- /dev/null
+++ b/llvm/test/MC/AsmParser/pr64862.s
@@ -0,0 +1,4 @@
+; RUN: llvm-mc -triple amdgcn-amd-amdhsa -mcpu gfx1030 %s | FileCheck %s
+
+; CHECK: .section ".linker-options",#exclude
+ .section ".linker-options",#exclude
``````````
</details>
https://github.com/llvm/llvm-project/pull/77267
More information about the llvm-commits
mailing list