xref: /aosp_15_r20/external/llvm/lib/MC/MCAsmInfoELF.cpp (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===-- MCAsmInfoELF.cpp - ELF asm properties -------------------*- C++ -*-===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This file defines target asm properties related what form asm statements
11*9880d681SAndroid Build Coastguard Worker // should take in general on ELF-based targets
12*9880d681SAndroid Build Coastguard Worker //
13*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
14*9880d681SAndroid Build Coastguard Worker 
15*9880d681SAndroid Build Coastguard Worker #include "llvm/MC/MCAsmInfoELF.h"
16*9880d681SAndroid Build Coastguard Worker #include "llvm/MC/MCContext.h"
17*9880d681SAndroid Build Coastguard Worker #include "llvm/MC/MCSectionELF.h"
18*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/ELF.h"
19*9880d681SAndroid Build Coastguard Worker using namespace llvm;
20*9880d681SAndroid Build Coastguard Worker 
anchor()21*9880d681SAndroid Build Coastguard Worker void MCAsmInfoELF::anchor() { }
22*9880d681SAndroid Build Coastguard Worker 
getNonexecutableStackSection(MCContext & Ctx) const23*9880d681SAndroid Build Coastguard Worker MCSection *MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const {
24*9880d681SAndroid Build Coastguard Worker   if (!UsesNonexecutableStackSection)
25*9880d681SAndroid Build Coastguard Worker     return nullptr;
26*9880d681SAndroid Build Coastguard Worker   return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS, 0);
27*9880d681SAndroid Build Coastguard Worker }
28*9880d681SAndroid Build Coastguard Worker 
MCAsmInfoELF()29*9880d681SAndroid Build Coastguard Worker MCAsmInfoELF::MCAsmInfoELF() {
30*9880d681SAndroid Build Coastguard Worker   HasIdentDirective = true;
31*9880d681SAndroid Build Coastguard Worker   WeakRefDirective = "\t.weak\t";
32*9880d681SAndroid Build Coastguard Worker   PrivateGlobalPrefix = ".L";
33*9880d681SAndroid Build Coastguard Worker   PrivateLabelPrefix = ".L";
34*9880d681SAndroid Build Coastguard Worker   UsesNonexecutableStackSection = true;
35*9880d681SAndroid Build Coastguard Worker }
36