1
0
mirror of https://github.com/golang/go synced 2024-07-08 12:18:55 +00:00

cmd/go: close elf file in the readpkglist function

Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
guoguangwu 2024-03-29 14:12:50 +08:00
parent bb523c9542
commit daec402b39

View File

@ -384,6 +384,7 @@ func readpkglist(shlibpath string) (pkgs []*load.Package) {
if err != nil {
base.Fatal(fmt.Errorf("failed to open shared library: %v", err))
}
defer f.Close()
sect := f.Section(".go_export")
if sect == nil {
base.Fatal(fmt.Errorf("%s: missing .go_export section", shlibpath))