diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-12-09 13:28:42 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-12-09 13:28:42 +0000 |
commit | b1c73532ee8997fe5dfbeb7d223027bdf99758a0 (patch) | |
tree | 7d6e51c294ab6719475d660217aa0c0ad0526292 /lld/ELF/InputSection.h | |
parent | 7fa27ce4a07f19b07799a767fc29416f3b625afb (diff) | |
download | src-b1c73532ee8997fe5dfbeb7d223027bdf99758a0.tar.gz src-b1c73532ee8997fe5dfbeb7d223027bdf99758a0.zip |
Diffstat (limited to 'lld/ELF/InputSection.h')
-rw-r--r-- | lld/ELF/InputSection.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index 15122d6abd6b..fbaea57bd586 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -189,14 +189,17 @@ public: InputSection *getLinkOrderDep() const; - // Get the function symbol that encloses this offset from within the - // section. - Defined *getEnclosingFunction(uint64_t offset); + // Get a symbol that encloses this offset from within the section. If type is + // not zero, return a symbol with the specified type. + Defined *getEnclosingSymbol(uint64_t offset, uint8_t type = 0) const; + Defined *getEnclosingFunction(uint64_t offset) const { + return getEnclosingSymbol(offset, llvm::ELF::STT_FUNC); + } // Returns a source location string. Used to construct an error message. - std::string getLocation(uint64_t offset); - std::string getSrcMsg(const Symbol &sym, uint64_t offset); - std::string getObjMsg(uint64_t offset); + std::string getLocation(uint64_t offset) const; + std::string getSrcMsg(const Symbol &sym, uint64_t offset) const; + std::string getObjMsg(uint64_t offset) const; // Each section knows how to relocate itself. These functions apply // relocations, assuming that Buf points to this section's copy in @@ -396,8 +399,10 @@ public: static InputSection discarded; private: - template <class ELFT, class RelTy> - void copyRelocations(uint8_t *buf, llvm::ArrayRef<RelTy> rels); + template <class ELFT, class RelTy> void copyRelocations(uint8_t *buf); + + template <class ELFT, class RelTy, class RelIt> + void copyRelocations(uint8_t *buf, llvm::iterator_range<RelIt> rels); template <class ELFT> void copyShtGroup(uint8_t *buf); }; |