Handling table of contents (TOC) overflow

To handle table of contents (TOC) overflow, you can reduce the number of global symbols, enlarge the TOC access range, or apply interprocedural analysis.

The addresses of global symbols in programs are stored in a data structure called TOC. To access a global symbol, the address of the global symbol must be retrieved from the TOC. The default TOC data structure has a fixed size that can store a fixed number of global symbols. For example, the IBM® PowerPC® architecture uses an instruction with a signed 16-bit offset for indirect address calculations and limits the size of the TOC to 64 KB. A maximum of 16 K entries can be stored in the TOC in 32-bit mode and 8 K entries in 64-bit mode.

For large applications, it is common to have more global symbols than can be stored in the default TOC. If an application contains more TOC entries than the TOC can hold, the linker reports TOC overflow, indicating that an alternative mechanism must be used. Use the following approaches to handle TOC overflow:



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us