struct ELFSectionKey {
std::string SectionName;
- std::string GroupName;
- ELFSectionKey(StringRef SectionName, StringRef GroupName)
- : SectionName(SectionName), GroupName(GroupName) {}
+ StringRef GroupName;
+ unsigned UniqueID;
+ ELFSectionKey(StringRef SectionName, StringRef GroupName,
+ unsigned UniqueID)
+ : SectionName(SectionName), GroupName(GroupName), UniqueID(UniqueID) {
+ }
bool operator<(const ELFSectionKey &Other) const {
if (SectionName != Other.SectionName)
return SectionName < Other.SectionName;
- return GroupName < Other.GroupName;
+ if (GroupName != Other.GroupName)
+ return GroupName < Other.GroupName;
+ return UniqueID < Other.UniqueID;
}
};
struct COFFSectionKey {
std::string SectionName;
- std::string GroupName;
+ StringRef GroupName;
int SelectionKey;
COFFSectionKey(StringRef SectionName, StringRef GroupName,
int SelectionKey)
StringMap<const MCSectionMachO*> MachOUniquingMap;
std::map<ELFSectionKey, const MCSectionELF *> ELFUniquingMap;
std::map<COFFSectionKey, const MCSectionCOFF *> COFFUniquingMap;
+ StringMap<bool> ELFRelSecNames;
/// Do automatic reset in destructor
bool AutoReset;
MCSymbol *getOrCreateSectionSymbol(const MCSectionELF &Section);
MCSymbol *getOrCreateFrameAllocSymbol(StringRef FuncName, unsigned Idx);
+ MCSymbol *getOrCreateParentFrameOffsetSymbol(StringRef FuncName);
/// Get the symbol for \p Name, or null.
MCSymbol *LookupSymbol(const Twine &Name) const;
const MCSectionELF *getELFSection(StringRef Section, unsigned Type,
unsigned Flags, unsigned EntrySize,
- StringRef Group, bool Unique,
+ StringRef Group, unsigned UniqueID,
const char *BeginSymName = nullptr);
+ const MCSectionELF *createELFRelSection(StringRef Name, unsigned Type,
+ unsigned Flags, unsigned EntrySize,
+ const MCSymbol *Group);
+
void renameELFSection(const MCSectionELF *Section, StringRef Name);
const MCSectionELF *CreateELFGroupSection();