2

When I command "make", then I got an error like this:

/usr/bin/ld: ../../../lib//liblmi.a(LMInterface.o): unrecognized relocation (0x2a) in section `.text'

This error is caused by earlier version of binutils, and I have binutils like this:

GNU ld (GNU Binutils for Ubuntu) 2.24

I installed binutils-2.26 by following commands

$ sudo apt-get update
$ sudo apt-get install binutils-2.26

But I have a problem, I installed binutils-2.26, but the default binutils version is 2.24, so How can I convert binutils-2.26 into the default binutils?

Gi Yeon Shin
  • 357
  • 2
  • 7
  • 19
  • `$ dpkg -l | grep binutils` ==> `ii binutils 2.24-5ubuntu14.2 amd64 GNU assembler, linker and binary utilities ii binutils-2.26 2.26.1-1ubuntu1~14.04 amd64 GNU assembler, linker and binary utilities` – Gi Yeon Shin Oct 11 '18 at 08:56
  • I just installed binutils by `sudo apt-get install binutils-2.26` – Gi Yeon Shin Oct 11 '18 at 08:56

1 Answers1

2

binutils-2.26 provides the individual programs under names such as /usr/bin/as-2.26 and /usr/bin/ld-2.26, so that the binutils and binutils-2.26 packages can be installed at the same time. However, unversioned names of the programs are available in the /usr/lib/binutils-2.26/bin directory, so you can activate them using this shell command:

PATH="/usr/lib/binutils-2.26/bin:$PATH"

As a result, gcc and g++ will use binutils 2.26 instead of the default binutils version.

Florian Weimer
  • 32,022
  • 3
  • 48
  • 92
  • Thank you very much, I solved the problem. But there's another problem when I command `make` compile: `block_builder.cc:(.text+0x29e): undefined reference to std::__cxx11::basic_string, std::allocator >::_M_append(char const*, unsigned long)'`, My ubuntu version is 14.04, so is this caused by version of ubuntu? – Gi Yeon Shin Oct 11 '18 at 09:22
  • Yes, you need a newer `libstdc++`, or compile with something like DTS for Ubuntu (not sure if that actually exists, sorry). – Florian Weimer Oct 11 '18 at 09:25
  • So how can i get newer `libstdc++`? Is there other ways except upgrading Ubuntu? I add command like this : `CFLAGS= -c -O2 -Wall -D_I386 -D_UNIX -fPIC -Wno-unused-result -std=c++11 -Wno-sign-compare -D_GLIBCXX_USE_CXX11_ABI=0`, But the result does not change... – Gi Yeon Shin Oct 11 '18 at 09:46
  • And the version of `libstdc++` is `libstdc++.so.6` – Gi Yeon Shin Oct 11 '18 at 10:05