diff options
Diffstat (limited to 'lld/lib/ReaderWriter')
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/ArchHandler.h | 38 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/ArchHandler_arm.cpp | 18 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp | 22 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp | 40 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/File.h | 14 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/GOTPass.cpp | 12 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp | 2 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp | 2 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | 38 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/StubsPass.cpp | 12 |
10 files changed, 99 insertions, 99 deletions
diff --git a/lld/lib/ReaderWriter/MachO/ArchHandler.h b/lld/lib/ReaderWriter/MachO/ArchHandler.h index 5f42abd30ba..7f0961ebc80 100644 --- a/lld/lib/ReaderWriter/MachO/ArchHandler.h +++ b/lld/lib/ReaderWriter/MachO/ArchHandler.h @@ -29,15 +29,15 @@ namespace mach_o { class ArchHandler { public: virtual ~ArchHandler(); - + /// There is no public interface to subclasses of ArchHandler, so this /// is the only way to instantiate an ArchHandler. static std::unique_ptr<ArchHandler> create(MachOLinkingContext::Arch arch); /// Get (arch specific) kind strings used by Registry. virtual const Registry::KindStrings *kindStrings() = 0; - - /// Convert mach-o Arch to Reference::KindArch. + + /// Convert mach-o Arch to Reference::KindArch. virtual Reference::KindArch kindArch() = 0; /// Used by StubPass to update References to shared library functions @@ -88,48 +88,48 @@ public: virtual const Atom *fdeTargetFunction(const DefinedAtom *fde); - /// Used by normalizedFromAtoms() to know where to generated rebasing and + /// Used by normalizedFromAtoms() to know where to generated rebasing and /// binding info in final executables. virtual bool isPointer(const Reference &) = 0; - - /// Used by normalizedFromAtoms() to know where to generated lazy binding + + /// Used by normalizedFromAtoms() to know where to generated lazy binding /// info in final executables. virtual bool isLazyPointer(const Reference &); /// Returns true if the specified relocation is paired to the next relocation. virtual bool isPairedReloc(const normalized::Relocation &) = 0; - /// Prototype for a helper function. Given a sectionIndex and address, - /// finds the atom and offset with that atom of that address. - typedef std::function<std::error_code (uint32_t sectionIndex, uint64_t addr, - const lld::Atom **, Reference::Addend *)> + /// Prototype for a helper function. Given a sectionIndex and address, + /// finds the atom and offset with that atom of that address. + typedef std::function<std::error_code (uint32_t sectionIndex, uint64_t addr, + const lld::Atom **, Reference::Addend *)> FindAtomBySectionAndAddress; - + /// Prototype for a helper function. Given a symbolIndex, finds the atom /// representing that symbol. - typedef std::function<std::error_code (uint32_t symbolIndex, + typedef std::function<std::error_code (uint32_t symbolIndex, const lld::Atom **)> FindAtomBySymbolIndex; /// Analyzes a relocation from a .o file and returns the info /// (kind, target, addend) needed to instantiate a Reference. /// Two helper functions are passed as parameters to find the target atom /// given a symbol index or address. - virtual std::error_code + virtual std::error_code getReferenceInfo(const normalized::Relocation &reloc, const DefinedAtom *inAtom, uint32_t offsetInAtom, uint64_t fixupAddress, bool isBigEndian, FindAtomBySectionAndAddress atomFromAddress, FindAtomBySymbolIndex atomFromSymbolIndex, - Reference::KindValue *kind, - const lld::Atom **target, + Reference::KindValue *kind, + const lld::Atom **target, Reference::Addend *addend) = 0; /// Analyzes a pair of relocations from a .o file and returns the info /// (kind, target, addend) needed to instantiate a Reference. /// Two helper functions are passed as parameters to find the target atom /// given a symbol index or address. - virtual std::error_code + virtual std::error_code getPairReferenceInfo(const normalized::Relocation &reloc1, const normalized::Relocation &reloc2, const DefinedAtom *inAtom, @@ -137,8 +137,8 @@ public: uint64_t fixupAddress, bool isBig, bool scatterable, FindAtomBySectionAndAddress atomFromAddress, FindAtomBySymbolIndex atomFromSymbolIndex, - Reference::KindValue *kind, - const lld::Atom **target, + Reference::KindValue *kind, + const lld::Atom **target, Reference::Addend *addend) = 0; /// Prototype for a helper function. Given an atom, finds the symbol table @@ -234,7 +234,7 @@ public: ReferenceInfo lazyPointerReferenceToFinal; ReferenceInfo nonLazyPointerReferenceToBinder; uint8_t codeAlignment; - + uint32_t stubSize; uint8_t stubBytes[16]; ReferenceInfo stubReferenceToLP; diff --git a/lld/lib/ReaderWriter/MachO/ArchHandler_arm.cpp b/lld/lib/ReaderWriter/MachO/ArchHandler_arm.cpp index 8256706c8a4..43f88a1d30d 100644 --- a/lld/lib/ReaderWriter/MachO/ArchHandler_arm.cpp +++ b/lld/lib/ReaderWriter/MachO/ArchHandler_arm.cpp @@ -176,13 +176,13 @@ private: static uint16_t getWordFromThumbMov(uint32_t instruction); static uint16_t getWordFromArmMov(uint32_t instruction); static uint32_t clearThumbBit(uint32_t value, const Atom *target); - static uint32_t setDisplacementInArmBranch(uint32_t instr, int32_t disp, + static uint32_t setDisplacementInArmBranch(uint32_t instr, int32_t disp, bool targetIsThumb); static uint32_t setDisplacementInThumbBranch(uint32_t instr, uint32_t ia, int32_t disp, bool targetThumb); static uint32_t setWordFromThumbMov(uint32_t instruction, uint16_t word); static uint32_t setWordFromArmMov(uint32_t instruction, uint16_t word); - + StringRef stubName(const DefinedAtom &); bool useExternalRelocationTo(const Atom &target); @@ -233,25 +233,25 @@ const Registry::KindStrings ArchHandler_arm::_sKindStrings[] = { const ArchHandler::StubInfo ArchHandler_arm::_sStubInfoArmPIC = { "dyld_stub_binder", - // References in lazy pointer + // References in lazy pointer { Reference::KindArch::ARM, pointer32, 0, 0 }, { Reference::KindArch::ARM, lazyPointer, 0, 0 }, - + // GOT pointer to dyld_stub_binder { Reference::KindArch::ARM, pointer32, 0, 0 }, // arm code alignment 2^2 - 2, - + 2, + // Stub size and code - 16, + 16, { 0x04, 0xC0, 0x9F, 0xE5, // ldr ip, pc + 12 0x0C, 0xC0, 0x8F, 0xE0, // add ip, pc, ip 0x00, 0xF0, 0x9C, 0xE5, // ldr pc, [ip] 0x00, 0x00, 0x00, 0x00 }, // .long L_foo$lazy_ptr - (L1$scv + 8) { Reference::KindArch::ARM, delta32, 12, 0 }, { false, 0, 0, 0 }, - + // Stub Helper size and code 12, { 0x00, 0xC0, 0x9F, 0xE5, // ldr ip, [pc, #0] @@ -259,7 +259,7 @@ const ArchHandler::StubInfo ArchHandler_arm::_sStubInfoArmPIC = { 0x00, 0x00, 0x00, 0x00 }, // .long lazy-info-offset { Reference::KindArch::ARM, lazyImmediateLocation, 8, 0 }, { Reference::KindArch::ARM, arm_b24, 4, 0 }, - + // Stub Helper-Common size and code 36, { // push lazy-info-offset diff --git a/lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp b/lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp index 4f83cd1ca6c..19c8780e707 100644 --- a/lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp +++ b/lld/lib/ReaderWriter/MachO/ArchHandler_x86.cpp @@ -152,7 +152,7 @@ private: lazyPointer, /// Location contains a lazy pointer. lazyImmediateLocation, /// Location contains immediate value used in stub. }; - + static bool useExternalRelocationTo(const Atom &target); void applyFixupFinal(const Reference &ref, uint8_t *location, @@ -170,9 +170,9 @@ private: //===----------------------------------------------------------------------===// ArchHandler_x86::ArchHandler_x86() {} - + ArchHandler_x86::~ArchHandler_x86() { } - + const Registry::KindStrings ArchHandler_x86::_sKindStrings[] = { LLD_KIND_STRING_ENTRY(invalid), LLD_KIND_STRING_ENTRY(modeCode), @@ -192,29 +192,29 @@ const Registry::KindStrings ArchHandler_x86::_sKindStrings[] = { const ArchHandler::StubInfo ArchHandler_x86::_sStubInfo = { "dyld_stub_binder", - // Lazy pointer references + // Lazy pointer references { Reference::KindArch::x86, pointer32, 0, 0 }, { Reference::KindArch::x86, lazyPointer, 0, 0 }, - + // GOT pointer to dyld_stub_binder { Reference::KindArch::x86, pointer32, 0, 0 }, // x86 code alignment - 1, - + 1, + // Stub size and code - 6, + 6, { 0xff, 0x25, 0x00, 0x00, 0x00, 0x00 }, // jmp *lazyPointer { Reference::KindArch::x86, abs32, 2, 0 }, { false, 0, 0, 0 }, - + // Stub Helper size and code 10, { 0x68, 0x00, 0x00, 0x00, 0x00, // pushl $lazy-info-offset 0xE9, 0x00, 0x00, 0x00, 0x00 }, // jmp helperhelper { Reference::KindArch::x86, lazyImmediateLocation, 1, 0 }, { Reference::KindArch::x86, branch32, 6, 0 }, - + // Stub Helper-Common size and code 12, { 0x68, 0x00, 0x00, 0x00, 0x00, // pushl $dyld_ImageLoaderCache @@ -375,7 +375,7 @@ ArchHandler_x86::getPairReferenceInfo(const normalized::Relocation &reloc1, if (ec) return ec; if (fromTarget != inAtom) { - if (*target != inAtom) + if (*target != inAtom) return make_dynamic_error_code(Twine("SECTDIFF relocation where " "neither target is in atom")); *kind = negDelta32; diff --git a/lld/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp b/lld/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp index 422486a7c2f..81fe1af42d7 100644 --- a/lld/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp +++ b/lld/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp @@ -121,10 +121,10 @@ public: uint64_t fixupAddress, bool swap, FindAtomBySectionAndAddress atomFromAddress, FindAtomBySymbolIndex atomFromSymbolIndex, - Reference::KindValue *kind, - const lld::Atom **target, + Reference::KindValue *kind, + const lld::Atom **target, Reference::Addend *addend) override; - std::error_code + std::error_code getPairReferenceInfo(const normalized::Relocation &reloc1, const normalized::Relocation &reloc2, const DefinedAtom *inAtom, @@ -132,8 +132,8 @@ public: uint64_t fixupAddress, bool swap, bool scatterable, FindAtomBySectionAndAddress atomFromAddress, FindAtomBySymbolIndex atomFromSymbolIndex, - Reference::KindValue *kind, - const lld::Atom **target, + Reference::KindValue *kind, + const lld::Atom **target, Reference::Addend *addend) override; bool needsLocalSymbolInRelocatableFile(const DefinedAtom *atom) override { @@ -160,7 +160,7 @@ private: enum X86_64Kind: Reference::KindValue { invalid, /// for error condition - + // Kinds found in mach-o .o files: branch32, /// ex: call _foo ripRel32, /// ex: movq _foo(%rip), %rax @@ -179,7 +179,7 @@ private: negDelta32, /// ex: .long . - _foo // Kinds introduced by Passes: - ripRel32GotLoadNowLea, /// Target of GOT load is in linkage unit so + ripRel32GotLoadNowLea, /// Target of GOT load is in linkage unit so /// "movq _foo@GOTPCREL(%rip), %rax" can be changed /// to "leaq _foo(%rip), %rax lazyPointer, /// Location contains a lazy pointer. @@ -235,29 +235,29 @@ const Registry::KindStrings ArchHandler_x86_64::_sKindStrings[] = { const ArchHandler::StubInfo ArchHandler_x86_64::_sStubInfo = { "dyld_stub_binder", - // Lazy pointer references + // Lazy pointer references { Reference::KindArch::x86_64, pointer64, 0, 0 }, { Reference::KindArch::x86_64, lazyPointer, 0, 0 }, - + // GOT pointer to dyld_stub_binder { Reference::KindArch::x86_64, pointer64, 0, 0 }, // x86_64 code alignment 2^1 - 1, - + 1, + // Stub size and code - 6, + 6, { 0xff, 0x25, 0x00, 0x00, 0x00, 0x00 }, // jmp *lazyPointer { Reference::KindArch::x86_64, ripRel32, 2, 0 }, { false, 0, 0, 0 }, - + // Stub Helper size and code 10, { 0x68, 0x00, 0x00, 0x00, 0x00, // pushq $lazy-info-offset 0xE9, 0x00, 0x00, 0x00, 0x00 }, // jmp helperhelper { Reference::KindArch::x86_64, lazyImmediateLocation, 1, 0 }, { Reference::KindArch::x86_64, branch32, 6, 0 }, - + // Stub Helper-Common size and code 16, { 0x4C, 0x8D, 0x1D, 0x00, 0x00, 0x00, 0x00, // leaq cache(%rip),%r11 @@ -268,7 +268,7 @@ const ArchHandler::StubInfo ArchHandler_x86_64::_sStubInfo = { { false, 0, 0, 0 }, { Reference::KindArch::x86_64, ripRel32, 11, 0 }, { false, 0, 0, 0 } - + }; bool ArchHandler_x86_64::isCallSite(const Reference &ref) { @@ -318,15 +318,15 @@ ArchHandler_x86_64::kindFromReloc(const Relocation &reloc) { } } -std::error_code +std::error_code ArchHandler_x86_64::getReferenceInfo(const Relocation &reloc, const DefinedAtom *inAtom, uint32_t offsetInAtom, uint64_t fixupAddress, bool swap, FindAtomBySectionAndAddress atomFromAddress, FindAtomBySymbolIndex atomFromSymbolIndex, - Reference::KindValue *kind, - const lld::Atom **target, + Reference::KindValue *kind, + const lld::Atom **target, Reference::Addend *addend) { typedef std::error_code E; *kind = kindFromReloc(reloc); @@ -408,8 +408,8 @@ ArchHandler_x86_64::getPairReferenceInfo(const normalized::Relocation &reloc1, bool scatterable, FindAtomBySectionAndAddress atomFromAddress, FindAtomBySymbolIndex atomFromSymbolIndex, - Reference::KindValue *kind, - const lld::Atom **target, + Reference::KindValue *kind, + const lld::Atom **target, Reference::Addend *addend) { *kind = kindFromRelocPair(reloc1, reloc2); if (*kind == invalid) diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h index 9cc7e37eb5a..913644ec1fc 100644 --- a/lld/lib/ReaderWriter/MachO/File.h +++ b/lld/lib/ReaderWriter/MachO/File.h @@ -115,7 +115,7 @@ public: addAtom(*atom); _undefAtoms[name] = atom; } - + /// Search this file for an the atom from 'section' that covers /// 'offsetInSect'. Returns nullptr is no atom found. MachODefinedAtom *findAtomCoveringAddress(const Section §ion, @@ -128,7 +128,7 @@ public: assert(offsetInSect < section.content.size()); // Vector of atoms for section are already sorted, so do binary search. const auto &atomPos = std::lower_bound(vec.begin(), vec.end(), offsetInSect, - [offsetInSect](const SectionOffsetAndAtom &ao, + [offsetInSect](const SectionOffsetAndAtom &ao, uint64_t targetAddr) -> bool { // Each atom has a start offset of its slice of the // section's content. This compare function must return true @@ -151,7 +151,7 @@ public: return nullptr; return pos->second; } - + typedef std::function<void (MachODefinedAtom* atom)> DefinedAtomVisitor; void eachDefinedAtom(DefinedAtomVisitor vistor) { @@ -187,11 +187,11 @@ protected: return ec; return std::error_code(); } - + private: struct SectionOffsetAndAtom { uint64_t offset; MachODefinedAtom *atom; }; - void addAtomForSection(const Section *inSection, MachODefinedAtom* atom, + void addAtomForSection(const Section *inSection, MachODefinedAtom* atom, uint64_t sectionOffset) { SectionOffsetAndAtom offAndAtom; offAndAtom.offset = sectionOffset; @@ -200,8 +200,8 @@ private: addAtom(*atom); } - - typedef llvm::DenseMap<const normalized::Section *, + + typedef llvm::DenseMap<const normalized::Section *, std::vector<SectionOffsetAndAtom>> SectionToAtoms; typedef llvm::StringMap<const lld::Atom *> NameToAtom; diff --git a/lld/lib/ReaderWriter/MachO/GOTPass.cpp b/lld/lib/ReaderWriter/MachO/GOTPass.cpp index 55050adb668..9c5ed9cff72 100644 --- a/lld/lib/ReaderWriter/MachO/GOTPass.cpp +++ b/lld/lib/ReaderWriter/MachO/GOTPass.cpp @@ -88,12 +88,12 @@ private: /// Pass for instantiating and optimizing GOT slots. -/// +/// class GOTPass : public Pass { public: GOTPass(const MachOLinkingContext &context) : _context(context), _archHandler(_context.archHandler()), - _file("<mach-o GOT Pass>") { } + _file("<mach-o GOT Pass>") { } private: @@ -150,11 +150,11 @@ private: // by-passed, do that optimization and don't create GOT entry. return !canBypassGOT; } - + const DefinedAtom *makeGOTEntry(const Atom *target) { auto pos = _targetToGOT.find(target); if (pos == _targetToGOT.end()) { - GOTEntryAtom *gotEntry = new (_file.allocator()) + GOTEntryAtom *gotEntry = new (_file.allocator()) GOTEntryAtom(_file, _context.is64Bit(), target->name()); _targetToGOT[target] = gotEntry; const ArchHandler::ReferenceInfo &nlInfo = _archHandler.stubInfo(). @@ -166,7 +166,7 @@ private: return pos->second; } - + const MachOLinkingContext &_context; mach_o::ArchHandler &_archHandler; MachOFile _file; @@ -179,7 +179,7 @@ void addGOTPass(PassManager &pm, const MachOLinkingContext &ctx) { assert(ctx.needsGOTPass()); pm.add(llvm::make_unique<GOTPass>(ctx)); } - + } // end namesapce mach_o } // end namesapce lld diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp index 052b64eb3eb..07a6dbfe569 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp @@ -572,7 +572,7 @@ void Registry::addSupportMachOObjects(MachOLinkingContext &ctx) { MachOLinkingContext::Arch arch = ctx.arch(); add(std::unique_ptr<Reader>(new mach_o::normalized::MachOObjectReader(ctx))); add(std::unique_ptr<Reader>(new mach_o::normalized::MachODylibReader(ctx))); - addKindTable(Reference::KindNamespace::mach_o, ctx.archHandler().kindArch(), + addKindTable(Reference::KindNamespace::mach_o, ctx.archHandler().kindArch(), ctx.archHandler().kindStrings()); add(std::unique_ptr<YamlIOTaggedDocumentHandler>( new mach_o::MachOYamlIOTaggedDocumentHandler(arch))); diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp index 78c61d05393..4d6183f71df 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp @@ -206,7 +206,7 @@ SectionInfo *Util::getRelocatableSection(DefinedAtom::ContentType type) { } } // Otherwise allocate new SectionInfo object. - SectionInfo *sect = new (_allocator) SectionInfo(segmentName, sectionName, + SectionInfo *sect = new (_allocator) SectionInfo(segmentName, sectionName, sectionType, _context, sectionAttrs); _sectionInfos.push_back(sect); diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp index 1c22ecf1127..124e0eaffee 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -138,39 +138,39 @@ void sectionParseInfo(DefinedAtom::ContentType atomType, {DefinedAtom::type, size, DefinedAtom::scope, DefinedAtom::merge, model } static const ParseInfo parseInfo[] = { - ENTRY(typeCode, 1, scopeGlobal, mergeNo, + ENTRY(typeCode, 1, scopeGlobal, mergeNo, atomizeAtSymbols), - ENTRY(typeData, 1, scopeGlobal, mergeNo, + ENTRY(typeData, 1, scopeGlobal, mergeNo, atomizeAtSymbols), - ENTRY(typeConstData, 1, scopeGlobal, mergeNo, + ENTRY(typeConstData, 1, scopeGlobal, mergeNo, atomizeAtSymbols), - ENTRY(typeZeroFill, 1, scopeGlobal, mergeNo, + ENTRY(typeZeroFill, 1, scopeGlobal, mergeNo, atomizeAtSymbols), - ENTRY(typeConstant, 1, scopeGlobal, mergeNo, + ENTRY(typeConstant, 1, scopeGlobal, mergeNo, atomizeAtSymbols), - ENTRY(typeCString, 1, scopeLinkageUnit, mergeByContent, + ENTRY(typeCString, 1, scopeLinkageUnit, mergeByContent, atomizeUTF8), - ENTRY(typeUTF16String, 1, scopeLinkageUnit, mergeByContent, + ENTRY(typeUTF16String, 1, scopeLinkageUnit, mergeByContent, atomizeUTF16), ENTRY(typeCFI, 4, scopeTranslationUnit, mergeNo, atomizeCFI), - ENTRY(typeLiteral4, 4, scopeLinkageUnit, mergeByContent, + ENTRY(typeLiteral4, 4, scopeLinkageUnit, mergeByContent, atomizeFixedSize), - ENTRY(typeLiteral8, 8, scopeLinkageUnit, mergeByContent, + ENTRY(typeLiteral8, 8, scopeLinkageUnit, mergeByContent, atomizeFixedSize), - ENTRY(typeLiteral16, 16, scopeLinkageUnit, mergeByContent, + ENTRY(typeLiteral16, 16, scopeLinkageUnit, mergeByContent, atomizeFixedSize), - ENTRY(typeCFString, 4, scopeLinkageUnit, mergeByContent, + ENTRY(typeCFString, 4, scopeLinkageUnit, mergeByContent, atomizeCFString), - ENTRY(typeInitializerPtr, 4, scopeTranslationUnit, mergeNo, + ENTRY(typeInitializerPtr, 4, scopeTranslationUnit, mergeNo, atomizePointerSize), - ENTRY(typeTerminatorPtr, 4, scopeTranslationUnit, mergeNo, + ENTRY(typeTerminatorPtr, 4, scopeTranslationUnit, mergeNo, atomizePointerSize), - ENTRY(typeCompactUnwindInfo, 4, scopeTranslationUnit, mergeNo, + ENTRY(typeCompactUnwindInfo, 4, scopeTranslationUnit, mergeNo, atomizeCU), - ENTRY(typeGOT, 4, scopeLinkageUnit, mergeByContent, + ENTRY(typeGOT, 4, scopeLinkageUnit, mergeByContent, atomizePointerSize), - ENTRY(typeUnknown, 1, scopeGlobal, mergeNo, + ENTRY(typeUnknown, 1, scopeGlobal, mergeNo, atomizeAtSymbols) }; #undef ENTRY @@ -300,8 +300,8 @@ std::error_code processSymboledSection(DefinedAtom::ContentType atomType, // Debug logging of symbols. //for (const Symbol *sym : symbols) - // llvm::errs() << " sym: " - // << llvm::format("0x%08llx ", (uint64_t)sym->value) + // llvm::errs() << " sym: " + // << llvm::format("0x%08llx ", (uint64_t)sym->value) // << ", " << sym->name << "\n"; // If section has no symbols and no content, there are no atoms. @@ -622,7 +622,7 @@ std::error_code convertRelocs(const Section §ion, + ")" ); } else { // Instantiate an lld::Reference object and add to its atom. - inAtom->addReference(offsetInAtom, kind, target, addend, + inAtom->addReference(offsetInAtom, kind, target, addend, handler.kindArch()); } } diff --git a/lld/lib/ReaderWriter/MachO/StubsPass.cpp b/lld/lib/ReaderWriter/MachO/StubsPass.cpp index 38af5597618..0e97f35e925 100644 --- a/lld/lib/ReaderWriter/MachO/StubsPass.cpp +++ b/lld/lib/ReaderWriter/MachO/StubsPass.cpp @@ -36,7 +36,7 @@ namespace mach_o { // class LazyPointerAtom : public SimpleDefinedAtom { public: - LazyPointerAtom(const File &file, bool is64) + LazyPointerAtom(const File &file, bool is64) : SimpleDefinedAtom(file), _is64(is64) { } ContentType contentType() const override { @@ -71,7 +71,7 @@ private: // class NonLazyPointerAtom : public SimpleDefinedAtom { public: - NonLazyPointerAtom(const File &file, bool is64) + NonLazyPointerAtom(const File &file, bool is64) : SimpleDefinedAtom(file), _is64(is64) { } ContentType contentType() const override { @@ -160,7 +160,7 @@ public: } ArrayRef<uint8_t> rawContent() const override { - return llvm::makeArrayRef(_stubInfo.stubHelperBytes, + return llvm::makeArrayRef(_stubInfo.stubHelperBytes, _stubInfo.stubHelperSize); } @@ -194,7 +194,7 @@ public: } ArrayRef<uint8_t> rawContent() const override { - return llvm::makeArrayRef(_stubInfo.stubHelperCommonBytes, + return llvm::makeArrayRef(_stubInfo.stubHelperCommonBytes, _stubInfo.stubHelperCommonSize); } @@ -214,7 +214,7 @@ public: // Skip this pass if output format uses text relocations instead of stubs. if (!this->noTextRelocs()) return; - + // Scan all references in all atoms. for (const DefinedAtom *atom : mergedFile->defined()) { for (const Reference *ref : *atom) { @@ -329,7 +329,7 @@ private: bool isCallSite(const Reference &ref) { return _archHandler.isCallSite(ref); } - + void addReference(SimpleDefinedAtom* atom, const ArchHandler::ReferenceInfo &refInfo, const lld::Atom* target) { |

