[PATCH] D36065: [llvm-dlltool] Write correct weak externals
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 31 01:14:42 PDT 2017
ruiu accepted this revision.
ruiu added a comment.
LGTM
================
Comment at: lib/Object/COFFImportFile.cpp:548
//__imp_ String Table
- if (Imp) {
- SymbolTable[3].Name.Offset.Offset = sizeof(uint32_t) + Sym.size() + 7;
- writeStringTable(Buffer, {std::string("__imp_").append(Sym),
- std::string("__imp_").append(Weak)});
- } else {
- SymbolTable[3].Name.Offset.Offset = sizeof(uint32_t) + Sym.size() + 1;
- writeStringTable(Buffer, {Sym, Weak});
- }
+ StringRef Prefix = Imp ? "__imp_" : "";
+ SymbolTable[3].Name.Offset.Offset = sizeof(uint32_t) + Sym.size() + Prefix.size() + 1;
----------------
Use std::string instead of StringRef to avoid use of `str()`.
https://reviews.llvm.org/D36065
More information about the llvm-commits
mailing list