debug/elf: validate shstrndx
debug/elf: validate shstrndx

Changes:

1. When e_shstrndx holds the value SHN_UNDEF (0), the file has no section
name string table. In this case, do not try to set section names .
2. e_shstrndx should point to an SHT_STRTAB section. If it does not, returns
an error.

Reference:
https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html

Updates #54967.

Change-Id: Ic8f228061d996fd7845dfa630719a1ba12d2bb60
GitHub-Last-Rev: aeb70ca8a08e7dbc36ed61bd5a2dabcf432540e9
GitHub-Pull-Request: golang/go#55001
Reviewed-on: https://go-review.googlesource.com/c/go/+/430155
Auto-Submit: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@google.com>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@google.com>
Reviewed-by: Cherry Mui <d62e63aa42ce272d7b6a5055d97e942b33a34679@google.com>
Run-TryBot: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@google.com>
TryBot-Result: Gopher Robot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>

golang/go,golang/go,golang/go,golang/go,golang/go,golang/go,golang/go,golang/go