From 78f7f8745e63c7a8c9e8513dd86a116c9e3834b8 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 24 Nov 2010 22:11:42 +0000 Subject: [PATCH] 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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39617 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/runtime_loader/elf_symbol_lookup.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/system/runtime_loader/elf_symbol_lookup.cpp b/src/system/runtime_loader/elf_symbol_lookup.cpp index b1de1be4f7..9d4788e87d 100644 --- a/src/system/runtime_loader/elf_symbol_lookup.cpp +++ b/src/system/runtime_loader/elf_symbol_lookup.cpp @@ -298,14 +298,19 @@ Elf32_Sym* 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; }