In addition, when attempting to create a static library by manually archiving the library, the following error is emitted:
0711-781 ERROR: TOC overflow. TOC size: 206424 Maximum size: 65536 implementing
the followwing ibm page:
suggests adding -bbigtoc to the build (but discourages doing so). the result is an ugly warning:
ld: 0711-783 WARNING: TOC overflow. TOC size: 206424 Maximum size: 65536
Extra instructions are being generated for each reference to a TOC
symbol if the symbol is in the TOC overflow area.
The above link explains this warning:
One disadvantage of using this option is that it generates extra code if the size of the table of contents
(TOC) is greater than 64KB. Extra code is needed for every reference to a TOC symbol that cannot be addressed with a 16-bit offset. Because a program containing generated code may have poor
performance, you should reduce the number of TOC entries needed by the program before using this option.
The way to do it is: "Break up large segments of code into smaller compilation units" and "Reduce the number of variables in the compilation unit "