Hi Majid, I've faced the same problem some time ago. Could you try removing the flag "-fPIC" and using the flag "-no-pie" when linking instead? That's what solved for me at the time. To be honest I don't know why. I do know that KVM instructions are triggered when some magic memory position is accessed, so perhaps having position-independent executable breaks some "contract" with the libm5 library.
Good luck, Pedro. Majid Jalili <majid...@gmail.com> escreveu no dia quarta, 4/05/2022 à(s) 04:28: > Hi, > > I am trying to annotate my benchmark with m5ops and use KVM to expedite > the simulation. > However, when I am trying to use the address-based APIs such > as m5_switch_cpu_addr, I am getting the following link error: > > /usr/bin/ld: ../../util/m5/build/x86/out/libm5.a(m5op_addr.o): relocation > R_X86_64_32S against symbol `m5_mem' can not be used when making a PIE > object; recompile with -fPIE > > If I use the nm tool to look into the lib file (libm5.a), I see the symbol > m5_mem is dangling. > The -fPIE is enabled, but the problem persists. > > Thanks, > Majid > > cc@hfreq:~/borrow/util/m5/build/x86/out$ nm libm5.a > > m5_mmap.o: > 0000000000000000 r .LC0 > 0000000000000018 r .LC1 > 000000000000002b r .LC2 > U _GLOBAL_OFFSET_TABLE_ > U __errno_location > U __fprintf_chk > U close > U exit > U fwrite > 0000000000000000 B m5_mem > 0000000000000000 D m5_mmap_dev > 0000000000000000 D m5op_addr > 0000000000000000 T map_m5_mem > U mmap > U munmap > U open > U stderr > U strerror > 00000000000000f0 T unmap_m5_mem > > m5op.o: > 0000000000000064 T m5_add_symbol > 0000000000000000 T m5_arm > 000000000000004b T m5_checkpoint > 000000000000005a T m5_debug_break > 0000000000000078 T m5_dist_toggle_sync > 0000000000000046 T m5_dump_reset_stats > 0000000000000041 T m5_dump_stats > 0000000000000023 T m5_exit > 0000000000000028 T m5_fail > 0000000000000032 T m5_init_param > 0000000000000037 T m5_load_symbol > 0000000000000069 T m5_panic > 0000000000000005 T m5_quiesce > 000000000000000f T m5_quiesce_cycle > 000000000000000a T m5_quiesce_ns > 0000000000000014 T m5_quiesce_time > 0000000000000055 T m5_read_file > 000000000000003c T m5_reset_stats > 0000000000000019 T m5_rpns > 000000000000002d T m5_sum > 000000000000005f T m5_switch_cpu > 000000000000001e T m5_wake_cpu > 000000000000006e T m5_work_begin > 0000000000000073 T m5_work_end > 000000000000007d T m5_workload > 0000000000000050 T m5_write_file > > m5op_addr.o: > 00000000000001e0 T m5_add_symbol_addr > 0000000000000000 T m5_arm_addr > 0000000000000168 T m5_checkpoint_addr > 00000000000001b0 T m5_debug_break_addr > 0000000000000240 T m5_dist_toggle_sync_addr > 0000000000000150 T m5_dump_reset_stats_addr > 0000000000000138 T m5_dump_stats_addr > 00000000000000a8 T m5_exit_addr > 00000000000000c0 T m5_fail_addr > 00000000000000f0 T m5_init_param_addr > 0000000000000108 T m5_load_symbol_addr > U m5_mem > 00000000000001f8 T m5_panic_addr > 0000000000000018 T m5_quiesce_addr > 0000000000000048 T m5_quiesce_cycle_addr > 0000000000000030 T m5_quiesce_ns_addr > 0000000000000060 T m5_quiesce_time_addr > 0000000000000198 T m5_read_file_addr > 0000000000000120 T m5_reset_stats_addr > 0000000000000078 T m5_rpns_addr > 00000000000000d8 T m5_sum_addr > 00000000000001c8 T m5_switch_cpu_addr > 0000000000000090 T m5_wake_cpu_addr > 0000000000000210 T m5_work_begin_addr > 0000000000000228 T m5_work_end_addr > 0000000000000258 T m5_workload_addr > 0000000000000180 T m5_write_file_addr > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-le...@gem5.org > -- Pedro Henrique Exenberger Becker Ph.D. Student at Universitat Politècnica de Catalunya
_______________________________________________ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org