Author: bonefish Date: 2010-11-24 23:11:42 +0100 (Wed, 24 Nov 2010) New Revision: 39617 Changeset: http://dev.haiku-os.org/changeset/39617 Ticket: http://dev.haiku-os.org/ticket/6892 Modified: haiku/trunk/src/system/runtime_loader/elf_symbol_lookup.cpp Log: find_undefined_symbol_beos(): Look up the symbol in the requesting image first. Fixes binary compatibility issue introduced with symbol preemption support in the runtime loader. For unknown reasons liblayout.so, though linked symbolically, contains a non-weak (!), preemptable BFont type info, which was no longer resolved correctly with the new method. Fixes #6892. Modified: haiku/trunk/src/system/runtime_loader/elf_symbol_lookup.cpp =================================================================== --- haiku/trunk/src/system/runtime_loader/elf_symbol_lookup.cpp 2010-11-24 21:31:05 UTC (rev 39616) +++ haiku/trunk/src/system/runtime_loader/elf_symbol_lookup.cpp 2010-11-24 22:11:42 UTC (rev 39617) @@ -298,14 +298,19 @@ find_undefined_symbol_beos(image_t* rootImage, image_t* image, const SymbolLookupInfo& lookupInfo, image_t** foundInImage) { - // BeOS style symbol resolution: It is sufficient to check the direct - // dependencies. The linker would have complained, if the symbol wasn't - // there. + // BeOS style symbol resolution: It is sufficient to check the image itself + // and its direct dependencies. The linker would have complained, if the + // symbol wasn't there. + Elf32_Sym* symbol = find_symbol(image, lookupInfo); + if (symbol != NULL) { + *foundInImage = image; + return symbol; + } + for (uint32 i = 0; i < image->num_needed; i++) { if (image->needed[i]->dynamic_ptr) { - Elf32_Sym *symbol = find_symbol(image->needed[i], - lookupInfo); - if (symbol) { + symbol = find_symbol(image->needed[i], lookupInfo); + if (symbol != NULL) { *foundInImage = image->needed[i]; return symbol; }