summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-08-29 08:42:02 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-08-29 08:42:02 +0000
commit999d1ce5173aa8fcb5f905eaeb3e32ed57096b72 (patch)
tree240abbaa8fbc06931dd11365458fbbd06e2ef4aa /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent283b995097f91f340f69b229d2554e95a87fbe10 (diff)
downloadbcm5719-llvm-999d1ce5173aa8fcb5f905eaeb3e32ed57096b72.tar.gz
bcm5719-llvm-999d1ce5173aa8fcb5f905eaeb3e32ed57096b72.zip
[llvm-mc] - Allow to set custom flags for debug sections.
I am experimenting with a single split dwarf (.dwo sections in .o files). I want to make linker to ignore .dwo sections in .o, for that I am trying to add SHF_EXCLUDE flag ("E") for them in my asm sample. I found that currently, it is impossible to add any flag for debug sections using llvm-mc. That happens because we have a set of predefined unique sections created early with default flags: https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCObjectFileInfo.cpp#L391 This patch allows a user to add any flags he wants. I had to edit TargetLoweringObjectFileImpl.cpp to set MetaData type for debug sections. Their kind was Data by default (so they were allocatable) and so after changes introduced by this patch the SHF_ALLOC flag was applied for them, what does not make sense for debug sections. One of OrcJITTests tests failed because of that. Differential revision: https://reviews.llvm.org/D51361 llvm-svn: 340904
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 7a5fd2985c7..6944c532c08 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -424,6 +424,9 @@ static SectionKind getELFKindForNamedSection(StringRef Name, SectionKind K) {
Name.startswith(".llvm.linkonce.tb."))
return SectionKind::getThreadBSS();
+ if (Name.startswith(".debug_"))
+ return SectionKind::getMetadata();
+
return K;
}
OpenPOWER on IntegriCloud