1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

LibELF: Use StringView instead of "const char*" in dynamic linker code

There's no reason to use C strings more than absolutely necessary.
This commit is contained in:
Andreas Kling 2021-02-20 19:20:08 +01:00
parent 2c3f284b06
commit 0c0127dc3f
6 changed files with 36 additions and 41 deletions

View file

@ -65,11 +65,11 @@ bool g_allowed_to_check_environment_variables { false };
bool g_do_breakpoint_trap_before_entry { false };
}
Optional<DynamicObject::SymbolLookupResult> DynamicLinker::lookup_global_symbol(const char* symbol_name)
Optional<DynamicObject::SymbolLookupResult> DynamicLinker::lookup_global_symbol(const StringView& symbol)
{
Optional<DynamicObject::SymbolLookupResult> weak_result;
for (auto& lib : g_global_objects) {
auto res = lib->lookup_symbol(symbol_name);
auto res = lib->lookup_symbol(symbol);
if (!res.has_value())
continue;
if (res.value().bind == STB_GLOBAL)