diff options
Diffstat (limited to 'src/core/loader/elf.cpp')
| -rw-r--r-- | src/core/loader/elf.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 8eb5200ab..cfcde9167 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "common/file_util.h" | 9 | #include "common/file_util.h" |
| 10 | #include "common/logging/log.h" | 10 | #include "common/logging/log.h" |
| 11 | #include "common/symbols.h" | ||
| 12 | #include "core/hle/kernel/process.h" | 11 | #include "core/hle/kernel/process.h" |
| 13 | #include "core/hle/kernel/resource_limit.h" | 12 | #include "core/hle/kernel/resource_limit.h" |
| 14 | #include "core/loader/elf.h" | 13 | #include "core/loader/elf.h" |
| @@ -210,7 +209,6 @@ public: | |||
| 210 | return (u32)(header->e_flags); | 209 | return (u32)(header->e_flags); |
| 211 | } | 210 | } |
| 212 | SharedPtr<CodeSet> LoadInto(u32 vaddr); | 211 | SharedPtr<CodeSet> LoadInto(u32 vaddr); |
| 213 | bool LoadSymbols(); | ||
| 214 | 212 | ||
| 215 | int GetNumSegments() const { | 213 | int GetNumSegments() const { |
| 216 | return (int)(header->e_phnum); | 214 | return (int)(header->e_phnum); |
| @@ -258,8 +256,6 @@ ElfReader::ElfReader(void* ptr) { | |||
| 258 | sections = (Elf32_Shdr*)(base + header->e_shoff); | 256 | sections = (Elf32_Shdr*)(base + header->e_shoff); |
| 259 | 257 | ||
| 260 | entryPoint = header->e_entry; | 258 | entryPoint = header->e_entry; |
| 261 | |||
| 262 | LoadSymbols(); | ||
| 263 | } | 259 | } |
| 264 | 260 | ||
| 265 | const char* ElfReader::GetSectionName(int section) const { | 261 | const char* ElfReader::GetSectionName(int section) const { |
| @@ -362,34 +358,6 @@ SectionID ElfReader::GetSectionByName(const char* name, int firstSection) const | |||
| 362 | return -1; | 358 | return -1; |
| 363 | } | 359 | } |
| 364 | 360 | ||
| 365 | bool ElfReader::LoadSymbols() { | ||
| 366 | bool hasSymbols = false; | ||
| 367 | SectionID sec = GetSectionByName(".symtab"); | ||
| 368 | if (sec != -1) { | ||
| 369 | int stringSection = sections[sec].sh_link; | ||
| 370 | const char* stringBase = reinterpret_cast<const char*>(GetSectionDataPtr(stringSection)); | ||
| 371 | |||
| 372 | // We have a symbol table! | ||
| 373 | const Elf32_Sym* symtab = reinterpret_cast<const Elf32_Sym*>(GetSectionDataPtr(sec)); | ||
| 374 | unsigned int numSymbols = sections[sec].sh_size / sizeof(Elf32_Sym); | ||
| 375 | for (unsigned sym = 0; sym < numSymbols; sym++) { | ||
| 376 | int size = symtab[sym].st_size; | ||
| 377 | if (size == 0) | ||
| 378 | continue; | ||
| 379 | |||
| 380 | int type = symtab[sym].st_info & 0xF; | ||
| 381 | |||
| 382 | const char* name = stringBase + symtab[sym].st_name; | ||
| 383 | |||
| 384 | Symbols::Add(symtab[sym].st_value, name, size, type); | ||
| 385 | |||
| 386 | hasSymbols = true; | ||
| 387 | } | ||
| 388 | } | ||
| 389 | |||
| 390 | return hasSymbols; | ||
| 391 | } | ||
| 392 | |||
| 393 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 361 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 394 | // Loader namespace | 362 | // Loader namespace |
| 395 | 363 | ||