Make sure to create a target data that matches the Module's target properties.
llvm-svn: 5904
diff --git a/llvm/tools/gccld/gccld.cpp b/llvm/tools/gccld/gccld.cpp
index 1d61d13..24c624e 100644
--- a/llvm/tools/gccld/gccld.cpp
+++ b/llvm/tools/gccld/gccld.cpp
@@ -18,6 +18,7 @@
#include "llvm/PassManager.h"
#include "llvm/Bytecode/Reader.h"
#include "llvm/Bytecode/WriteBytecodePass.h"
+#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
#include "Support/CommandLine.h"
@@ -326,6 +327,9 @@
//
PassManager Passes;
+ // Add an appropriate TargetData instance for this module...
+ Passes.add(new TargetData("gccas", Composite.get()));
+
// Linking modules together can lead to duplicated global constants, only keep
// one copy of each constant...
//