[llvm-commits] CVS: llvm/tools/gccld/Linker.cpp gccld.h

Misha Brukman brukman at cs.uiuc.edu
Thu Nov 20 13:09:01 PST 2003


Changes in directory llvm/tools/gccld:

Linker.cpp updated: 1.17 -> 1.18
gccld.h updated: 1.5 -> 1.6

---
Log message:

Add ability to search only for native shared object, and expose the
functionality to the rest of gccld.


---
Diffs of the changes:  (+9 -7)

Index: llvm/tools/gccld/Linker.cpp
diff -u llvm/tools/gccld/Linker.cpp:1.17 llvm/tools/gccld/Linker.cpp:1.18
--- llvm/tools/gccld/Linker.cpp:1.17	Sun Nov 16 17:07:13 2003
+++ llvm/tools/gccld/Linker.cpp	Thu Nov 20 13:08:06 2003
@@ -39,8 +39,9 @@
 /// named by the value of the environment variable LLVM_LIB_SEARCH_PATH. Returns
 /// an empty string if no matching file can be found.
 ///
-static std::string FindLib(const std::string &Filename,
-                           const std::vector<std::string> &Paths) {
+std::string FindLib(const std::string &Filename,
+                    const std::vector<std::string> &Paths,
+                    bool SharedObjectOnly) {
   // Determine if the pathname can be found as it stands.
   if (FileOpenable(Filename))
     return Filename;
@@ -53,13 +54,13 @@
   for (unsigned Index = 0; Index != Paths.size(); ++Index) {
     std::string Directory = Paths[Index] + "/";
 
-    if (FileOpenable(Directory + LibName + ".bc"))
+    if (!SharedObjectOnly && FileOpenable(Directory + LibName + ".bc"))
       return Directory + LibName + ".bc";
 
     if (FileOpenable(Directory + LibName + ".so"))
       return Directory + LibName + ".so";
 
-    if (FileOpenable(Directory + LibName + ".a"))
+    if (!SharedObjectOnly && FileOpenable(Directory + LibName + ".a"))
       return Directory + LibName + ".a";
   }
 
@@ -98,9 +99,6 @@
 /// Outputs:
 ///  UndefinedSymbols - A set of C++ strings containing the name of all
 ///                     undefined symbols.
-///
-/// Return value:
-///  None.
 ///
 void
 GetAllUndefinedSymbols(Module *M, std::set<std::string> &UndefinedSymbols) {


Index: llvm/tools/gccld/gccld.h
diff -u llvm/tools/gccld/gccld.h:1.5 llvm/tools/gccld/gccld.h:1.6
--- llvm/tools/gccld/gccld.h:1.5	Tue Nov 11 16:41:34 2003
+++ llvm/tools/gccld/gccld.h	Thu Nov 20 13:08:06 2003
@@ -58,6 +58,10 @@
 std::auto_ptr<Module>
 LoadObject (const std::string & FN, std::string &OutErrorMessage);
 
+std::string FindLib(const std::string &Filename,
+                    const std::vector<std::string> &Paths,
+                    bool SharedObjectOnly = false);
+  
 bool
 LinkLibraries (const char * progname,
                Module * HeadModule,





More information about the llvm-commits mailing list