Why Program linking against libelf.so of developer toolset fails?
Issue
- Program linking against
libelf.so
provided withdevtoolset-<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
Environment
- Red Hat Enterprise Linux 6
- Developer Toolset
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.