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 | 3e15c7a9761b0db253fc74caef0902940fe9872a (patch) | |
tree | 38e14b08c54d286aba7eb0dcbdf6bce4b6781eea /tools/gccld | |
parent | a140b3c36759478d75618d63dc2b77592180dab8 (diff) | |
download | external_llvm-3e15c7a9761b0db253fc74caef0902940fe9872a.zip external_llvm-3e15c7a9761b0db253fc74caef0902940fe9872a.tar.gz external_llvm-3e15c7a9761b0db253fc74caef0902940fe9872a.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10195 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccld')
-rw-r--r-- | tools/gccld/gccld.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp index f520ad0..67db704 100644 --- a/tools/gccld/gccld.cpp +++ b/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"; |