elf_resolve_symbol(): If a weak undefined symbol could not be resolved,
return 0 as its address. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37412 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -991,6 +991,12 @@ elf_resolve_symbol(struct elf_image_info *image, struct Elf32_Sym *symbol,
|
|||||||
newSymbol = elf_find_symbol(sharedImage, symbolName, versionInfo,
|
newSymbol = elf_find_symbol(sharedImage, symbolName, versionInfo,
|
||||||
false);
|
false);
|
||||||
if (newSymbol == NULL) {
|
if (newSymbol == NULL) {
|
||||||
|
// Weak undefined symbols get a value of 0, if unresolved.
|
||||||
|
if (ELF32_ST_BIND(symbol->st_info) == STB_WEAK) {
|
||||||
|
*_symbolAddress = 0;
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
dprintf("\"%s\": could not resolve symbol '%s'\n",
|
dprintf("\"%s\": could not resolve symbol '%s'\n",
|
||||||
image->name, symbolName);
|
image->name, symbolName);
|
||||||
return B_MISSING_SYMBOL;
|
return B_MISSING_SYMBOL;
|
||||||
|
|||||||
Reference in New Issue
Block a user