From ee1a6e70fa555a305bfc56b1743e98b2a615f05c Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Wed, 27 Mar 2019 01:13:59 +0000 Subject: [Remarks] Emit a section containing remark diagnostics metadata A section containing metadata on remark diagnostics will be emitted if the flag (-mllvm) -remarks-section is present. For now, the metadata is: * a magic number for remarks: "REMARKS\0" * the version number: a little-endian uint64_t * the absolute file path to the serialized remark diagnostics: a null-terminated string. Differential Revision: https://reviews.llvm.org/D59571 llvm-svn: 357043 --- llvm/lib/MC/MCObjectFileInfo.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp') diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index 1c845f64050..0faa236c153 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -290,6 +290,9 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) { FaultMapSection = Ctx->getMachOSection("__LLVM_FAULTMAPS", "__llvm_faultmaps", 0, SectionKind::getMetadata()); + RemarksSection = Ctx->getMachOSection( + "__LLVM", "__remarks", MachO::S_ATTR_DEBUG, SectionKind::getMetadata()); + TLSExtraDataSection = TLSTLVSection; } @@ -475,6 +478,9 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) { Ctx->getELFSection(".eh_frame", EHSectionType, EHSectionFlags); StackSizesSection = Ctx->getELFSection(".stack_sizes", ELF::SHT_PROGBITS, 0); + + RemarksSection = + Ctx->getELFSection(".remarks", ELF::SHT_PROGBITS, ELF::SHF_EXCLUDE); } void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) { -- cgit v1.2.3