mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibELF: Remove VERIFY() calls and let control flow return to the caller
This way we get better error messages for unresolved symbols because the caller logs the file and symbol names.
This commit is contained in:
parent
55914841b7
commit
97d7450571
Notes:
sideshowbarker
2024-07-18 19:24:36 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/97d7450571c Pull-request: https://github.com/SerenityOS/serenity/pull/6481
|
@ -444,7 +444,7 @@ DynamicLoader::RelocationResult DynamicLoader::do_relocation(size_t total_tls_si
|
|||
if (symbol.bind() == STB_WEAK)
|
||||
return RelocationResult::ResolveLater;
|
||||
dbgln("ERROR: symbol not found: {}.", symbol.name());
|
||||
VERIFY_NOT_REACHED();
|
||||
return RelocationResult::Failed;
|
||||
}
|
||||
auto symbol_address = res.value().address;
|
||||
*patch_ptr += symbol_address.get();
|
||||
|
@ -453,7 +453,8 @@ DynamicLoader::RelocationResult DynamicLoader::do_relocation(size_t total_tls_si
|
|||
case R_386_PC32: {
|
||||
auto symbol = relocation.symbol();
|
||||
auto result = lookup_symbol(symbol);
|
||||
VERIFY(result.has_value());
|
||||
if (!result.has_value())
|
||||
return RelocationResult::Failed;
|
||||
auto relative_offset = result.value().address - m_dynamic_object->base_address().offset(relocation.offset());
|
||||
*patch_ptr += relative_offset.get();
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue