GDB and shared object libraries with SIGILL

I am trying to debug programs on the target ARM device with GDB, and GDB seems to act oddly with respect to ld-linux.so.3. This is a simple program that just printf ("Hello World").

In about half the cases, gdb will be launched, and the second half will say this error after entering the run:

Program received signal SIGILL, Illegal instruction.
0x2aab9bc4 in _dl_debug_state () from /lib/ld-linux.so.3

I also tried statically linking the libraries, and I still get this error, although a little less, but it still happens with enough frequency to be problematic.

I set the solib-absolute-pre-to / dev / null and solib-search-path prefix to / lib / on the target, and it loads ld-linux.so.3 in the order that is mentioned. Is there anything I need to do to recompile the libraries again for the target, or some flags that GDB wants to know?

Thank!

+3
source share

Source: https://habr.com/ru/post/1760223/