diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2022-07-03 14:10:23 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2022-07-03 14:10:23 +0000 |
| commit | 145449b1e420787bb99721a429341fa6be3adfb6 (patch) | |
| tree | 1d56ae694a6de602e348dd80165cf881a36600ed /llvm/lib/MC/MCSectionELF.cpp | |
| parent | ecbca9f5fb7d7613d2b94982c4825eb0d33d6842 (diff) | |
Vendor import of llvm-project main llvmorg-15-init-15358-g53dc0f107877.vendor/llvm-project/llvmorg-15-init-15358-g53dc0f107877
Diffstat (limited to 'llvm/lib/MC/MCSectionELF.cpp')
| -rw-r--r-- | llvm/lib/MC/MCSectionELF.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCSectionELF.cpp b/llvm/lib/MC/MCSectionELF.cpp index d18876507cd7..27dc1826819b 100644 --- a/llvm/lib/MC/MCSectionELF.cpp +++ b/llvm/lib/MC/MCSectionELF.cpp @@ -19,7 +19,7 @@ using namespace llvm; // Decides whether a '.section' directive // should be printed before the section name. -bool MCSectionELF::ShouldOmitSectionDirective(StringRef Name, +bool MCSectionELF::shouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const { if (isUnique()) return false; @@ -50,10 +50,10 @@ static void printName(raw_ostream &OS, StringRef Name) { OS << '"'; } -void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, +void MCSectionELF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T, raw_ostream &OS, const MCExpr *Subsection) const { - if (ShouldOmitSectionDirective(getName(), MAI)) { + if (shouldOmitSectionDirective(getName(), MAI)) { OS << '\t' << getName(); if (Subsection) { OS << '\t'; @@ -105,6 +105,11 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, if (Flags & ELF::SHF_GNU_RETAIN) OS << 'R'; + // If there are os-specific flags, print them. + if (T.isOSSolaris()) + if (Flags & ELF::SHF_SUNW_NODISCARD) + OS << 'R'; + // If there are target-specific flags, print them. Triple::ArchType Arch = T.getArch(); if (Arch == Triple::xcore) { @@ -160,6 +165,8 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, OS << "llvm_sympart"; else if (Type == ELF::SHT_LLVM_BB_ADDR_MAP) OS << "llvm_bb_addr_map"; + else if (Type == ELF::SHT_LLVM_BB_ADDR_MAP_V0) + OS << "llvm_bb_addr_map_v0"; else report_fatal_error("unsupported type 0x" + Twine::utohexstr(Type) + " for section " + getName()); @@ -196,7 +203,7 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, } } -bool MCSectionELF::UseCodeAlign() const { +bool MCSectionELF::useCodeAlign() const { return getFlags() & ELF::SHF_EXECINSTR; } |
