summaryrefslogtreecommitdiff
path: root/Libraries/LibELF/DynamicObject.h
diff options
context:
space:
mode:
authorAndrew Kaster <andrewdkaster@gmail.com>2020-05-15 14:46:53 -0600
committerAndreas Kling <kling@serenityos.org>2020-05-16 09:52:57 +0200
commite5ad6a491edf07b8516e2ce6d52070243dc629eb (patch)
treebaa9a207686bb94f8433ce0eb030d5be03d1e1a6 /Libraries/LibELF/DynamicObject.h
parent3d153e5ed3b3158f643637251c63cd4a5a284424 (diff)
downloadserenity-e5ad6a491edf07b8516e2ce6d52070243dc629eb.zip
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.
Diffstat (limited to 'Libraries/LibELF/DynamicObject.h')
-rw-r--r--Libraries/LibELF/DynamicObject.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibELF/DynamicObject.h b/Libraries/LibELF/DynamicObject.h
index d37869e4f9..cbfe2acfeb 100644
--- a/Libraries/LibELF/DynamicObject.h
+++ b/Libraries/LibELF/DynamicObject.h
@@ -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
};