summaryrefslogtreecommitdiff
path: root/lld/COFF/Chunks.h
diff options
context:
space:
mode:
Diffstat (limited to 'lld/COFF/Chunks.h')
-rw-r--r--lld/COFF/Chunks.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/lld/COFF/Chunks.h b/lld/COFF/Chunks.h
index 7ae4ee735f4a..0528143383c5 100644
--- a/lld/COFF/Chunks.h
+++ b/lld/COFF/Chunks.h
@@ -269,7 +269,8 @@ public:
AssociatedIterator() = default;
AssociatedIterator(SectionChunk *head) : cur(head) {}
bool operator==(const AssociatedIterator &r) const { return cur == r.cur; }
- const SectionChunk &operator*() const { return *cur; }
+ // FIXME: Wrong const-ness, but it makes filter ranges work.
+ SectionChunk &operator*() const { return *cur; }
SectionChunk &operator*() { return *cur; }
AssociatedIterator &operator++() {
cur = cur->assocChildren;
@@ -486,7 +487,9 @@ public:
class ImportThunkChunkARM : public ImportThunkChunk {
public:
- explicit ImportThunkChunkARM(Defined *s) : ImportThunkChunk(s) {}
+ explicit ImportThunkChunkARM(Defined *s) : ImportThunkChunk(s) {
+ setAlignment(2);
+ }
size_t getSize() const override { return sizeof(importThunkARM); }
void getBaserels(std::vector<Baserel> *res) override;
void writeTo(uint8_t *buf) const override;
@@ -494,14 +497,16 @@ public:
class ImportThunkChunkARM64 : public ImportThunkChunk {
public:
- explicit ImportThunkChunkARM64(Defined *s) : ImportThunkChunk(s) {}
+ explicit ImportThunkChunkARM64(Defined *s) : ImportThunkChunk(s) {
+ setAlignment(4);
+ }
size_t getSize() const override { return sizeof(importThunkARM64); }
void writeTo(uint8_t *buf) const override;
};
class RangeExtensionThunkARM : public NonSectionChunk {
public:
- explicit RangeExtensionThunkARM(Defined *t) : target(t) {}
+ explicit RangeExtensionThunkARM(Defined *t) : target(t) { setAlignment(2); }
size_t getSize() const override;
void writeTo(uint8_t *buf) const override;