[PATCH] [PECOFF] Support linking against DLL.
Rui Ueyama
ruiu at google.com
Wed Jul 10 21:35:44 PDT 2013
================
Comment at: lib/ReaderWriter/PECOFF/IdataPass.h:101-106
@@ +100,8 @@
+private:
+ vector<uint8_t> *stringRefToVector(StringRef name) {
+ auto *ret = new vector<uint8_t>(name.size() + 1);
+ memcpy(&(*ret)[0], name.data(), name.size());
+ (*ret)[name.size()] = 0;
+ return ret;
+ }
+};
----------------
Michael Spencer wrote:
> Return by value.
Done.
================
Comment at: lib/ReaderWriter/PECOFF/IdataPass.h:129-136
@@ +128,10 @@
+ // symbol name. The total size needs to be multiple of 2.
+ vector<uint8_t> *assembleRawContent(uint16_t hint, StringRef name) {
+ name = unmangle(name);
+ size_t size = llvm::RoundUpToAlignment(sizeof(hint) + name.size() + 1, 2);
+ auto *ret = new vector<uint8_t>(size, 0);
+ *reinterpret_cast<llvm::support::ulittle16_t *>(&(*ret)[0]) = hint;
+ std::memcpy(&(*ret)[2], name.data(), name.size());
+ return ret;
+ }
+
----------------
Michael Spencer wrote:
> Return by value.
Done.
http://llvm-reviews.chandlerc.com/D1096
BRANCH
dll
ARCANIST PROJECT
lld
More information about the llvm-commits
mailing list