diff options
| author | Misha Brukman <brukman+llvm@gmail.com> | 2003-11-24 05:29:42 +0000 |
|---|---|---|
| committer | Misha Brukman <brukman+llvm@gmail.com> | 2003-11-24 05:29:42 +0000 |
| commit | 44a562bba6c07874e8306506477c8d5ecb2a573b (patch) | |
| tree | 747081ca7270541b2ce57819ffa545f3f497f5b5 /llvm/tools/gccld/gccld.cpp | |
| parent | f0c7647c11bd47103e788615016a2e0f42142e79 (diff) | |
| download | bcm5719-llvm-44a562bba6c07874e8306506477c8d5ecb2a573b.tar.gz bcm5719-llvm-44a562bba6c07874e8306506477c8d5ecb2a573b.zip | |
Make sure we ONLY add a `-load' switch to the JIT command line if the file is
verified as having an ELF header. This fixes PR151.
llvm-svn: 10195
Diffstat (limited to 'llvm/tools/gccld/gccld.cpp')
| -rw-r--r-- | llvm/tools/gccld/gccld.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/gccld/gccld.cpp b/llvm/tools/gccld/gccld.cpp index f520ad0ff98..67db7047798 100644 --- a/llvm/tools/gccld/gccld.cpp +++ b/llvm/tools/gccld/gccld.cpp @@ -285,6 +285,7 @@ int main(int argc, char **argv, char **envp) { // gcc accepts -l<lib> and implicitly searches /lib and /usr/lib. LibPaths.push_back("/lib"); LibPaths.push_back("/usr/lib"); + LibPaths.push_back("/usr/X11R6/lib/"); // We don't need to link in libc! In fact, /usr/lib/libc.so may not be a // shared object at all! See RH 8: plain text. std::vector<std::string>::iterator libc = @@ -295,7 +296,7 @@ int main(int argc, char **argv, char **envp) { for (std::vector<std::string>::iterator i = Libraries.begin(), e = Libraries.end(); i != e; ++i) { std::string FullLibraryPath = FindLib(*i, LibPaths, true); - if (!FullLibraryPath.empty()) + if (!FullLibraryPath.empty() && IsSharedObject(FullLibraryPath)) Out2 << " -load=" << FullLibraryPath << " \\\n"; } Out2 << " $0.bc $*\n"; |

