svn commit: r263366 - stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD

Ed Maste emaste at FreeBSD.org
Wed Mar 19 13:16:59 UTC 2014


Author: emaste
Date: Wed Mar 19 13:16:58 2014
New Revision: 263366
URL: http://svnweb.freebsd.org/changeset/base/263366

Log:
  MFC r258873: Workaround lldb issue with main module base address
  
    On FreeBSD lldb sometimes reloads the the main module's (executable's)
    symbols at the wrong address.  Work around this for now by explicitly
    reloading at base_address=0 when it happens.
  
    A proper fix is needed but early testers have reported this issue so
    this workaround should allow them to make further progress.
  
    http://llvm.org/bugs/show_bug.cgi?id=17880
  
  Sponsored by:	DARPA, AFRL

Modified:
  stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
==============================================================================
--- stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp	Wed Mar 19 13:15:16 2014	(r263365)
+++ stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp	Wed Mar 19 13:16:58 2014	(r263366)
@@ -454,6 +454,17 @@ DynamicLoaderPOSIXDYLD::LoadAllCurrentMo
         const char *module_path = I->path.c_str();
         FileSpec file(module_path, false);
         ModuleSP module_sp = LoadModuleAtAddress(file, I->link_addr, I->base_addr);
+#ifdef __FreeBSD__ // llvm.org/pr17880
+        if (module_sp == executable)
+        {
+            Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
+            if (log)
+                log->Printf("DynamicLoaderPOSIXDYLD::%s reloading main module, ignoring rendezvous base addr %" PRIx64,
+                            __FUNCTION__, I->base_addr);
+            ModuleSP module_sp = LoadModuleAtAddress(file, I->link_addr, 0);
+        }
+#endif
+ 
         if (module_sp.get())
         {
             module_list.Append(module_sp);


More information about the svn-src-all mailing list