================
@@ -3895,3 +3924,103 @@ std::optional<lldb_private::DataExtractor> 
ObjectFileELF::GetDynamicData() {
   }
   return std::nullopt;
 }
+
+
+std::optional<DataExtractor>
+ObjectFileELF::GetDynsymDataFromDynamic(uint32_t &num_symbols) {
+  // Every ELF file which represents an executable or shared library has
+  // mandatory .dynamic entries. The DT_SYMTAB value contains a pointer to the
+  // symbol table, and DT_SYMENT contains the size of a symbol table entry.
+  // We then can use either the DT_HASH or DT_GNU_HASH to find the number of
+  // symbols in the symbol table as the symbol count is not stored in the
+  // .dynamic section as a key/value pair.
+  //
+  // When loading and ELF file from memory, only the program headers end up
----------------
Jlalond wrote:

Great comment, but I would rephrase that only the program headers are 
guaranteed to be mapped

https://github.com/llvm/llvm-project/pull/112596
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to