[lld] r196853 - Revert "Remove makeArrayRef() calls."
Rui Ueyama
ruiu at google.com
Mon Dec 9 16:42:52 PST 2013
Author: ruiu
Date: Mon Dec 9 18:42:52 2013
New Revision: 196853
URL: http://llvm.org/viewvc/llvm-project?rev=196853&view=rev
Log:
Revert "Remove makeArrayRef() calls."
This reverts commit r196475 because it made the build to fail with
GCC 4.7/4.8/4.9. Reported by Mikael Lyngvig.
Modified:
lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp
lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp
Modified: lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h?rev=196853&r1=196852&r2=196853&view=diff
==============================================================================
--- lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h (original)
+++ lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h Mon Dec 9 18:42:52 2013
@@ -47,7 +47,7 @@ public:
_createManifest(true), _embedManifest(false), _manifestId(1),
_manifestLevel("'asInvoker'"), _manifestUiAccess("'false'"),
_imageType(ImageType::IMAGE_EXE),
- _dosStub(DEFAULT_DOS_STUB) {
+ _dosStub(llvm::makeArrayRef(DEFAULT_DOS_STUB)) {
setDeadStripping(true);
}
Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp?rev=196853&r1=196852&r2=196853&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp Mon Dec 9 18:42:52 2013
@@ -14,6 +14,8 @@ using namespace lld;
using namespace elf;
using namespace llvm::ELF;
+using llvm::makeArrayRef;
+
HexagonTargetHandler::HexagonTargetHandler(HexagonLinkingContext &context)
: DefaultTargetHandler(context), _targetLayout(context),
_relocationHandler(context, *this, _targetLayout),
@@ -53,7 +55,7 @@ public:
HexagonGOTAtom(const File &f) : GOTAtom(f, ".got") {}
virtual ArrayRef<uint8_t> rawContent() const {
- return hexagonGotAtomContent;
+ return makeArrayRef(hexagonGotAtomContent);
}
virtual Alignment alignment() const { return Alignment(2); }
@@ -64,7 +66,7 @@ public:
HexagonGOTPLTAtom(const File &f) : GOTAtom(f, ".got.plt") {}
virtual ArrayRef<uint8_t> rawContent() const {
- return hexagonGotPltAtomContent;
+ return makeArrayRef(hexagonGotPltAtomContent);
}
virtual Alignment alignment() const { return Alignment(2); }
@@ -75,7 +77,7 @@ public:
HexagonGOTPLT0Atom(const File &f) : GOTAtom(f, ".got.plt") {}
virtual ArrayRef<uint8_t> rawContent() const {
- return hexagonGotPlt0AtomContent;
+ return makeArrayRef(hexagonGotPlt0AtomContent);
}
virtual Alignment alignment() const { return Alignment(3); }
@@ -90,7 +92,7 @@ public:
}
virtual ArrayRef<uint8_t> rawContent() const {
- return hexagonPlt0AtomContent;
+ return makeArrayRef(hexagonPlt0AtomContent);
}
};
@@ -100,7 +102,7 @@ public:
HexagonPLTAtom(const File &f, StringRef secName) : PLTAtom(f, secName) {}
virtual ArrayRef<uint8_t> rawContent() const {
- return hexagonPltAtomContent;
+ return makeArrayRef(hexagonPltAtomContent);
}
};
Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp?rev=196853&r1=196852&r2=196853&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp Mon Dec 9 18:42:52 2013
@@ -21,6 +21,8 @@
using namespace lld;
using namespace lld::elf;
+using llvm::makeArrayRef;
+
namespace {
using namespace llvm::ELF;
@@ -37,7 +39,7 @@ public:
#endif
}
virtual ArrayRef<uint8_t> rawContent() const {
- return x86_64InitFiniAtomContent;
+ return makeArrayRef(x86_64InitFiniAtomContent);
}
virtual Alignment alignment() const { return Alignment(3); }
};
@@ -51,9 +53,8 @@ public:
_name += function;
#endif
}
-
virtual ArrayRef<uint8_t> rawContent() const {
- return x86_64InitFiniAtomContent;
+ return makeArrayRef(x86_64InitFiniAtomContent);
}
virtual Alignment alignment() const { return Alignment(3); }
Modified: lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp?rev=196853&r1=196852&r2=196853&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp Mon Dec 9 18:42:52 2013
@@ -19,6 +19,8 @@
#include "ReferenceKinds.h"
+using llvm::makeArrayRef;
+
namespace lld {
namespace mach_o {
@@ -48,7 +50,7 @@ public:
static const uint8_t instructions[] =
{ 0xFF, 0x25, 0x00, 0x00, 0x00, 0x00 }; // jmp *lazyPointer
assert(sizeof(instructions) == this->size());
- return instructions;
+ return makeArrayRef(instructions);
}
};
@@ -83,7 +85,7 @@ public:
0xFF, 0x25, 0x00, 0x00, 0x00, 0x00, // jmp *_fast_lazy_bind
0x90 }; // nop
assert(sizeof(instructions) == this->size());
- return instructions;
+ return makeArrayRef(instructions);
}
};
@@ -116,7 +118,7 @@ public:
{ 0x68, 0x00, 0x00, 0x00, 0x00, // pushq $lazy-info-offset
0xE9, 0x00, 0x00, 0x00, 0x00 }; // jmp helperhelper
assert(sizeof(instructions) == this->size());
- return instructions;
+ return makeArrayRef(instructions);
}
};
@@ -150,7 +152,7 @@ public:
virtual ArrayRef<uint8_t> rawContent() const {
static const uint8_t bytes[] = { 0x00, 0x00, 0x00, 0x00 };
- return bytes;
+ return makeArrayRef(bytes);
}
};
@@ -185,8 +187,8 @@ public:
}
virtual ArrayRef<uint8_t> rawContent() const {
- static const uint8_t bytes[] = { 0x00, 0x00, 0x00, 0x00 };
- return bytes;
+ static const uint8_t bytes[] = { 0x00, 0x00, 0x00, 0x0 };
+ return makeArrayRef(bytes);
}
};
Modified: lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp?rev=196853&r1=196852&r2=196853&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp Mon Dec 9 18:42:52 2013
@@ -19,6 +19,8 @@
#include "ReferenceKinds.h"
+using llvm::makeArrayRef;
+
namespace lld {
namespace mach_o {
@@ -45,9 +47,10 @@ public:
}
virtual ArrayRef<uint8_t> rawContent() const {
- static const uint8_t instructions[6] = { 0xFF, 0x25 }; // jmp *lazyPointer
+ static const uint8_t instructions[] =
+ { 0xFF, 0x25, 0x00, 0x00, 0x00, 0x00 }; // jmp *lazyPointer
assert(sizeof(instructions) == this->size());
- return instructions;
+ return makeArrayRef(instructions);
}
};
@@ -82,7 +85,7 @@ public:
0xFF, 0x25, 0x00, 0x00, 0x00, 0x00, // jmp *binder(%rip)
0x90 }; // nop
assert(sizeof(instructions) == this->size());
- return instructions;
+ return makeArrayRef(instructions);
}
};
@@ -114,7 +117,7 @@ public:
{ 0x68, 0x00, 0x00, 0x00, 0x00, // pushq $lazy-info-offset
0xE9, 0x00, 0x00, 0x00, 0x00 }; // jmp helperhelper
assert(sizeof(instructions) == this->size());
- return instructions;
+ return makeArrayRef(instructions);
}
};
@@ -147,8 +150,9 @@ public:
}
virtual ArrayRef<uint8_t> rawContent() const {
- static const uint8_t bytes[8] = {};
- return bytes;
+ static const uint8_t bytes[] =
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ return makeArrayRef(bytes);
}
};
@@ -182,8 +186,9 @@ public:
}
virtual ArrayRef<uint8_t> rawContent() const {
- static const uint8_t bytes[8] = {};
- return bytes;
+ static const uint8_t bytes[] =
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ return makeArrayRef(bytes);
}
};
More information about the llvm-commits
mailing list