aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lld/COFF/Chunks.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lld/COFF/Chunks.h')
-rw-r--r--contrib/llvm-project/lld/COFF/Chunks.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/llvm-project/lld/COFF/Chunks.h b/contrib/llvm-project/lld/COFF/Chunks.h
index 0528143383c5..e076d8e71109 100644
--- a/contrib/llvm-project/lld/COFF/Chunks.h
+++ b/contrib/llvm-project/lld/COFF/Chunks.h
@@ -204,6 +204,15 @@ public:
ArrayRef<uint8_t> getContents() const;
void writeTo(uint8_t *buf) const;
+ // Defend against unsorted relocations. This may be overly conservative.
+ void sortRelocations();
+
+ // Write and relocate a portion of the section. This is intended to be called
+ // in a loop. Relocations must be sorted first.
+ void writeAndRelocateSubsection(ArrayRef<uint8_t> sec,
+ ArrayRef<uint8_t> subsec,
+ uint32_t &nextRelocIndex, uint8_t *buf) const;
+
uint32_t getOutputCharacteristics() const {
return header->Characteristics & (permMask | typeMask);
}
@@ -212,6 +221,7 @@ public:
}
void getBaserels(std::vector<Baserel> *res);
bool isCOMDAT() const;
+ void applyRelocation(uint8_t *off, const coff_relocation &rel) const;
void applyRelX64(uint8_t *off, uint16_t type, OutputSection *os, uint64_t s,
uint64_t p) const;
void applyRelX86(uint8_t *off, uint16_t type, OutputSection *os, uint64_t s,