Currently I'm running some multi-threaded code which all compiles with no errors or warnings and I get this error when I execute the code:
relocation error: /lib/x86_64-linux-gnu/libgcc_s.so.1: 1thread_mutex_locXãƨ+�����Ȩ+ ������ƨ+�&쏭Ũ�Ȩ+e
What is a relocation error?
The relocation is process of adopting some offsets in the code to the actual memory layout. Relocations (places which will be edited by relocation process and the description of each relocation) are generated by compiler, e.g. for TLS variables, for dynamic library calls, for PIC/PIE code. Relocation description is stored in the binary file (e.g. in ELF format in Linux).
Relocations are partially done in linking step, by ld
linker program in linux; other linkers in other OSes.
But there are some relocations which can't be done in offline (before starting program). Such relocations are needed to use ASLR (address space layout randomization), to load dynamic libraries. So some of them are done just before starting a program, by the program interpreter, (ld.so
in linux), which is also called runtime linker. It will load your program and its dynamic libraries into memory and will do relocations.
Third place where relocations are done: is a call to dlopen()
(in libdl.so
in unix). It is library to dynamically load dynamic libraries; and because dynamic libraries has relocations, this library should do them too.
The error message is from some linker, and if you see this after starting a program, this is second (ld.so) or third case (libdl).
I can't find exact place where this message is generated, but it is possible due
LD_BIND_NOW
(if you are on glibc or derivative) to non-null.valgrind
(if you are on intel).valgrind --tool=helgrind
(if you are on intel and have a lot of time to wait)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With