diff options
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 218b45c9e..b8339ee 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -151,6 +151,11 @@ getELFKindForNamedSection(StringRef Name, SectionKind K) { static unsigned getELFSectionType(StringRef Name, SectionKind K) { + // Use SHT_NOTE for section whose name starts with ".note" to allow + // emitting ELF notes from C variable declaration. + // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77609 + if (Name.startswith(".note")) + return ELF::SHT_NOTE; if (Name == ".init_array") return ELF::SHT_INIT_ARRAY; |