Backport upstream commit which prevents internal error when generating an overly large gdb-index file. (RHBZ 1773651, Kevin Buettner.)