HexHive / retrowrite

RetroWrite -- Retrofitting compiler passes through binary rewriting
Other
655 stars 78 forks source link

undefined reference to `__asan_init_v4' encounters, how to fix it ? #12

Closed helios-ops closed 4 years ago

helios-ops commented 4 years ago

Hello ! I entered the 'demo' subdirectory and 'make heap.asan'. However, I encountered the following message:

[] Relocations for a section that's not loaded: .rela.dyn [] Relocations for a section that's not loaded: .rela.plt [x] Couldn't find valid section 403ff0 [x] Couldn't find valid section 403ff8 [] Loading analysis cache [] Instrumented: 25 locations Stats: [ 4 14 7] {"rflags": 21, "rdi": 15, "rax": 10, "rbp": 1, "rsi": 2} rflags live: 4, rflags + 0 regs: 2, rflags + rax: 0, rflags + >= 1 reg: 2 clang heap.asan.s -lasan -o heap.asan /usr/bin/ld: /tmp/heap-1df0be.o: in function asan.module_ctor': (.text+0x542): undefined reference to__asan_init_v4' clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried the following solutions: 1) change the compiler from clang-9 to gcc-4.8, 2) change the '-lasan' linkage option to '-static-libasan' as some googled tips said, but all fail to the same error message. So how to fix it ? Looking forward to your suggestion ~

helios-ops commented 4 years ago

Well, I've fixed it by myself, thank you !

chaoxiyan1225 commented 2 months ago

Well, I've fixed it by myself, thank you !

how you fix it ? Can u give the detail ? thx