#341 Too many sections aka /bigobj replacement flag

v1.0 (example)
André Stein

We currently have the problem that many .cpp files trigger a
"as.exe: file too big / too many section (3****)" error. The number of sections seems to be limited to around 32000. The code is C++ with heavy template usage. A limited workaround is to enable optimization but the build might still break in future. And the build time increases a lot in debug mode; additionally debugging is made harder because optimization leads to statement reordering.
The same code builds fine with MSVC (which we would like to abandon). In MSVC there is a flag /bigobj which allows to build the source even in Debug mode. Is there some equivalent in MingW?
I think this is a serious problem for big code bases which rely on template code. The MSVC compiler implements a workaround with /bigobj so technically it should be possible for MingW to implement the same workaround.


  • Kai Tietz
    Kai Tietz

    • status: open --> closed
  • Kai Tietz
    Kai Tietz

    This issue got recently address by binutils. Current upstream head-version of it is able to handle big-obj pe-coff object. By this you can solve the issue.
    See for details https://sourceware.org/ml/binutils/2014-03/msg00114.html