mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-22 10:55:14 -04:00
kern: implement support for applying relr relocations
This commit is contained in:
parent
f93aea4c06
commit
11c02e22e0
2 changed files with 94 additions and 14 deletions
|
@ -114,6 +114,23 @@ namespace ams::kern::init::Elf::Elf64 {
|
|||
}
|
||||
};
|
||||
|
||||
class Relr {
|
||||
private:
|
||||
Xword m_info;
|
||||
public:
|
||||
constexpr ALWAYS_INLINE bool IsLocation() const {
|
||||
return (m_info & 1) == 0;
|
||||
}
|
||||
|
||||
constexpr ALWAYS_INLINE Xword GetLocation() const {
|
||||
return m_info;
|
||||
}
|
||||
|
||||
constexpr ALWAYS_INLINE Xword GetBitmap() const {
|
||||
return m_info >> 1;
|
||||
}
|
||||
};
|
||||
|
||||
enum DynamicTag {
|
||||
DT_NULL = 0,
|
||||
DT_RELA = 7,
|
||||
|
@ -121,6 +138,10 @@ namespace ams::kern::init::Elf::Elf64 {
|
|||
DT_REL = 17,
|
||||
DT_RELENT = 19,
|
||||
|
||||
DT_RELRSZ = 35,
|
||||
DT_RELR = 36,
|
||||
DT_RELRENT = 37,
|
||||
|
||||
DT_RELACOUNT = 0x6ffffff9,
|
||||
DT_RELCOUNT = 0x6ffffffa
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue