1//===- MCSectionELF.h - ELF Machine Code Sections ---------------*- C++ -*-===//
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
7//===----------------------------------------------------------------------===//
9// This file declares the MCSectionELF class.
11//===----------------------------------------------------------------------===//
13#ifndef LLVM_MC_MCSECTIONELF_H
14#define LLVM_MC_MCSECTIONELF_H
25/// This represents a section on linux, lots of unix variants and some bare
28 /// This is the sh_type field of a section, drawn from the enums below.
31 /// This is the sh_flags field of a section, drawn from the enums below.
36 /// The size of each entry in this section. This size only makes sense for
37 /// sections that contain fixed-sized entries. If a section does not contain
38 /// fixed-sized entries 'EntrySize' will be 0.
41 /// The section group signature symbol (if not null) and a bool indicating
42 /// whether this is a GRP_COMDAT group.
45 /// Used by SHF_LINK_ORDER. If non-null, the sh_link field will be set to the
46 /// section header index of the section where LinkedToSym is defined.
49 /// Start/end offset in file, used by ELFWriter.
57 // The storage of Name is owned by MCContext's ELFUniquingMap.
59 unsigned entrySize,
const MCSymbolELF *group,
bool IsComdat,
64 Type(type), Flags(flags), UniqueID(UniqueID), EntrySize(entrySize),
65 Group(group, IsComdat), LinkedToSym(LinkedToSym) {
67 "Group section without signature!");
68 if (Group.getPointer())
69 Group.getPointer()->setIsSignature();
78 bool isComdat()
const {
return Group.getInt(); }
84 return &LinkedToSym->getSection();
93 return std::make_pair(StartOffset, EndOffset);
97}
// end namespace llvm
99#endif // LLVM_MC_MCSECTIONELF_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the PointerIntPair class.
const MCSection * getLinkedToSection() const
unsigned getFlags() const
unsigned getUniqueID() const
void setOffsets(uint64_t Start, uint64_t End)
friend class MCAsmInfoELF
void setFlags(unsigned F)
const MCSymbol * getLinkedToSymbol() const
std::pair< uint64_t, uint64_t > getOffsets() const
const MCSymbolELF * getGroup() const
unsigned getEntrySize() const
static constexpr unsigned NonUniqueID
MCSection(StringRef Name, bool IsText, bool IsBss, MCSymbol *Begin)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
PointerIntPair - This class implements a pair of a pointer and small integer.
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.