The linker reports "short data section overflowed" when the size of the short data section exceeds 2MB. The short data section can accommodate up to 256,000 entries of 8 bytes. If this capacity is exceeded, the message "short data section overflowed" is generated at link time. The following steps may be tried in order to alleviate this problem, in order:
- On Linux*, update your version of ld to the one in binutils 2.13 or later. Earlier versions generate unnecessary short data section entries.
- For C or Fortran, where possible, allocate short data locally rather than globally. (In the Intel® Fortran Compiler, local scalars are allocated automatically on the stack, unless -save or a SAVE statement is used.
- Avoid making many explicit references to single array elements, e.g., for Fortran, A(1), A(2), A(3), A(4), etc. This sometimes occurs in automatically generated codes.
- For Fortran, group static scalars together into a single common block, to reduce the number of short data section entries.
- Increasing the optimization level may sometimes reduce the number of symbols that need to be kept in the short data section.
- The linker options -G0 or --gpsize=0 may sometimes reduce the number of short data section entries.