@@ -35,6 +35,8 @@ class RISCVTargetStreamer : public MCTargetStreamer {
RISCVABI::ABI TargetABI = RISCVABI::ABI_Unknown;
bool HasRVC = false;
bool HasTSO = false;
+ bool HasZICFILP = false;
jrtc27 wrote:
Make the fields and methods all Zifoo
@@ -118,6 +147,19 @@ void RISCVTargetELFStreamer::finish() {
}
MCA.setELFHeaderEFlags(EFlags);
+
+ unsigned GNUNoteFlags = 0;
+
+ // check ZICFILP or ZICFISS with features
jrtc27 wrote:
Not sure this adds anything, but if it's staying please properly
@@ -118,6 +147,19 @@ void RISCVTargetELFStreamer::finish() {
}
MCA.setELFHeaderEFlags(EFlags);
+
+ unsigned GNUNoteFlags = 0;
+
+ // check ZICFILP or ZICFISS with features
+ // TODO should we check with codegen enable ex. -mllvm
jrtc27 wrote:
This
@@ -5283,14 +5291,21 @@ static std::string getGNUProperty(uint32_t Type,
uint32_t DataSize,
OS << "";
return OS.str();
}
+
if (Type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) {
- DumpBit(GNU_PROPERTY_AARCH64_FEATURE_1_BTI, "BTI");
-
@@ -85,6 +85,35 @@ void RISCVTargetELFStreamer::finishAttributeSection() {
ELF::SHT_RISCV_ATTRIBUTES, AttributeSection);
}
+void RISCVTargetELFStreamer::emitNoteSection(unsigned Flags) {
jrtc27 wrote:
I know this is what AArch64
@@ -5272,8 +5272,16 @@ static std::string getGNUProperty(uint32_t Type,
uint32_t DataSize,
return OS.str();
case GNU_PROPERTY_AARCH64_FEATURE_1_AND:
case GNU_PROPERTY_X86_FEATURE_1_AND:
-OS << ((Type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) ? "aarch64 feature: "
-
topperc wrote:
> Unless `lld/test/ELF` tests will get a failure, the `lld/` part should
> ideally be dropped from this PR. This separation is a convention.
>
> Otherwise (a) with just a `[RISCV]` tag and (b) with many RISCV-specific
> changes, lld folks (like I) might not notice this patch.
@@ -0,0 +1,29 @@
+// When -march with zicfiss0p4 or zicfilp0p4 add GNU property to file object
MaskRay wrote:
This directory is for driver tests. Codegen tests should use `%clang_cc1` and
be moved elsewhere (e.g. test/CodeGen)
MaskRay wrote:
Unless `lld/test/ELF` tests will get a failure, the `lld/` part should ideally
be dropped from this PR.
lld folks (like I) might not notice this patch if there is just a `[RISCV]` tag.
https://github.com/llvm/llvm-project/pull/77414
@@ -468,6 +468,13 @@ static void checkOptions() {
error("-z pauth-report only supported on AArch64");
}
+ if (config->emachine != EM_RISCV) {
+if (config->zZicfilpReport != "none")
+ error("-z zicfilip-report only support on RISCV32/RISCV64");
@@ -5272,8 +5272,16 @@ static std::string getGNUProperty(uint32_t Type,
uint32_t DataSize,
return OS.str();
case GNU_PROPERTY_AARCH64_FEATURE_1_AND:
case GNU_PROPERTY_X86_FEATURE_1_AND:
-OS << ((Type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) ? "aarch64 feature: "
-
yetingk wrote:
I am sorry that I missed the commit for a long time. Very sorry about it.
https://github.com/llvm/llvm-project/pull/77414
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -188,6 +188,8 @@ struct Config {
StringRef zBtiReport = "none";
StringRef zCetReport = "none";
StringRef zPauthReport = "none";
+ llvm::StringRef zZicfilpReport = "none";
yetingk wrote:
Use `StringRef` instead of `llvm::StringRef`.
@@ -7884,10 +7902,11 @@ template void
LLVMELFDumper::printNotes() {
W.printString("Type",
"Unknown (" + to_string(format_hex(Type, 10)) + ")");
+uint16_t Target = this->Obj.getHeader().e_machine;
yetingk wrote:
Move this
@@ -7884,10 +7902,11 @@ template void
LLVMELFDumper::printNotes() {
W.printString("Type",
"Unknown (" + to_string(format_hex(Type, 10)) + ")");
+uint16_t Target = this->Obj.getHeader().e_machine;
yetingk wrote:
Is it better to
@@ -954,9 +954,18 @@ void readGnuProperty(const InputSection ,
ObjFile ) {
continue;
}
-uint32_t featureAndType = config->emachine == EM_AARCH64
- ? GNU_PROPERTY_AARCH64_FEATURE_1_AND
- :
https://github.com/SuHo-llrr ready_for_review
https://github.com/llvm/llvm-project/pull/77414
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
SuHo-llrr wrote:
@yetingk
I have updated to the latest version. If you have any suggestions, please let
me know.
https://github.com/llvm/llvm-project/pull/77414
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/SuHo-llrr updated
https://github.com/llvm/llvm-project/pull/77414
>From 61aaf8df2fbd0abfa4dfcd807f3366ce67f5603d Mon Sep 17 00:00:00 2001
From: SuHsien Ho
Date: Thu, 23 Nov 2023 14:36:43 +0800
Subject: [PATCH 1/5] [RISCV][ELF] Add RISCV GNU property label
---
llvmbot wrote:
@llvm/pr-subscribers-backend-risc-v
Author: None (SuHo-llrr)
Changes
Emit Zicfiss/Zicfilp to .note.gnu.property sections
1. for spec v0.4.0 Zicifss/Zicfilp is AND feature means that all objects need
to have this feature.
2. Emit note section when Zicifss/Zicfilp extension
https://github.com/kito-cheng edited
https://github.com/llvm/llvm-project/pull/77414
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
21 matches
Mail list logo