1 | //===- MCAsmInfoELF.cpp - ELF asm properties ------------------------------===// |
---|---|
2 | // |
3 | // 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 |
6 | // |
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" |
15 | #include "llvm/BinaryFormat/ELF.h" |
16 | #include "llvm/MC/MCContext.h" |
17 | #include "llvm/MC/MCSectionELF.h" |
18 | |
19 | using namespace llvm; |
20 | |
21 | void MCAsmInfoELF::anchor() {} |
22 | |
23 | MCSection *MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const { |
24 | // Solaris doesn't know/doesn't care about .note.GNU-stack sections, so |
25 | // don't emit them. |
26 | if (Ctx.getTargetTriple().isOSSolaris()) |
27 | return nullptr; |
28 | return Ctx.getELFSection(Section: ".note.GNU-stack", Type: ELF::SHT_PROGBITS, Flags: 0); |
29 | } |
30 | |
31 | MCAsmInfoELF::MCAsmInfoELF() { |
32 | HasIdentDirective = true; |
33 | WeakRefDirective = "\t.weak\t"; |
34 | PrivateGlobalPrefix = ".L"; |
35 | PrivateLabelPrefix = ".L"; |
36 | } |
37 |