The sh_info field of the SHT_SYMTAB section holds the index for the first non-local symbol. When there are global symbols that are output with STB_LOCAL binding due to having hidden visibility or matching the local version from a version script, the calculated value of NumLocals + 1 does not account for them. This change adds in the number of local symbols that aren't covered by NumLocals.
I think that this property is of marginal use in an Executable/Shared object but there could be an ELF processing tool that could get confused if it skips all the local symbols in the file using the sh_info field.
The test updates are where we have a global symbol output with local binding and a check of a sh_info field.
I noticed this while working on support for synthetic local symbols. It feels like a bit of a hack, but if NumLocals is interpreted as number of locals stored outside of the SymbolTableSection::Symbols in Files it makes a bit more sense.