aboutsummaryrefslogtreecommitdiff
path: root/llvm/include/llvm/MC/MCContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/MC/MCContext.h')
-rw-r--r--llvm/include/llvm/MC/MCContext.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h
index 877b2dc4ac92..2ff9c967e848 100644
--- a/llvm/include/llvm/MC/MCContext.h
+++ b/llvm/include/llvm/MC/MCContext.h
@@ -374,17 +374,17 @@ namespace llvm {
bool operator<(const ELFEntrySizeKey &Other) const {
if (SectionName != Other.SectionName)
return SectionName < Other.SectionName;
- if (Flags != Other.Flags)
- return Flags < Other.Flags;
+ if ((Flags & ELF::SHF_STRINGS) != (Other.Flags & ELF::SHF_STRINGS))
+ return Other.Flags & ELF::SHF_STRINGS;
return EntrySize < Other.EntrySize;
}
};
- // Symbols must be assigned to a section with a compatible entry size and
- // flags. This map is used to assign unique IDs to sections to distinguish
- // between sections with identical names but incompatible entry sizes and/or
- // flags. This can occur when a symbol is explicitly assigned to a section,
- // e.g. via __attribute__((section("myname"))).
+ // Symbols must be assigned to a section with a compatible entry
+ // size. This map is used to assign unique IDs to sections to
+ // distinguish between sections with identical names but incompatible entry
+ // sizes. This can occur when a symbol is explicitly assigned to a
+ // section, e.g. via __attribute__((section("myname"))).
std::map<ELFEntrySizeKey, unsigned> ELFEntrySizeMap;
// This set is used to record the generic mergeable section names seen.
@@ -592,8 +592,6 @@ namespace llvm {
bool isELFGenericMergeableSection(StringRef Name);
- /// Return the unique ID of the section with the given name, flags and entry
- /// size, if it exists.
Optional<unsigned> getELFUniqueIDForEntsize(StringRef SectionName,
unsigned Flags,
unsigned EntrySize);