mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibELF: Exclude sorted symbols APIs from the Kernel
These are only used by userland, and are implemented using infallible Strings, so let's just ifdef them out of the Kernel.
This commit is contained in:
parent
1616460312
commit
d296001f3f
Notes:
sideshowbarker
2024-07-17 18:40:33 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/d296001f3f Pull-request: https://github.com/SerenityOS/serenity/pull/12564 Reviewed-by: https://github.com/MaxWipfli
@ -381,7 +381,6 @@ Optional<Image::Symbol> Image::find_demangled_function(StringView name) const
|
||||
});
|
||||
return found;
|
||||
}
|
||||
#endif
|
||||
|
||||
Image::SortedSymbol* Image::find_sorted_symbol(FlatPtr address) const
|
||||
{
|
||||
@ -428,7 +427,6 @@ NEVER_INLINE void Image::sort_symbols() const
|
||||
});
|
||||
}
|
||||
|
||||
#ifndef KERNEL
|
||||
String Image::symbolicate(FlatPtr address, u32* out_offset) const
|
||||
{
|
||||
auto symbol_count = this->symbol_count();
|
||||
|
@ -7,11 +7,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <AK/Concepts.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <Kernel/VirtualAddress.h>
|
||||
#include <LibC/elf.h>
|
||||
|
||||
#ifndef KERNEL
|
||||
# include <AK/String.h>
|
||||
#endif
|
||||
|
||||
namespace ELF {
|
||||
|
||||
class Image {
|
||||
@ -255,6 +258,7 @@ private:
|
||||
unsigned m_symbol_table_section_index { 0 };
|
||||
unsigned m_string_table_section_index { 0 };
|
||||
|
||||
#ifndef KERNEL
|
||||
struct SortedSymbol {
|
||||
FlatPtr address;
|
||||
StringView name;
|
||||
@ -266,6 +270,7 @@ private:
|
||||
SortedSymbol* find_sorted_symbol(FlatPtr) const;
|
||||
|
||||
mutable Vector<SortedSymbol> m_sorted_symbols;
|
||||
#endif
|
||||
};
|
||||
|
||||
template<IteratorFunction<Image::Section> F>
|
||||
|
Loading…
Reference in New Issue
Block a user