summaryrefslogtreecommitdiff
path: root/AK/ELF
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-07-03 21:17:35 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-03 21:20:13 +0200
commit27f699ef0c8c2dce0f1dff19eef25f02e3da397e (patch)
tree52f95be1d05ba2a621d3bb8ac9129341f8d9973b /AK/ELF
parentc4c4bbc5ba5119e9ccc8ded948b26e7c4851a909 (diff)
downloadserenity-27f699ef0c8c2dce0f1dff19eef25f02e3da397e.zip
AK: Rename the common integer typedefs to make it obvious what they are.
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
Diffstat (limited to 'AK/ELF')
-rw-r--r--AK/ELF/ELFImage.cpp2
-rw-r--r--AK/ELF/ELFImage.h20
-rw-r--r--AK/ELF/ELFLoader.cpp4
-rw-r--r--AK/ELF/ELFLoader.h6
4 files changed, 16 insertions, 16 deletions
diff --git a/AK/ELF/ELFImage.cpp b/AK/ELF/ELFImage.cpp
index 02a1dba42c..5228bf53f8 100644
--- a/AK/ELF/ELFImage.cpp
+++ b/AK/ELF/ELFImage.cpp
@@ -1,7 +1,7 @@
#include "ELFImage.h"
#include <AK/kstdio.h>
-ELFImage::ELFImage(const byte* buffer)
+ELFImage::ELFImage(const u8* buffer)
: m_buffer(buffer)
{
m_valid = parse();
diff --git a/AK/ELF/ELFImage.h b/AK/ELF/ELFImage.h
index 6f0eee52ec..19238d191d 100644
--- a/AK/ELF/ELFImage.h
+++ b/AK/ELF/ELFImage.h
@@ -7,7 +7,7 @@
class ELFImage {
public:
- explicit ELFImage(const byte*);
+ explicit ELFImage(const u8*);
~ELFImage();
void dump();
bool is_valid() const { return m_valid; }
@@ -54,13 +54,13 @@ public:
~ProgramHeader() {}
unsigned index() const { return m_program_header_index; }
- dword type() const { return m_program_header.p_type; }
- dword flags() const { return m_program_header.p_flags; }
- dword offset() const { return m_program_header.p_offset; }
+ u32 type() const { return m_program_header.p_type; }
+ u32 flags() const { return m_program_header.p_flags; }
+ u32 offset() const { return m_program_header.p_offset; }
VirtualAddress vaddr() const { return VirtualAddress(m_program_header.p_vaddr); }
- dword size_in_memory() const { return m_program_header.p_memsz; }
- dword size_in_image() const { return m_program_header.p_filesz; }
- dword alignment() const { return m_program_header.p_align; }
+ u32 size_in_memory() const { return m_program_header.p_memsz; }
+ u32 size_in_image() const { return m_program_header.p_filesz; }
+ u32 alignment() const { return m_program_header.p_align; }
bool is_readable() const { return flags() & PF_R; }
bool is_writable() const { return flags() & PF_W; }
bool is_executable() const { return flags() & PF_X; }
@@ -88,10 +88,10 @@ public:
unsigned size() const { return m_section_header.sh_size; }
unsigned entry_size() const { return m_section_header.sh_entsize; }
unsigned entry_count() const { return !entry_size() ? 0 : size() / entry_size(); }
- dword address() const { return m_section_header.sh_addr; }
+ u32 address() const { return m_section_header.sh_addr; }
const char* raw_data() const { return m_image.raw_data(m_section_header.sh_offset); }
bool is_undefined() const { return m_section_index == SHN_UNDEF; }
- dword flags() const { return m_section_header.sh_flags; }
+ u32 flags() const { return m_section_header.sh_flags; }
bool is_writable() const { return flags() & SHF_WRITE; }
bool is_executable() const { return flags() & PF_X; }
@@ -134,7 +134,7 @@ private:
const char* section_header_table_string(unsigned offset) const;
const char* section_index_to_string(unsigned index);
- const byte* m_buffer { nullptr };
+ const u8* m_buffer { nullptr };
bool m_valid { false };
unsigned m_symbol_table_section_index { 0 };
unsigned m_string_table_section_index { 0 };
diff --git a/AK/ELF/ELFLoader.cpp b/AK/ELF/ELFLoader.cpp
index 6bc84f65b4..1891d9f056 100644
--- a/AK/ELF/ELFLoader.cpp
+++ b/AK/ELF/ELFLoader.cpp
@@ -8,7 +8,7 @@
//#define ELFLOADER_DEBUG
-ELFLoader::ELFLoader(const byte* buffer)
+ELFLoader::ELFLoader(const u8* buffer)
: m_image(buffer)
{
}
@@ -81,7 +81,7 @@ char* ELFLoader::symbol_ptr(const char* name)
return found_ptr;
}
-String ELFLoader::symbolicate(dword address) const
+String ELFLoader::symbolicate(u32 address) const
{
SortedSymbol* sorted_symbols = nullptr;
#ifdef KERNEL
diff --git a/AK/ELF/ELFLoader.h b/AK/ELF/ELFLoader.h
index 3803726a29..091e47d6fc 100644
--- a/AK/ELF/ELFLoader.h
+++ b/AK/ELF/ELFLoader.h
@@ -13,7 +13,7 @@ class Region;
class ELFLoader {
public:
- explicit ELFLoader(const byte*);
+ explicit ELFLoader(const u8*);
~ELFLoader();
bool load();
@@ -26,7 +26,7 @@ public:
bool has_symbols() const { return m_image.symbol_count(); }
- String symbolicate(dword address) const;
+ String symbolicate(u32 address) const;
private:
bool layout();
@@ -49,7 +49,7 @@ private:
ELFImage m_image;
struct SortedSymbol {
- dword address;
+ u32 address;
const char* name;
};
#ifdef KERNEL