[haiku-commits] r39391 - haiku/branches/developer/bonefish/weak-symbols/src/system/runtime_loader

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 10 Nov 2010 23:03:15 +0100 (CET)

Author: bonefish
Date: 2010-11-10 23:03:15 +0100 (Wed, 10 Nov 2010)
New Revision: 39391
Changeset: http://dev.haiku-os.org/changeset/39391

Modified:
   
haiku/branches/developer/bonefish/weak-symbols/src/system/runtime_loader/elf_symbol_lookup.cpp
   
haiku/branches/developer/bonefish/weak-symbols/src/system/runtime_loader/elf_versioning.cpp
Log:
* init_image_version_infos(): Explicitly set the version info's file_name to
  NULL. It was never read as long as we only resolved undefined symbols, but
  now that can happen.
* equals_image_name(): Allow a NULL name parameter. NULL is passed when a
  preemptable versioned symbol is looked up and found in an unversioned image.


Modified: 
haiku/branches/developer/bonefish/weak-symbols/src/system/runtime_loader/elf_symbol_lookup.cpp
===================================================================
--- 
haiku/branches/developer/bonefish/weak-symbols/src/system/runtime_loader/elf_symbol_lookup.cpp
      2010-11-10 21:54:47 UTC (rev 39390)
+++ 
haiku/branches/developer/bonefish/weak-symbols/src/system/runtime_loader/elf_symbol_lookup.cpp
      2010-11-10 22:03:15 UTC (rev 39391)
@@ -20,9 +20,22 @@
 #include "runtime_loader_private.h"
 
 
+/*!    Checks whether \a name matches the name of \a image.
+
+       It is expected that \a name does not contain directory components. It is
+       compared with the base name of \a image's name.
+
+       \param image The image.
+       \param name The name to check against. Can be NULL, in which case \c 
false
+               is returned.
+       \return \c true, iff \a name is non-NULL and matches the name of \a 
image.
+*/
 static bool
 equals_image_name(image_t* image, const char* name)
 {
+       if (name == NULL)
+               return false;
+
        const char* lastSlash = strrchr(name, '/');
        return strcmp(image->name, lastSlash != NULL ? lastSlash + 1 : name) == 
0;
 }

Modified: 
haiku/branches/developer/bonefish/weak-symbols/src/system/runtime_loader/elf_versioning.cpp
===================================================================
--- 
haiku/branches/developer/bonefish/weak-symbols/src/system/runtime_loader/elf_versioning.cpp
 2010-11-10 21:54:47 UTC (rev 39390)
+++ 
haiku/branches/developer/bonefish/weak-symbols/src/system/runtime_loader/elf_versioning.cpp
 2010-11-10 22:03:15 UTC (rev 39391)
@@ -130,6 +130,7 @@
                                elf_version_info& info = 
image->versions[versionIndex];
                                info.hash = definition->vd_hash;
                                info.name = STRING(image, verdaux->vda_name);
+                               info.file_name = NULL;
                        }
 
                        definition = (Elf32_Verdef*)


Other related posts:

  • » [haiku-commits] r39391 - haiku/branches/developer/bonefish/weak-symbols/src/system/runtime_loader - ingo_weinhold