Why Program linking against libelf.so of developer toolset fails?

Solution Verified - Updated -


  • Program linking against libelf.so provided with devtoolset-<version>-elfutils-libelf-devel fails with below error
$ gcc -o main.out main.o -L . -lcallelf -lelf
/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/ld: main.out: hidden symbol `elf_end' in /opt/rh/devtoolset-3/root/usr/lib/gcc/x86_64-redhat-linux/4.9.1/../../../../lib64/libelf.ar(libelf_a-elf_end.o) is referenced by DSO
/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status


  • Red Hat Enterprise Linux 6
  • Developer Toolset

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In