Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 1 | //===-- ObjectFileELF.h --------------------------------------- -*- C++ -*-===// |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef liblldb_ObjectFileELF_h_ |
| 11 | #define liblldb_ObjectFileELF_h_ |
| 12 | |
| 13 | #include <stdint.h> |
| 14 | #include <vector> |
| 15 | |
| 16 | #include "lldb/lldb-private.h" |
Greg Clayton | 53239f0 | 2011-02-08 05:05:52 +0000 | [diff] [blame] | 17 | #include "lldb/Host/FileSpec.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 18 | #include "lldb/Symbol/ObjectFile.h" |
Michael Sartain | c836ae7 | 2013-05-23 20:57:03 +0000 | [diff] [blame] | 19 | #include "lldb/Core/UUID.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 20 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 21 | #include "ELFHeader.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 22 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 23 | //------------------------------------------------------------------------------ |
| 24 | /// @class ObjectFileELF |
| 25 | /// @brief Generic ELF object file reader. |
| 26 | /// |
| 27 | /// This class provides a generic ELF (32/64 bit) reader plugin implementing the |
| 28 | /// ObjectFile protocol. |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 29 | class ObjectFileELF : |
| 30 | public lldb_private::ObjectFile |
| 31 | { |
| 32 | public: |
| 33 | //------------------------------------------------------------------ |
| 34 | // Static Functions |
| 35 | //------------------------------------------------------------------ |
| 36 | static void |
| 37 | Initialize(); |
| 38 | |
| 39 | static void |
| 40 | Terminate(); |
| 41 | |
Greg Clayton | 57abc5d | 2013-05-10 21:47:16 +0000 | [diff] [blame] | 42 | static lldb_private::ConstString |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 43 | GetPluginNameStatic(); |
| 44 | |
| 45 | static const char * |
| 46 | GetPluginDescriptionStatic(); |
| 47 | |
| 48 | static lldb_private::ObjectFile * |
Greg Clayton | e72dfb3 | 2012-02-24 01:59:29 +0000 | [diff] [blame] | 49 | CreateInstance(const lldb::ModuleSP &module_sp, |
Greg Clayton | 5ce9c56 | 2013-02-06 17:22:03 +0000 | [diff] [blame] | 50 | lldb::DataBufferSP& data_sp, |
| 51 | lldb::offset_t data_offset, |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 52 | const lldb_private::FileSpec* file, |
Greg Clayton | 5ce9c56 | 2013-02-06 17:22:03 +0000 | [diff] [blame] | 53 | lldb::offset_t file_offset, |
| 54 | lldb::offset_t length); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 55 | |
Greg Clayton | c966054 | 2012-02-05 02:38:54 +0000 | [diff] [blame] | 56 | static lldb_private::ObjectFile * |
Greg Clayton | e72dfb3 | 2012-02-24 01:59:29 +0000 | [diff] [blame] | 57 | CreateMemoryInstance (const lldb::ModuleSP &module_sp, |
Greg Clayton | c966054 | 2012-02-05 02:38:54 +0000 | [diff] [blame] | 58 | lldb::DataBufferSP& data_sp, |
| 59 | const lldb::ProcessSP &process_sp, |
| 60 | lldb::addr_t header_addr); |
| 61 | |
Greg Clayton | f4d6de6 | 2013-04-24 22:29:28 +0000 | [diff] [blame] | 62 | static size_t |
| 63 | GetModuleSpecifications (const lldb_private::FileSpec& file, |
| 64 | lldb::DataBufferSP& data_sp, |
| 65 | lldb::offset_t data_offset, |
| 66 | lldb::offset_t file_offset, |
| 67 | lldb::offset_t length, |
| 68 | lldb_private::ModuleSpecList &specs); |
Michael Sartain | 9f0013d | 2013-05-17 00:20:21 +0000 | [diff] [blame] | 69 | |
| 70 | static bool |
| 71 | MagicBytesMatch (lldb::DataBufferSP& data_sp, |
| 72 | lldb::addr_t offset, |
| 73 | lldb::addr_t length); |
| 74 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 75 | //------------------------------------------------------------------ |
| 76 | // PluginInterface protocol |
| 77 | //------------------------------------------------------------------ |
Greg Clayton | 57abc5d | 2013-05-10 21:47:16 +0000 | [diff] [blame] | 78 | virtual lldb_private::ConstString |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 79 | GetPluginName(); |
| 80 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 81 | virtual uint32_t |
| 82 | GetPluginVersion(); |
| 83 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 84 | //------------------------------------------------------------------ |
| 85 | // ObjectFile Protocol. |
| 86 | //------------------------------------------------------------------ |
| 87 | virtual |
| 88 | ~ObjectFileELF(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 89 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 90 | virtual bool |
| 91 | ParseHeader(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 92 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 93 | virtual lldb::ByteOrder |
| 94 | GetByteOrder() const; |
| 95 | |
Jim Ingham | 5aee162 | 2010-08-09 23:31:02 +0000 | [diff] [blame] | 96 | virtual bool |
| 97 | IsExecutable () const; |
| 98 | |
Greg Clayton | c7bece56 | 2013-01-25 18:06:21 +0000 | [diff] [blame] | 99 | virtual uint32_t |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 100 | GetAddressByteSize() const; |
| 101 | |
| 102 | virtual lldb_private::Symtab * |
Greg Clayton | 3046e66 | 2013-07-10 01:23:25 +0000 | [diff] [blame] | 103 | GetSymtab(); |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 104 | |
Ashok Thirumurthi | 35729bb | 2013-09-24 15:34:13 +0000 | [diff] [blame^] | 105 | virtual lldb_private::Symbol * |
| 106 | ResolveSymbolForAddress(const lldb_private::Address& so_addr, bool verify_unique); |
| 107 | |
Greg Clayton | 3046e66 | 2013-07-10 01:23:25 +0000 | [diff] [blame] | 108 | virtual bool |
| 109 | IsStripped (); |
| 110 | |
| 111 | virtual void |
| 112 | CreateSections (lldb_private::SectionList &unified_section_list); |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 113 | |
| 114 | virtual void |
| 115 | Dump(lldb_private::Stream *s); |
| 116 | |
| 117 | virtual bool |
Greg Clayton | 514487e | 2011-02-15 21:59:32 +0000 | [diff] [blame] | 118 | GetArchitecture (lldb_private::ArchSpec &arch); |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 119 | |
| 120 | virtual bool |
| 121 | GetUUID(lldb_private::UUID* uuid); |
| 122 | |
Michael Sartain | a7499c9 | 2013-07-01 19:45:50 +0000 | [diff] [blame] | 123 | virtual lldb_private::FileSpecList |
| 124 | GetDebugSymbolFilePaths(); |
| 125 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 126 | virtual uint32_t |
| 127 | GetDependentModules(lldb_private::FileSpecList& files); |
| 128 | |
Stephen Wilson | 2ab0a58 | 2011-01-15 00:08:44 +0000 | [diff] [blame] | 129 | virtual lldb_private::Address |
| 130 | GetImageInfoAddress(); |
Jim Ingham | 672e6f5 | 2011-03-07 23:44:08 +0000 | [diff] [blame] | 131 | |
| 132 | virtual lldb_private::Address |
| 133 | GetEntryPointAddress (); |
Greg Clayton | 9e00b6a65 | 2011-07-09 00:41:34 +0000 | [diff] [blame] | 134 | |
| 135 | virtual ObjectFile::Type |
| 136 | CalculateType(); |
| 137 | |
| 138 | virtual ObjectFile::Strata |
| 139 | CalculateStrata(); |
Stephen Wilson | 2ab0a58 | 2011-01-15 00:08:44 +0000 | [diff] [blame] | 140 | |
Ashok Thirumurthi | 4822d92 | 2013-07-11 20:39:00 +0000 | [diff] [blame] | 141 | // Returns number of program headers found in the ELF file. |
| 142 | size_t |
| 143 | GetProgramHeaderCount(); |
| 144 | |
| 145 | // Returns the program header with the given index. |
| 146 | const elf::ELFProgramHeader * |
| 147 | GetProgramHeaderByIndex(lldb::user_id_t id); |
| 148 | |
| 149 | // Returns segment data for the given index. |
| 150 | lldb_private::DataExtractor |
| 151 | GetSegmentDataByIndex(lldb::user_id_t id); |
| 152 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 153 | private: |
Greg Clayton | e72dfb3 | 2012-02-24 01:59:29 +0000 | [diff] [blame] | 154 | ObjectFileELF(const lldb::ModuleSP &module_sp, |
Greg Clayton | 5ce9c56 | 2013-02-06 17:22:03 +0000 | [diff] [blame] | 155 | lldb::DataBufferSP& data_sp, |
| 156 | lldb::offset_t data_offset, |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 157 | const lldb_private::FileSpec* file, |
Greg Clayton | 5ce9c56 | 2013-02-06 17:22:03 +0000 | [diff] [blame] | 158 | lldb::offset_t offset, |
| 159 | lldb::offset_t length); |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 160 | |
| 161 | typedef std::vector<elf::ELFProgramHeader> ProgramHeaderColl; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 162 | typedef ProgramHeaderColl::iterator ProgramHeaderCollIter; |
| 163 | typedef ProgramHeaderColl::const_iterator ProgramHeaderCollConstIter; |
| 164 | |
Michael Sartain | a7499c9 | 2013-07-01 19:45:50 +0000 | [diff] [blame] | 165 | struct ELFSectionHeaderInfo : public elf::ELFSectionHeader |
| 166 | { |
| 167 | lldb_private::ConstString section_name; |
| 168 | }; |
| 169 | typedef std::vector<ELFSectionHeaderInfo> SectionHeaderColl; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 170 | typedef SectionHeaderColl::iterator SectionHeaderCollIter; |
| 171 | typedef SectionHeaderColl::const_iterator SectionHeaderCollConstIter; |
| 172 | |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 173 | typedef std::vector<elf::ELFDynamic> DynamicSymbolColl; |
| 174 | typedef DynamicSymbolColl::iterator DynamicSymbolCollIter; |
| 175 | typedef DynamicSymbolColl::const_iterator DynamicSymbolCollConstIter; |
| 176 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 177 | /// Version of this reader common to all plugins based on this class. |
| 178 | static const uint32_t m_plugin_version = 1; |
| 179 | |
| 180 | /// ELF file header. |
| 181 | elf::ELFHeader m_header; |
| 182 | |
Michael Sartain | a7499c9 | 2013-07-01 19:45:50 +0000 | [diff] [blame] | 183 | /// ELF build ID. |
Michael Sartain | c836ae7 | 2013-05-23 20:57:03 +0000 | [diff] [blame] | 184 | lldb_private::UUID m_uuid; |
| 185 | |
Michael Sartain | a7499c9 | 2013-07-01 19:45:50 +0000 | [diff] [blame] | 186 | /// ELF .gnu_debuglink file and crc data if available. |
| 187 | std::string m_gnu_debuglink_file; |
| 188 | uint32_t m_gnu_debuglink_crc; |
| 189 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 190 | /// Collection of program headers. |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 191 | ProgramHeaderColl m_program_headers; |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 192 | |
| 193 | /// Collection of section headers. |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 194 | SectionHeaderColl m_section_headers; |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 195 | |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 196 | /// Collection of symbols from the dynamic table. |
| 197 | DynamicSymbolColl m_dynamic_symbols; |
| 198 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 199 | /// List of file specifications corresponding to the modules (shared |
| 200 | /// libraries) on which this object file depends. |
Greg Clayton | 7b0992d | 2013-04-18 22:45:39 +0000 | [diff] [blame] | 201 | mutable std::unique_ptr<lldb_private::FileSpecList> m_filespec_ap; |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 202 | |
Jim Ingham | 672e6f5 | 2011-03-07 23:44:08 +0000 | [diff] [blame] | 203 | /// Cached value of the entry point for this module. |
| 204 | lldb_private::Address m_entry_point_address; |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 205 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 206 | /// Returns a 1 based index of the given section header. |
Greg Clayton | c7bece56 | 2013-01-25 18:06:21 +0000 | [diff] [blame] | 207 | size_t |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 208 | SectionIndex(const SectionHeaderCollIter &I); |
| 209 | |
| 210 | /// Returns a 1 based index of the given section header. |
Greg Clayton | c7bece56 | 2013-01-25 18:06:21 +0000 | [diff] [blame] | 211 | size_t |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 212 | SectionIndex(const SectionHeaderCollConstIter &I) const; |
| 213 | |
| 214 | /// Parses all section headers present in this object file and populates |
| 215 | /// m_program_headers. This method will compute the header list only once. |
| 216 | /// Returns the number of headers parsed. |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 217 | size_t |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 218 | ParseProgramHeaders(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 219 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 220 | /// Parses all section headers present in this object file and populates |
| 221 | /// m_section_headers. This method will compute the header list only once. |
| 222 | /// Returns the number of headers parsed. |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 223 | size_t |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 224 | ParseSectionHeaders(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 225 | |
Michael Sartain | a7499c9 | 2013-07-01 19:45:50 +0000 | [diff] [blame] | 226 | /// Parses the elf section headers and returns the uuid, debug link name, crc. |
| 227 | static size_t |
| 228 | GetSectionHeaderInfo(SectionHeaderColl §ion_headers, |
| 229 | lldb_private::DataExtractor &data, |
| 230 | const elf::ELFHeader &header, |
| 231 | lldb_private::UUID &uuid, |
| 232 | std::string &gnu_debuglink_file, |
| 233 | uint32_t &gnu_debuglink_crc); |
| 234 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 235 | /// Scans the dynamic section and locates all dependent modules (shared |
Greg Clayton | 710dd5a | 2011-01-08 20:28:42 +0000 | [diff] [blame] | 236 | /// libraries) populating m_filespec_ap. This method will compute the |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 237 | /// dependent module list only once. Returns the number of dependent |
| 238 | /// modules parsed. |
| 239 | size_t |
| 240 | ParseDependentModules(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 241 | |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 242 | /// Parses the dynamic symbol table and populates m_dynamic_symbols. The |
| 243 | /// vector retains the order as found in the object file. Returns the |
| 244 | /// number of dynamic symbols parsed. |
| 245 | size_t |
| 246 | ParseDynamicSymbols(); |
| 247 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 248 | /// Populates m_symtab_ap will all non-dynamic linker symbols. This method |
| 249 | /// will parse the symbols only once. Returns the number of symbols parsed. |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 250 | unsigned |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 251 | ParseSymbolTable(lldb_private::Symtab *symbol_table, |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 252 | lldb::user_id_t start_id, |
Greg Clayton | 3046e66 | 2013-07-10 01:23:25 +0000 | [diff] [blame] | 253 | lldb_private::Section *symtab); |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 254 | |
Michael Sartain | a7499c9 | 2013-07-01 19:45:50 +0000 | [diff] [blame] | 255 | /// Helper routine for ParseSymbolTable(). |
| 256 | unsigned |
| 257 | ParseSymbols(lldb_private::Symtab *symbol_table, |
| 258 | lldb::user_id_t start_id, |
| 259 | lldb_private::SectionList *section_list, |
Greg Clayton | 3046e66 | 2013-07-10 01:23:25 +0000 | [diff] [blame] | 260 | const size_t num_symbols, |
Michael Sartain | a7499c9 | 2013-07-01 19:45:50 +0000 | [diff] [blame] | 261 | const lldb_private::DataExtractor &symtab_data, |
| 262 | const lldb_private::DataExtractor &strtab_data); |
| 263 | |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 264 | /// Scans the relocation entries and adds a set of artificial symbols to the |
| 265 | /// given symbol table for each PLT slot. Returns the number of symbols |
| 266 | /// added. |
| 267 | unsigned |
| 268 | ParseTrampolineSymbols(lldb_private::Symtab *symbol_table, |
| 269 | lldb::user_id_t start_id, |
Michael Sartain | a7499c9 | 2013-07-01 19:45:50 +0000 | [diff] [blame] | 270 | const ELFSectionHeaderInfo *rela_hdr, |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 271 | lldb::user_id_t section_id); |
| 272 | |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 273 | /// Returns the section header with the given id or NULL. |
Michael Sartain | a7499c9 | 2013-07-01 19:45:50 +0000 | [diff] [blame] | 274 | const ELFSectionHeaderInfo * |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 275 | GetSectionHeaderByIndex(lldb::user_id_t id); |
| 276 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 277 | /// @name ELF header dump routines |
| 278 | //@{ |
| 279 | static void |
| 280 | DumpELFHeader(lldb_private::Stream *s, const elf::ELFHeader& header); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 281 | |
| 282 | static void |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 283 | DumpELFHeader_e_ident_EI_DATA(lldb_private::Stream *s, |
| 284 | unsigned char ei_data); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 285 | |
| 286 | static void |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 287 | DumpELFHeader_e_type(lldb_private::Stream *s, elf::elf_half e_type); |
| 288 | //@} |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 289 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 290 | /// @name ELF program header dump routines |
| 291 | //@{ |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 292 | void |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 293 | DumpELFProgramHeaders(lldb_private::Stream *s); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 294 | |
| 295 | static void |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 296 | DumpELFProgramHeader(lldb_private::Stream *s, |
| 297 | const elf::ELFProgramHeader &ph); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 298 | |
| 299 | static void |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 300 | DumpELFProgramHeader_p_type(lldb_private::Stream *s, elf::elf_word p_type); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 301 | |
| 302 | static void |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 303 | DumpELFProgramHeader_p_flags(lldb_private::Stream *s, |
| 304 | elf::elf_word p_flags); |
| 305 | //@} |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 306 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 307 | /// @name ELF section header dump routines |
| 308 | //@{ |
| 309 | void |
| 310 | DumpELFSectionHeaders(lldb_private::Stream *s); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 311 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 312 | static void |
| 313 | DumpELFSectionHeader(lldb_private::Stream *s, |
Michael Sartain | a7499c9 | 2013-07-01 19:45:50 +0000 | [diff] [blame] | 314 | const ELFSectionHeaderInfo& sh); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 315 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 316 | static void |
| 317 | DumpELFSectionHeader_sh_type(lldb_private::Stream *s, |
| 318 | elf::elf_word sh_type); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 319 | |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 320 | static void |
| 321 | DumpELFSectionHeader_sh_flags(lldb_private::Stream *s, |
Greg Clayton | c7bece56 | 2013-01-25 18:06:21 +0000 | [diff] [blame] | 322 | elf::elf_xword sh_flags); |
Stephen Wilson | f325ba9 | 2010-07-13 23:07:23 +0000 | [diff] [blame] | 323 | //@} |
| 324 | |
| 325 | /// ELF dependent module dump routine. |
| 326 | void |
| 327 | DumpDependentModules(lldb_private::Stream *s); |
| 328 | |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 329 | const elf::ELFDynamic * |
| 330 | FindDynamicSymbol(unsigned tag); |
| 331 | |
Stephen Wilson | 499b40e | 2011-03-30 16:07:05 +0000 | [diff] [blame] | 332 | unsigned |
| 333 | PLTRelocationType(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 334 | }; |
| 335 | |
| 336 | #endif // #ifndef liblldb_ObjectFileELF_h_ |