10b57cec5SDimitry Andric //===- MCAsmInfoELF.cpp - ELF asm properties ------------------------------===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric // 90b57cec5SDimitry Andric // This file defines target asm properties related what form asm statements 100b57cec5SDimitry Andric // should take in general on ELF-based targets 110b57cec5SDimitry Andric // 120b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 130b57cec5SDimitry Andric 140b57cec5SDimitry Andric #include "llvm/MC/MCAsmInfoELF.h" 150b57cec5SDimitry Andric #include "llvm/BinaryFormat/ELF.h" 160b57cec5SDimitry Andric #include "llvm/MC/MCContext.h" 170b57cec5SDimitry Andric #include "llvm/MC/MCSectionELF.h" 180b57cec5SDimitry Andric 190b57cec5SDimitry Andric using namespace llvm; 200b57cec5SDimitry Andric 210b57cec5SDimitry Andric void MCAsmInfoELF::anchor() {} 220b57cec5SDimitry Andric 230b57cec5SDimitry Andric MCSection *MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const { 24*5f757f3fSDimitry Andric // Solaris doesn't know/doesn't care about .note.GNU-stack sections, so 25*5f757f3fSDimitry Andric // don't emit them. 26*5f757f3fSDimitry Andric if (Ctx.getTargetTriple().isOSSolaris()) 27*5f757f3fSDimitry Andric return nullptr; 280b57cec5SDimitry Andric return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS, 0); 290b57cec5SDimitry Andric } 300b57cec5SDimitry Andric 310b57cec5SDimitry Andric MCAsmInfoELF::MCAsmInfoELF() { 320b57cec5SDimitry Andric HasIdentDirective = true; 330b57cec5SDimitry Andric WeakRefDirective = "\t.weak\t"; 340b57cec5SDimitry Andric PrivateGlobalPrefix = ".L"; 350b57cec5SDimitry Andric PrivateLabelPrefix = ".L"; 360b57cec5SDimitry Andric } 37