Attempts to link a library that is instrumented using IBM Rational Purify result in the error of relocation truncated to fit: R_X86_64_32 against `.gcc_except_table' at .eh_frame section during link time.
This is an example of the error message:
<path_to>/<lib_name>_pure_pp0_pc0_0_0_1302171628_64.a:(.eh_frame+0x1a61): relocation truncated to fit: R_X86_64_32 against `.gcc_except_table'
Purify engine: Error: The linker returned error code: 1
One possible cause of this type of error is that if the application is large.
By default, some relocations use 32-bit calculations because the mcmodel is small or medium.
If a .o file is generated with one of these models but linked into a large application, it may end up at a high address. When Purify is involved, the uninstrumented application may fit ok but because Purify increases the size of all modules, the instrumented application may overflow.
Diagnosing the problem
Build the uninstrumented application and look at the address of the .gcc_except_table.
If it is near 2G, you have probably located the issue.
Resolving the problem
You are able to prevent this issue by having object files that use the gcc option -mcmodel=large.
This will use 64-bit relocations instead of 32-bit.