From dc23dad2b7cd83f42fd9617cd9e9d73cbcf66957 Mon Sep 17 00:00:00 2001 From: Shankar Easwaran Date: Wed, 19 Nov 2014 06:47:29 +0000 Subject: [PATCH] Revert "[ELF] Sectionkey should also contain path." This reverts commit r222309. Reverting because of failures on darwin bot. llvm-svn: 222332 --- lld/lib/ReaderWriter/ELF/DefaultLayout.h | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/lld/lib/ReaderWriter/ELF/DefaultLayout.h b/lld/lib/ReaderWriter/ELF/DefaultLayout.h index 68672ce..383706e 100644 --- a/lld/lib/ReaderWriter/ELF/DefaultLayout.h +++ b/lld/lib/ReaderWriter/ELF/DefaultLayout.h @@ -91,26 +91,24 @@ public: // The sections are created using // SectionName, contentPermissions struct SectionKey { - SectionKey(StringRef name, DefinedAtom::ContentPermissions perm, - StringRef path) - : _name(name), _perm(perm), _path(path) {} + SectionKey(StringRef name, DefinedAtom::ContentPermissions perm) + : _name(name), _perm(perm) { + } // Data members StringRef _name; DefinedAtom::ContentPermissions _perm; - StringRef _path; }; struct SectionKeyHash { int64_t operator()(const SectionKey &k) const { - return llvm::hash_combine(k._name, k._perm, k._path); + return llvm::hash_combine(k._name, k._perm); } }; struct SectionKeyEq { bool operator()(const SectionKey &lhs, const SectionKey &rhs) const { - return ((lhs._name == rhs._name) && (lhs._perm == rhs._perm) && - (lhs._path == rhs._path)); + return ((lhs._name == rhs._name) && (lhs._perm == rhs._perm)); } }; @@ -180,10 +178,9 @@ public: virtual StringRef getSectionName(const DefinedAtom *da) const; /// \brief Gets or creates a section. - AtomSection * - getSection(StringRef name, int32_t contentType, - DefinedAtom::ContentPermissions contentPermissions, - StringRef path); + AtomSection *getSection( + StringRef name, int32_t contentType, + DefinedAtom::ContentPermissions contentPermissions); /// \brief Gets the segment for a output section virtual Layout::SegmentType getSegmentType(Section *section) const; @@ -536,11 +533,10 @@ AtomSection *DefaultLayout::createSection( } template -AtomSection * -DefaultLayout::getSection(StringRef sectionName, int32_t contentType, - DefinedAtom::ContentPermissions permissions, - StringRef path) { - const SectionKey sectionKey(sectionName, permissions, path); +AtomSection *DefaultLayout::getSection( + StringRef sectionName, int32_t contentType, + DefinedAtom::ContentPermissions permissions) { + const SectionKey sectionKey(sectionName, permissions); auto sec = _sectionMap.find(sectionKey); if (sec != _sectionMap.end()) return sec->second; @@ -567,8 +563,8 @@ ErrorOr DefaultLayout::addAtom(const Atom *atom) const DefinedAtom::ContentType contentType = definedAtom->contentType(); StringRef sectionName = getSectionName(definedAtom); - AtomSection *section = getSection( - sectionName, contentType, permissions, definedAtom->file().path()); + AtomSection *section = + getSection(sectionName, contentType, permissions); // Add runtime relocations to the .rela section. for (const auto &reloc : *definedAtom) { -- 2.7.4