This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gold][patch] Use dlerror to provide a more complete error message when we fail to load a plugin.


With the attached patch gold produces errors like

./gold/ld-new: error: foobar.so: could not load plugin library:
foobar.so: cannot open shared object file: No such file or directory

or

./gold/ld-new: error: LLVMgold.so: could not load plugin library:
.../libc.so.6: version `GLIBC_2.4' not found (required by LLVMgold.so)

Is it OK?

2010-06-28  Rafael Espindola  <espindola@google.com>

	* plugin.cc (Plugin::load): Use dlerror.

Cheers,
-- 
Rafael Ãvila de EspÃndola
diff --git a/gold/plugin.cc b/gold/plugin.cc
index c9e55ef..ba4bd4c 100644
--- a/gold/plugin.cc
+++ b/gold/plugin.cc
@@ -106,8 +106,8 @@ Plugin::load()
   this->handle_ = dlopen(this->filename_.c_str(), RTLD_NOW);
   if (this->handle_ == NULL)
     {
-      gold_error(_("%s: could not load plugin library"),
-                 this->filename_.c_str());
+      gold_error(_("%s: could not load plugin library: %s"),
+                 this->filename_.c_str(), dlerror());
       return;
     }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]