[lld] r190983 - [PECOFF] Fix the order of the Import Table entries.
Rui Ueyama
ruiu at google.com
Wed Sep 18 18:39:53 PDT 2013
Author: ruiu
Date: Wed Sep 18 20:39:53 2013
New Revision: 190983
URL: http://llvm.org/viewvc/llvm-project?rev=190983&view=rev
Log:
[PECOFF] Fix the order of the Import Table entries.
Test is coming after submitting http://llvm-reviews.chandlerc.com/D1719.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h
Modified: lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h?rev=190983&r1=190982&r2=190983&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h Wed Sep 18 20:39:53 2013
@@ -288,12 +288,20 @@ private:
new (_alloc) ImportDirectoryAtom(context, loadName, dllAtoms);
}
+ // Append vec2's elements at the end of vec1.
+ template <typename T, typename U>
+ void appendAtoms(vector<T *> &vec1, const vector<U *> &vec2) {
+ vec1.insert(vec1.end(), vec2.begin(), vec2.end());
+ }
+
void connectAtoms(Context &context) {
- coff::connectAtomsWithLayoutEdge(context.importDirectories);
- coff::connectAtomsWithLayoutEdge(context.importLookupTables);
- coff::connectAtomsWithLayoutEdge(context.importAddressTables);
- coff::connectAtomsWithLayoutEdge(context.hintNameAtoms);
- coff::connectAtomsWithLayoutEdge(context.dllNameAtoms);
+ vector<COFFBaseDefinedAtom *> atoms;
+ appendAtoms(atoms, context.importDirectories);
+ appendAtoms(atoms, context.importLookupTables);
+ appendAtoms(atoms, context.importAddressTables);
+ appendAtoms(atoms, context.dllNameAtoms);
+ appendAtoms(atoms, context.hintNameAtoms);
+ coff::connectAtomsWithLayoutEdge(atoms);
}
/// The addresses of the import dirctory and the import address table needs to
More information about the llvm-commits
mailing list