Insoluble displacement `R_X86_64_NONE`

I use Devtoolset-7 on CentOS 7 and has a built-in Boost 1.65.1 w / it. But when I link my application, I have the following:

/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /opt/rh/devtoolset-7/root/usr/lib64/libboost_unit_test_framework.a(compiler_log_formatter.o)(.text._ZN5boost9unit_test5utils11string_castINS0_13basic_cstringIKcEEEESsRKT_[_ZN5boost9unit_test5utils11string_castINS0_13basic_cstringIKcEEEESsRKT_]+0x3c): unresolvable R_X86_64_NONE relocation against symbol `_ZTVSt9basic_iosIcSt11char_traitsIcEE@@GLIBCXX_3.4'
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status

A search for more detailed information R_X86_64_NONEdoes not yield any valuable results: basically similar questions without any answer or an exact explanation of what it is and how to solve it.

So my questions are:

  • What does this error mean?
  • What is it R_X86_64_NONEand why doesn’t "move anything" (according to bintils) does the character type ever exist in ELF headers?

Adding

  • An error occurred while connecting the unit test executables that are associated with my static library and Boosts static libraries (testing module infrastructure).
  • (Boost my one) -fPIC

PS. , ( , binutils ). ( )

+4
1

, Red Hat Bugzilla:

[19:15:01]W:     [Step 8/12] + /usr/lib/rpm/check-buildroot
[19:15:01]W:     [Step 8/12] + /usr/lib/rpm/brp-scl-compress /opt/rh/devtoolset-7/root
[19:15:01]W:     [Step 8/12] + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
[19:16:40]W:     [Step 8/12] /usr/bin/strip: /work/build/BUILDROOT/devtoolset-7-boost-1.65.1-4.el7.centos.x86_64/opt/rh/devtoolset-7/root/usr/lib64/libboost_container.a(global_resource.o): invalid relocation type 42
[19:16:40]W:     [Step 8/12] /usr/bin/strip: BFD version 2.25.1-32.base.el7_4.2  assertion fail elf64-x86-64.c:341

/usr/bin/strip, /opt/rh/devtoolset-7/root/usr/bin/strip. strip. 42 R_X86_64_REX_GOTPCRELX, DTS binutils .

++:

#include <iostream>

void
dot ()
{
  std::cout << '.';
}

-O2 -fpic, X86_64_REX_GOTPCRELX _ZNSt8ios_base4InitD1Ev. /usr/bin/strip -g R_X86_64_NONE. , eu-readelf -r.

RPM, DTS strip,

%if 0%{?scl:1}
%define __strip %{_bindir}/strip
%endif

RPM,

%undefine __brp_strip_static_archive

(, , ).

+3

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


All Articles