blob: a5e8aff7f129d220b4505990170cafa3fae69b9d [file] [log] [blame]
Eugene Zelenkod3a6c892017-02-11 00:27:28 +00001//===- MCAsmInfoELF.cpp - ELF asm properties ------------------------------===//
Rafael Espindola43c4e242013-10-16 01:34:32 +00002//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Rafael Espindola43c4e242013-10-16 01:34:32 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This file defines target asm properties related what form asm statements
10// should take in general on ELF-based targets
11//
12//===----------------------------------------------------------------------===//
13
14#include "llvm/MC/MCAsmInfoELF.h"
Zachary Turner264b5d92017-06-07 03:48:56 +000015#include "llvm/BinaryFormat/ELF.h"
Rafael Espindolaad33dd22014-10-15 15:44:16 +000016#include "llvm/MC/MCContext.h"
17#include "llvm/MC/MCSectionELF.h"
Eugene Zelenkod3a6c892017-02-11 00:27:28 +000018
Rafael Espindola43c4e242013-10-16 01:34:32 +000019using namespace llvm;
20
Eugene Zelenkod3a6c892017-02-11 00:27:28 +000021void MCAsmInfoELF::anchor() {}
Rafael Espindola43c4e242013-10-16 01:34:32 +000022
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";
Rafael Espindola43c4e242013-10-16 01:34:32 +000034}