summaryrefslogtreecommitdiffstats
path: root/lld/ELF/SyntheticSections.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r--lld/ELF/SyntheticSections.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index f1b5c77dda0..bd7bbe2c419 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -14,7 +14,6 @@
//===----------------------------------------------------------------------===//
#include "SyntheticSections.h"
-#include "Bits.h"
#include "Config.h"
#include "InputFiles.h"
#include "LinkerScript.h"
@@ -58,6 +57,17 @@ using llvm::support::endian::write64le;
constexpr size_t MergeNoTailSection::NumShards;
+static uint64_t readUint(uint8_t *Buf) {
+ return Config->Is64 ? read64(Buf) : read32(Buf);
+}
+
+static void writeUint(uint8_t *Buf, uint64_t Val) {
+ if (Config->Is64)
+ write64(Buf, Val);
+ else
+ write32(Buf, Val);
+}
+
// Returns an LLD version string.
static ArrayRef<uint8_t> getVersion() {
// Check LLD_VERSION first for ease of testing.
OpenPOWER on IntegriCloud