aboutsummaryrefslogtreecommitdiffstats
path: root/COFF/Chunks.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-13 19:26:06 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-13 19:26:06 +0000
commit267829774358b5aebd3e726ae318813bd48129bb (patch)
tree5a8904da0d9716ea10b69258f5d50e0b1ee2ec2c /COFF/Chunks.h
parent0317860f00ca8e821989c92c8a6cc461fd5f2009 (diff)
downloadsrc-267829774358b5aebd3e726ae318813bd48129bb.tar.gz
src-267829774358b5aebd3e726ae318813bd48129bb.zip
Vendor import of lld trunk r307894:vendor/lld/lld-trunk-r307894
Notes
Notes: svn path=/vendor/lld/dist/; revision=320965 svn path=/vendor/lld/lld-trunk-r307894/; revision=320966; tag=vendor/lld/lld-trunk-r307894
Diffstat (limited to 'COFF/Chunks.h')
-rw-r--r--COFF/Chunks.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/COFF/Chunks.h b/COFF/Chunks.h
index 6e1bf94da1a5..fc3f5d0df4b6 100644
--- a/COFF/Chunks.h
+++ b/COFF/Chunks.h
@@ -151,6 +151,8 @@ public:
uint64_t P) const;
void applyRelARM(uint8_t *Off, uint16_t Type, OutputSection *OS, uint64_t S,
uint64_t P) const;
+ void applyRelARM64(uint8_t *Off, uint16_t Type, OutputSection *OS, uint64_t S,
+ uint64_t P) const;
// Called if the garbage collector decides to not include this chunk
// in a final output. It's supposed to print out a log message to stdout.
@@ -264,6 +266,12 @@ static const uint8_t ImportThunkARM[] = {
0xdc, 0xf8, 0x00, 0xf0, // ldr.w pc, [ip]
};
+static const uint8_t ImportThunkARM64[] = {
+ 0x10, 0x00, 0x00, 0x90, // adrp x16, #0
+ 0x10, 0x02, 0x40, 0xf9, // ldr x16, [x16]
+ 0x00, 0x02, 0x1f, 0xd6, // br x16
+};
+
// Windows-specific.
// A chunk for DLL import jump table entry. In a final output, it's
// contents will be a JMP instruction to some __imp_ symbol.
@@ -299,6 +307,16 @@ private:
Defined *ImpSymbol;
};
+class ImportThunkChunkARM64 : public Chunk {
+public:
+ explicit ImportThunkChunkARM64(Defined *S) : ImpSymbol(S) {}
+ size_t getSize() const override { return sizeof(ImportThunkARM64); }
+ void writeTo(uint8_t *Buf) const override;
+
+private:
+ Defined *ImpSymbol;
+};
+
// Windows-specific.
// See comments for DefinedLocalImport class.
class LocalImportChunk : public Chunk {