mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-04 01:05:58 +03:00
Kernel/AK: Move ELF loader to AK
This is in preparation for eventually using it in userspace. LinearAddress.h has not been moved for the time being (as it seems to be only used by a very small part of the code).
This commit is contained in:
parent
5b3c4afff2
commit
6917c42140
Notes:
sideshowbarker
2024-07-19 13:58:59 +09:00
Author: https://github.com/rburchell Commit: https://github.com/SerenityOS/serenity/commit/6917c421404 Pull-request: https://github.com/SerenityOS/serenity/pull/76 Reviewed-by: https://github.com/awesomekling
@ -3,7 +3,7 @@
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <Kernel/ELF/exec_elf.h>
|
||||
#include <AK/ELF/exec_elf.h>
|
||||
|
||||
class ELFImage {
|
||||
public:
|
@ -4,8 +4,10 @@
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#if defined(KERNEL)
|
||||
#include <Kernel/LinearAddress.h>
|
||||
#include <Kernel/ELF/ELFImage.h>
|
||||
#endif
|
||||
#include <AK/ELF/ELFImage.h>
|
||||
|
||||
class ELFLoader {
|
||||
public:
|
||||
@ -13,10 +15,12 @@ public:
|
||||
~ELFLoader();
|
||||
|
||||
bool load();
|
||||
#if defined(KERNEL)
|
||||
Function<void*(LinearAddress, size_t, size_t, bool, bool, const String&)> alloc_section_hook;
|
||||
Function<void*(LinearAddress, size_t, size_t, size_t, bool, bool, const String&)> map_section_hook;
|
||||
char* symbol_ptr(const char* name);
|
||||
LinearAddress entry() const { return m_image.entry(); }
|
||||
#endif
|
||||
char* symbol_ptr(const char* name);
|
||||
|
||||
bool has_symbols() const { return m_image.symbol_count(); }
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "Process.h"
|
||||
#include "Scheduler.h"
|
||||
#include <Kernel/FileSystem/FileDescriptor.h>
|
||||
#include <Kernel/ELF/ELFLoader.h>
|
||||
#include <AK/ELF/ELFLoader.h>
|
||||
#include <AK/TemporaryChange.h>
|
||||
|
||||
static KSym* s_ksyms;
|
||||
|
@ -31,8 +31,6 @@ KERNEL_OBJS = \
|
||||
FileSystem/FIFO.o \
|
||||
Scheduler.o \
|
||||
DoubleBuffer.o \
|
||||
ELF/ELFImage.o \
|
||||
ELF/ELFLoader.o \
|
||||
KSyms.o \
|
||||
SharedMemory.o \
|
||||
FileSystem/DevPtsFS.o \
|
||||
@ -78,7 +76,9 @@ AK_OBJS = \
|
||||
../AK/StringBuilder.o \
|
||||
../AK/StringView.o \
|
||||
../AK/FileSystemPath.o \
|
||||
../AK/StdLibExtras.o
|
||||
../AK/StdLibExtras.o \
|
||||
../AK/ELF/ELFImage.o \
|
||||
../AK/ELF/ELFLoader.o
|
||||
|
||||
CXX_OBJS = $(KERNEL_OBJS) $(VFS_OBJS) $(AK_OBJS)
|
||||
OBJS = $(CXX_OBJS) Boot/boot.ao
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <Kernel/FileSystem/FileDescriptor.h>
|
||||
#include <Kernel/FileSystem/VirtualFileSystem.h>
|
||||
#include <Kernel/Devices/NullDevice.h>
|
||||
#include <Kernel/ELF/ELFLoader.h>
|
||||
#include <Kernel/VM/MemoryManager.h>
|
||||
#include "i8253.h"
|
||||
#include "RTC.h"
|
||||
@ -19,7 +18,8 @@
|
||||
#include "KSyms.h"
|
||||
#include <Kernel/Net/Socket.h>
|
||||
#include <Kernel/TTY/MasterPTY.h>
|
||||
#include <Kernel/ELF/exec_elf.h>
|
||||
#include <AK/ELF/exec_elf.h>
|
||||
#include <AK/ELF/ELFLoader.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Time.h>
|
||||
#include <Kernel/SharedMemory.h>
|
||||
|
Loading…
Reference in New Issue
Block a user