1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:07:34 +00:00

LibELF: Handle DT_SONAME dynamic entries

Store the offset in the string table for the DT_SONAME entry. Now that
the build uses cmake, cmake is helpfully passing --Wl,-soname to the
linker for shared objects. This makes the LinkDemo run again.
This commit is contained in:
Andrew Kaster 2020-05-15 14:46:53 -06:00 committed by Andreas Kling
parent 3d153e5ed3
commit e5ad6a491e
2 changed files with 12 additions and 0 deletions

View file

@ -213,6 +213,8 @@ public:
VirtualAddress plt_got_base_address() const { return m_base_address.offset(m_procedure_linkage_table_offset); }
VirtualAddress base_address() const { return m_base_address; }
const char* soname() const { return m_has_soname ? symbol_string_table_string(m_soname_index) : nullptr; }
private:
const char* symbol_string_table_string(Elf32_Word) const;
void parse();
@ -259,6 +261,9 @@ private:
// DT_FLAGS
Elf32_Word m_dt_flags { 0 };
bool m_has_soname { false };
Elf32_Word m_soname_index { 0 }; // Index into dynstr table for SONAME
// End Section information from DT_* entries
};