ianlancetaylor / libbacktrace

A C library that may be linked into a C/C++ program to produce symbolic backtraces
Other
941 stars 220 forks source link

can't resolve symbol 'dl_iterate_phdr' #83

Open arc1986 opened 2 years ago

arc1986 commented 2 years ago

I tried cross compiled on MIPS and the static lib was generated fine

./mips-linux-gcc --version mips-linux-xgcc (Realtek RSDK-1.5.6p2) 4.4.6 Copyright (C) 2010 Free Software Foundation, Inc. ls ../rsdk-1.5.6-5281-EB-2.6.30-0.9.30.3-131105/lib/libbacktrace.a

But getting below error while executing the below 'bt' same code (statically linked with libbacktrace.a) https://github.com/ErwanLegrand/libbacktrace/blob/master/examples/bt.c

output/bt: ELF 32-bit MSB executable, MIPS, MIPS-I version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, with debug_info, not stripped ./bt can't resolve symbol 'dl_iterate_phdr'

ianlancetaylor commented 2 years ago

That's odd. The libbacktrace configure script checks whether dl_iterate_phdr exists, and only calls it if it is present on the system. Why does the configure script find dl_iterate_phdr if it is not present on your system?

arc1986 commented 2 years ago

Yeah, I re-checked it, 'dl_iterate_phdr' is present in the system. But not sure why I'm getting that error only if I ran 'bt' code,

arc1986 commented 2 years ago

the error is gone when I compiled the code with '-static', however now getting a segmentaion fault,

ianlancetaylor commented 1 month ago

I have no idea what is happening here. Is this still a problem? Thanks.