Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/MC/MCSectionELF.h
Show All 39 Lines | class MCSectionELF final : public MCSection { | ||||
/// The size of each entry in this section. This size only makes sense for | /// The size of each entry in this section. This size only makes sense for | ||||
/// sections that contain fixed-sized entries. If a section does not contain | /// sections that contain fixed-sized entries. If a section does not contain | ||||
/// fixed-sized entries 'EntrySize' will be 0. | /// fixed-sized entries 'EntrySize' will be 0. | ||||
unsigned EntrySize; | unsigned EntrySize; | ||||
const MCSymbolELF *Group; | const MCSymbolELF *Group; | ||||
/// Depending on the type of the section this is sh_link or sh_info. | /// sh_link for REL and RELA sections. | ||||
const MCSectionELF *Associated; | const MCSectionELF *RelInfoSection; | ||||
/// sh_info for SHF_LINK_ORDER (can be null). | |||||
const MCSymbol *AssociatedSymbol; | |||||
private: | private: | ||||
friend class MCContext; | friend class MCContext; | ||||
MCSectionELF(StringRef Section, unsigned type, unsigned flags, SectionKind K, | MCSectionELF(StringRef Section, unsigned type, unsigned flags, SectionKind K, | ||||
unsigned entrySize, const MCSymbolELF *group, unsigned UniqueID, | unsigned entrySize, const MCSymbolELF *group, unsigned UniqueID, | ||||
MCSymbol *Begin, const MCSectionELF *Associated) | MCSymbol *Begin, const MCSymbolELF *AssociatedSymbol) | ||||
: MCSection(SV_ELF, K, Begin), SectionName(Section), Type(type), | : MCSection(SV_ELF, K, Begin), SectionName(Section), Type(type), | ||||
Flags(flags), UniqueID(UniqueID), EntrySize(entrySize), Group(group), | Flags(flags), UniqueID(UniqueID), EntrySize(entrySize), Group(group), | ||||
Associated(Associated) { | RelInfoSection(nullptr), AssociatedSymbol(AssociatedSymbol) { | ||||
if (Group) | if (Group) | ||||
Group->setIsSignature(); | Group->setIsSignature(); | ||||
} | } | ||||
void setSectionName(StringRef Name) { SectionName = Name; } | void setSectionName(StringRef Name) { SectionName = Name; } | ||||
public: | public: | ||||
~MCSectionELF(); | ~MCSectionELF(); | ||||
Show All 13 Lines | void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, | ||||
raw_ostream &OS, | raw_ostream &OS, | ||||
const MCExpr *Subsection) const override; | const MCExpr *Subsection) const override; | ||||
bool UseCodeAlign() const override; | bool UseCodeAlign() const override; | ||||
bool isVirtualSection() const override; | bool isVirtualSection() const override; | ||||
bool isUnique() const { return UniqueID != ~0U; } | bool isUnique() const { return UniqueID != ~0U; } | ||||
unsigned getUniqueID() const { return UniqueID; } | unsigned getUniqueID() const { return UniqueID; } | ||||
const MCSectionELF *getAssociatedSection() const { return Associated; } | const MCSectionELF *getRelInfoSection() const { return RelInfoSection; } | ||||
void setRelInfoSection(const MCSectionELF* S) { RelInfoSection = S; } | |||||
const MCSymbol *getAssociatedSymbol() const { return AssociatedSymbol; } | |||||
pcc: I don't quite follow why you need to change this from storing a section to a symbol. | |||||
Not Done ReplyInline ActionsBecause we need the symbol name when printing textual assembly. eugenis: Because we need the symbol name when printing textual assembly.
| |||||
Not Done ReplyInline ActionsI see. Could you separate the printer fix out into a separate change please? pcc: I see. Could you separate the printer fix out into a separate change please? | |||||
Not Done ReplyInline ActionsSee D30129 eugenis: See D30129 | |||||
static bool classof(const MCSection *S) { | static bool classof(const MCSection *S) { | ||||
return S->getVariant() == SV_ELF; | return S->getVariant() == SV_ELF; | ||||
} | } | ||||
}; | }; | ||||
} // end namespace llvm | } // end namespace llvm | ||||
#endif // LLVM_MC_MCSECTIONELF_H | #endif // LLVM_MC_MCSECTIONELF_H |
I don't quite follow why you need to change this from storing a section to a symbol.