blob: 26e5608d87333e2e891d91aeb6bf0a8222dc472b [file] [log] [blame]
Rafael Espindola43c4e242013-10-16 01:34:32 +00001//===-- MCAsmInfoELF.cpp - ELF asm properties -------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines target asm properties related what form asm statements
11// should take in general on ELF-based targets
12//
13//===----------------------------------------------------------------------===//
14
15#include "llvm/MC/MCAsmInfoELF.h"
Rafael Espindolaad33dd22014-10-15 15:44:16 +000016#include "llvm/MC/MCContext.h"
17#include "llvm/MC/MCSectionELF.h"
18#include "llvm/Support/ELF.h"
Rafael Espindola43c4e242013-10-16 01:34:32 +000019using namespace llvm;
20
21void MCAsmInfoELF::anchor() { }
22
Rafael Espindola0709a7b2015-05-21 19:20:38 +000023MCSection *MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const {
Dan Gohman2f301f32016-01-15 23:59:13 +000024 if (!UsesNonexecutableStackSection)
25 return nullptr;
Rafael Espindolaba31e272015-01-29 17:33:21 +000026 return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS, 0);
Rafael Espindolaad33dd22014-10-15 15:44:16 +000027}
28
Rafael Espindola43c4e242013-10-16 01:34:32 +000029MCAsmInfoELF::MCAsmInfoELF() {
30 HasIdentDirective = true;
31 WeakRefDirective = "\t.weak\t";
Rafael Espindola5113d162013-12-02 23:39:26 +000032 PrivateGlobalPrefix = ".L";
Matt Arsenault4e273432014-12-04 00:06:57 +000033 PrivateLabelPrefix = ".L";
Dan Gohman2f301f32016-01-15 23:59:13 +000034 UsesNonexecutableStackSection = true;
Rafael Espindola43c4e242013-10-16 01:34:32 +000035}