diff --git a/llvm/tools/gccld/GenerateCode.cpp b/llvm/tools/gccld/GenerateCode.cpp index d41a1f15f248..d717cd5616a9 100644 --- a/llvm/tools/gccld/GenerateCode.cpp +++ b/llvm/tools/gccld/GenerateCode.cpp @@ -239,8 +239,10 @@ GenerateNative(const std::string &OutputFilename, // Add in the libraries to link. std::vector Libs(Libraries); for (unsigned index = 0; index < Libs.size(); index++) { - Libs[index] = "-l" + Libs[index]; - cmd.push_back(Libs[index].c_str()); + if (Libs[index] != "crtend") { + Libs[index] = "-l" + Libs[index]; + cmd.push_back(Libs[index].c_str()); + } } cmd.push_back(NULL);