> compile NEMU

221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 00:26:36 up 5 days, 12:34,  3 users,  load average: 0.57, 0.64, 0.56
This commit is contained in:
tracer-ics2023
2024-09-11 00:26:37 +08:00
committed by zzy
parent 478b127b4e
commit 074efbefd1

View File

@ -51,10 +51,10 @@ void init_elf(const char* elf_file) {
assert(ret == 1);
switch (e_ident[EI_CLASS]) {
case ELFCLASS32:
Log("ELF class: ELF32");
// Log("ELF class: ELF32");
break;
case ELFCLASS64:
Log("ELF class: ELF64");
// Log("ELF class: ELF64");
break;
default:
Assert(false, "Error: unknown or unsupported ELF class.");
@ -102,6 +102,7 @@ void init_elf(const char* elf_file) {
// filling ftrace
assert(psymt != NULL && pstrt != NULL);
for (int i = 0; i < symt_len; i ++) {
Log("%3d: %08x "FMT_WORD" "FMT_WORD"", i, psymt[i].st_value, psymt[i].st_size, psymt[i].st_name);
if (ELF_ST_TYPE(psymt[i].st_info) == STT_FUNC) {
// Warning due to elf_ftrace is global variable so you don't need to set '\0' in the end
strncpy(elf_ftrace[elf_ftrace_size].fname, pstrt + psymt[i].st_name,