mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:17:36 +00:00
LibELF: Exclude MemoryRegionInfo::object_name() from the Kernel
This API is only used by userland, and it uses infallible Strings, so let's just ifdef it out of the Kernel.
This commit is contained in:
parent
7923b3b884
commit
1616460312
1 changed files with 6 additions and 1 deletions
|
@ -6,10 +6,13 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Types.h>
|
||||
#include <LibC/sys/arch/i386/regs.h>
|
||||
|
||||
#ifndef KERNEL
|
||||
# include <AK/String.h>
|
||||
#endif
|
||||
|
||||
namespace ELF::Core {
|
||||
|
||||
struct [[gnu::packed]] NotesEntryHeader {
|
||||
|
@ -55,6 +58,7 @@ struct [[gnu::packed]] MemoryRegionInfo {
|
|||
uint16_t program_header_index;
|
||||
char region_name[]; // Null terminated
|
||||
|
||||
#ifndef KERNEL
|
||||
String object_name() const
|
||||
{
|
||||
StringView memory_region_name { region_name };
|
||||
|
@ -65,6 +69,7 @@ struct [[gnu::packed]] MemoryRegionInfo {
|
|||
return {};
|
||||
return memory_region_name.substring_view(0, *maybe_colon_index).to_string();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
struct [[gnu::packed]] Metadata {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue