[llvm] [llvm][ELF] Correctly set the .llvm.lto section type (PR #92820)
Paul Kirth via llvm-commits
llvm-commits at lists.llvm.org
Mon May 20 14:04:38 PDT 2024
https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/92820
>From 6fd78a3386cd36a8df10ac3b995a9168667a6e27 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Mon, 20 May 2024 13:58:46 -0700
Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=
=?UTF-8?q?itial=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.4
---
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 3 +++
llvm/test/CodeGen/X86/fat-lto-section.ll | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 3e1897ce670a6..567e9443759f1 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -527,6 +527,9 @@ static unsigned getELFSectionType(StringRef Name, SectionKind K) {
if (K.isBSS() || K.isThreadBSS())
return ELF::SHT_NOBITS;
+ if(hasPrefix(Name, ".llvm.lto"))
+ return ELF::SHT_LLVM_LTO;
+
return ELF::SHT_PROGBITS;
}
diff --git a/llvm/test/CodeGen/X86/fat-lto-section.ll b/llvm/test/CodeGen/X86/fat-lto-section.ll
index 30c56229a0e2a..f3ca8436affb4 100644
--- a/llvm/test/CodeGen/X86/fat-lto-section.ll
+++ b/llvm/test/CodeGen/X86/fat-lto-section.ll
@@ -5,6 +5,6 @@
; RUN: | FileCheck %s --check-prefix=EXCLUDE
; EXCLUDE: Name Type {{.*}} ES Flg Lk Inf Al
-; EXCLUDE: .llvm.lto PROGBITS {{.*}} 00 E 0 0 1
+; EXCLUDE: .llvm.lto LLVM_LTO {{.*}} 00 E 0 0 1
@a = global i32 1
>From 1be3afc878262e55ccf7c50b8f5a2493a7cf9b4f Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Mon, 20 May 2024 14:04:26 -0700
Subject: [PATCH 2/2] Fix formatting
Created using spr 1.3.4
---
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 567e9443759f1..f22353ecf82ba 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -527,7 +527,7 @@ static unsigned getELFSectionType(StringRef Name, SectionKind K) {
if (K.isBSS() || K.isThreadBSS())
return ELF::SHT_NOBITS;
- if(hasPrefix(Name, ".llvm.lto"))
+ if (hasPrefix(Name, ".llvm.lto"))
return ELF::SHT_LLVM_LTO;
return ELF::SHT_PROGBITS;
More information about the llvm-commits
mailing list