From a9e03f6461648f9b281b957585ccdaf8ac1905e1 Mon Sep 17 00:00:00 2001 From: tracer-ysyx Date: Wed, 20 Mar 2024 14:57:04 +0800 Subject: [PATCH] =?UTF-8?q?>=20compile=20NEMU=20ysyx=5F22040000=20?= =?UTF-8?q?=E6=9D=8E=E5=BF=83=E6=9D=A8=20Linux=20calcite=206.6.19=20#1-Nix?= =?UTF-8?q?OS=20SMP=20PREEMPT=5FDYNAMIC=20Fri=20Mar=20=201=2012:35:11=20UT?= =?UTF-8?q?C=202024=20x86=5F64=20GNU/Linux=20=2014:57:04=20=20up=20=20=202?= =?UTF-8?q?:03,=20=202=20users,=20=20load=20average:=200.46,=200.55,=200.6?= =?UTF-8?q?3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nemu/src/utils/elf-parser.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nemu/src/utils/elf-parser.c b/nemu/src/utils/elf-parser.c index 1bac7c1..1375bf7 100644 --- a/nemu/src/utils/elf-parser.c +++ b/nemu/src/utils/elf-parser.c @@ -61,8 +61,6 @@ void init_elf(const char *path) { f->len = sym[j].st_size; f->name = func; ++func_table_len; - // puts(func); - printf("%s: 0x%x - 0x%x\n", f->name, f->start, f->start + f->len); if(func_table_len >= func_table_size) { Assert(func_table_size * 2 > func_table_size, "Function table exceed memory limit"); func_table_size *= 2; @@ -71,6 +69,11 @@ void init_elf(const char *path) { } } qsort(func_table, func_table_len, sizeof(func_t), cmp_func_t); + for(int i = 0; i < func_table_len; i++) { + func_t *f = &func_table[func_table_len]; + // puts(func); + printf("%s: 0x%x - 0x%x\n", f->name, f->start, f->start + f->len); + } success = true; failed: for(int i = 0; i < func_table_len; i++) {