-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[AMDGPU][MC] Use normal ELF syntax for section switching #77267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-backend-amdgpu @llvm/pr-subscribers-mc Author: Shilei Tian (shiltian) ChangesFix #64862. Full diff: https://github.com/llvm/llvm-project/pull/77267.diff 2 Files Affected:
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
|
exclude
flag when parsing sun-style section flagsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the assembler still recognize the sun syntax? Can you add a test for what happens if you try reading old asm with the sun name?
Do we still want the sun style to work? I tried locally and the assembler can still recognize it. |
Well we ideally wouldn't break existing asm people are relying on parsing |
We can keep as it for now and probably add some checks when parsing Sun syntax after next release or so. |
For some reasons `SunStyleELFSectionSwitchSyntax` is set to `true` for AMDGPU, but according to llvm#64862 (comment) that syntax is only limited to Sun system. Fix llvm#64862.
For some reasons
SunStyleELFSectionSwitchSyntax
is set totrue
for AMDGPU, but according to #64862 (comment) that syntax is only limited to Sun system.Fix #64862.