blob: b0dc43c6c868fb759e78390effde44bc110419a6 [file] [log] [blame]
Eugene Zelenkoa700a602017-02-11 00:27:28 +00001//===- MCAsmInfoELF.cpp - ELF asm properties ------------------------------===//
Rafael Espindola06957f42013-10-16 01:34:32 +00002//
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"
Zachary Turner19ca2b02017-06-07 03:48:56 +000016#include "llvm/BinaryFormat/ELF.h"
Rafael Espindolab510f8d2014-10-15 15:44:16 +000017#include "llvm/MC/MCContext.h"
18#include "llvm/MC/MCSectionELF.h"
Eugene Zelenkoa700a602017-02-11 00:27:28 +000019
Rafael Espindola06957f42013-10-16 01:34:32 +000020using namespace llvm;
21
Eugene Zelenkoa700a602017-02-11 00:27:28 +000022void MCAsmInfoELF::anchor() {}
Rafael Espindola06957f42013-10-16 01:34:32 +000023
Rafael Espindola75219642015-05-21 19:20:38 +000024MCSection *MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const {
Dan Gohman2389b802016-01-15 23:59:13 +000025 if (!UsesNonexecutableStackSection)
26 return nullptr;
Rafael Espindola9936b802015-01-29 17:33:21 +000027 return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS, 0);
Rafael Espindolab510f8d2014-10-15 15:44:16 +000028}
29
Rafael Espindola06957f42013-10-16 01:34:32 +000030MCAsmInfoELF::MCAsmInfoELF() {
31 HasIdentDirective = true;
32 WeakRefDirective = "\t.weak\t";
Rafael Espindola9472fd72013-12-02 23:39:26 +000033 PrivateGlobalPrefix = ".L";
Matt Arsenault459e5952014-12-04 00:06:57 +000034 PrivateLabelPrefix = ".L";
Rafael Espindola06957f42013-10-16 01:34:32 +000035}