Troubleshooting
Problem
Linking object files compiled with the XL compilers is resulting in a segmentation fault or linker error on Red Hat Enterprise Linux 6.1 (RHEL 6.1).
Cause
Changes made to the binutils package included with RHEL 6.1 affected how the linker handles .toc entries. This created the following cases where object files built with the XL compilers would cause the linker to encounter an error:
Issue 1: If an input object file has a non-empty .toc section but no references to the .toc entries, the linker will encounter a memory fault and exit.
Issue 2: For object files with a large .toc section, the linker incorrectly attempts to optimize the object by removing non-referenced entries, resulting in the following error message:
./usr/bin/ld: XXXXX defined on removed toc entry
Environment
Red Hat Enterprise Linux 6.1 with the binutils-2.20.51.0.2-5.20.el6.ppc64 binutils package installed.
Diagnosing The Problem
You can verify the binutils version installed on a system using the following command:
$ rpm -qa | grep binutils
Resolving The Problem
Issue 1: Red Hat released a fix update for the binutils package that corrects this issue. The updated package, labeled 'binutils-2.20.51.0.2-5.20.el6_1.1.ppc64', can be obtained via the Red Hat Network. See the link in the Related information section for details.
Issue 2: The incorrect optimization can be disabled with the linker option --no-toc-optimize. You can pass this option directly to the linker via the compile option '-Wl,--no-toc-optimize'.
Related Information
Was this topic helpful?
Document Information
Modified date:
08 August 2018
UID
swg21568608