summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibELF/DynamicLinker.cpp
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2021-02-07 15:33:24 +0330
committerAndreas Kling <kling@serenityos.org>2021-02-08 18:08:55 +0100
commit09a43969ba957b3484cc9387344fea145f46aa46 (patch)
tree0e2077e1d8af02b06e39cb4ca6cbfcba37052c73 /Userland/Libraries/LibELF/DynamicLinker.cpp
parent1f8a633cc762fc3ca8544ee75ce25a7a8860d4be (diff)
downloadserenity-09a43969ba957b3484cc9387344fea145f46aa46.zip
Everywhere: Replace dbgln<flag>(...) with dbgln_if(flag, ...)
Replacement made by `find Kernel Userland -name '*.h' -o -name '*.cpp' | sed -i -Ee 's/dbgln\b<(\w+)>\(/dbgln_if(\1, /g'`
Diffstat (limited to 'Userland/Libraries/LibELF/DynamicLinker.cpp')
-rw-r--r--Userland/Libraries/LibELF/DynamicLinker.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/Userland/Libraries/LibELF/DynamicLinker.cpp b/Userland/Libraries/LibELF/DynamicLinker.cpp
index 92b790eb54..4f2c618b2c 100644
--- a/Userland/Libraries/LibELF/DynamicLinker.cpp
+++ b/Userland/Libraries/LibELF/DynamicLinker.cpp
@@ -125,10 +125,10 @@ static Vector<String> get_dependencies(const String& name)
static void map_dependencies(const String& name)
{
- dbgln<DYNAMIC_LOAD_DEBUG>("mapping dependencies for: {}", name);
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "mapping dependencies for: {}", name);
for (const auto& needed_name : get_dependencies(name)) {
- dbgln<DYNAMIC_LOAD_DEBUG>("needed library: {}", needed_name.characters());
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "needed library: {}", needed_name.characters());
String library_name = get_library_name(needed_name);
if (!g_loaders.contains(library_name)) {
@@ -136,19 +136,19 @@ static void map_dependencies(const String& name)
map_dependencies(library_name);
}
}
- dbgln<DYNAMIC_LOAD_DEBUG>("mapped dependencies for {}", name);
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "mapped dependencies for {}", name);
}
static void allocate_tls()
{
size_t total_tls_size = 0;
for (const auto& data : g_loaders) {
- dbgln<DYNAMIC_LOAD_DEBUG>("{}: TLS Size: {}", data.key, data.value->tls_size());
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "{}: TLS Size: {}", data.key, data.value->tls_size());
total_tls_size += data.value->tls_size();
}
if (total_tls_size) {
[[maybe_unused]] void* tls_address = ::allocate_tls(total_tls_size);
- dbgln<DYNAMIC_LOAD_DEBUG>("from userspace, tls_address: {:p}", tls_address);
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "from userspace, tls_address: {:p}", tls_address);
}
g_total_tls_size = total_tls_size;
}
@@ -180,14 +180,14 @@ static void initialize_libc(DynamicObject& libc)
static void load_elf(const String& name)
{
- dbgln<DYNAMIC_LOAD_DEBUG>("load_elf: {}", name);
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "load_elf: {}", name);
auto loader = g_loaders.get(name).value();
auto dynamic_object = loader->map();
ASSERT(dynamic_object);
for (const auto& needed_name : get_dependencies(name)) {
- dbgln<DYNAMIC_LOAD_DEBUG>("needed library: {}", needed_name);
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "needed library: {}", needed_name);
String library_name = get_library_name(needed_name);
if (!g_loaded_objects.contains(library_name)) {
load_elf(library_name);
@@ -200,7 +200,7 @@ static void load_elf(const String& name)
g_loaded_objects.set(name, *dynamic_object);
g_global_objects.append(*dynamic_object);
- dbgln<DYNAMIC_LOAD_DEBUG>("load_elf: done {}", name);
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "load_elf: done {}", name);
}
static NonnullRefPtr<DynamicLoader> commit_elf(const String& name)
@@ -249,9 +249,9 @@ void ELF::DynamicLinker::linker_main(String&& main_program_name, int main_progra
map_library(main_program_name, main_program_fd);
map_dependencies(main_program_name);
- dbgln<DYNAMIC_LOAD_DEBUG>("loaded all dependencies");
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "loaded all dependencies");
for ([[maybe_unused]] auto& lib : g_loaders) {
- dbgln<DYNAMIC_LOAD_DEBUG>("{} - tls size: {}, tls offset: {}", lib.key, lib.value->tls_size(), lib.value->tls_offset());
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "{} - tls size: {}, tls offset: {}", lib.key, lib.value->tls_size(), lib.value->tls_offset());
}
allocate_tls();
@@ -263,11 +263,11 @@ void ELF::DynamicLinker::linker_main(String&& main_program_name, int main_progra
if (main_program_lib->is_dynamic())
entry_point += reinterpret_cast<FlatPtr>(main_program_lib->text_segment_load_address().as_ptr());
- dbgln<DYNAMIC_LOAD_DEBUG>("entry point: {:p}", (void*)entry_point);
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "entry point: {:p}", (void*)entry_point);
g_loaders.clear();
MainFunction main_function = (MainFunction)(entry_point);
- dbgln<DYNAMIC_LOAD_DEBUG>("jumping to main program entry point: {:p}", main_function);
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "jumping to main program entry point: {:p}", main_function);
if (g_do_breakpoint_trap_before_entry) {
asm("int3");
}
@@ -278,7 +278,7 @@ void ELF::DynamicLinker::linker_main(String&& main_program_name, int main_progra
}
rc = main_function(argc, argv, envp);
- dbgln<DYNAMIC_LOAD_DEBUG>("rc: {}", rc);
+ dbgln_if(DYNAMIC_LOAD_DEBUG, "rc: {}", rc);
if (g_libc_exit != nullptr) {
g_libc_exit(rc);
} else {