mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:07:36 +00:00
Libraries: Unbreak building with extra debug macros
This commit is contained in:
parent
081bb29626
commit
d8e22fedc3
8 changed files with 23 additions and 17 deletions
|
@ -35,7 +35,9 @@
|
|||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#define DYNAMIC_LOAD_DEBUG
|
||||
#ifndef DYNAMIC_LOAD_DEBUG
|
||||
# define DYNAMIC_LOAD_DEBUG
|
||||
#endif
|
||||
//#define DYNAMIC_LOAD_VERBOSE
|
||||
|
||||
#ifdef DYNAMIC_LOAD_VERBOSE
|
||||
|
@ -82,8 +84,7 @@ DynamicLoader::DynamicLoader(const char* filename, int fd, size_t size)
|
|||
|
||||
auto* elf_header = (Elf32_Ehdr*)m_file_mapping;
|
||||
|
||||
if (!validate_elf_header(*elf_header, m_file_size) ||
|
||||
!validate_program_headers(*elf_header, m_file_size, (u8*)m_file_mapping, m_file_size, m_program_interpreter)) {
|
||||
if (!validate_elf_header(*elf_header, m_file_size) || !validate_program_headers(*elf_header, m_file_size, (u8*)m_file_mapping, m_file_size, m_program_interpreter)) {
|
||||
m_valid = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -263,7 +263,7 @@ const DynamicObject::Symbol DynamicObject::HashSection::lookup_symbol(const char
|
|||
auto symbol = m_dynamic.symbol(i);
|
||||
if (strcmp(name, symbol.name()) == 0) {
|
||||
#ifdef DYNAMIC_LOAD_DEBUG
|
||||
dbgprintf("Returning dynamic symbol with index %d for %s: %p\n", i, symbol.name(), symbol.address());
|
||||
dbgprintf("Returning dynamic symbol with index %u for %s: %p\n", i, symbol.name(), symbol.address().as_ptr());
|
||||
#endif
|
||||
return symbol;
|
||||
}
|
||||
|
|
|
@ -271,7 +271,7 @@ const Image::RelocationSection Image::Section::relocations() const
|
|||
return static_cast<const RelocationSection>(m_image.section(0));
|
||||
|
||||
#ifdef Image_DEBUG
|
||||
dbgprintf("Found relocations for %s in %s\n", name(), relocation_section.name());
|
||||
dbgprintf("Found relocations for %s in %s\n", name().to_string().characters(), relocation_section.name().to_string().characters());
|
||||
#endif
|
||||
return static_cast<const RelocationSection>(relocation_section);
|
||||
}
|
||||
|
|
|
@ -87,10 +87,10 @@ bool Loader::layout()
|
|||
}
|
||||
if (program_header.type() != PT_LOAD)
|
||||
return;
|
||||
#ifdef Loader_DEBUG
|
||||
kprintf("PH: V%p %u r:%u w:%u\n", program_header.vaddr().get(), program_header.size_in_memory(), program_header.is_readable(), program_header.is_writable());
|
||||
#endif
|
||||
#ifdef KERNEL
|
||||
# ifdef Loader_DEBUG
|
||||
kprintf("PH: V%p %u r:%u w:%u\n", program_header.vaddr().get(), program_header.size_in_memory(), program_header.is_readable(), program_header.is_writable());
|
||||
# endif
|
||||
if (program_header.is_writable()) {
|
||||
auto* allocated_section = alloc_section_hook(
|
||||
program_header.vaddr(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue