cmd/link/internal/loadelf: fix logic for computing ELF flags on ARM
cmd/link/internal/loadelf: fix logic for computing ELF flags on ARM

The linker contains complicated logic for figuring out which float ABI to
indicate it is using on (32 bit) ARM systems: it parses a special section in
host object files to look for a flag indicating use of the hard float ABI. When
loadelf got split into its own package a bug was introduced: if the last host
object file does not contain a float ABI related tag, the ELF header's flag was
set to 0, rather than using the value from the last object file which contained
an ABI tag. Fix the code to only change the value used for the ELF header if a
tag was found.

This fixes an extremely confusing build failure on Ubuntu's armhf builders.

Change-Id: I0845d68d082d1383e4cae84ea85164cdc6bcdddb
Reviewed-on: https://go-review.googlesource.com/92515
Run-TryBot: Michael Hudson-Doyle <5e87ffb38a52af6fb9a19b679e9122c7a4d601a5@canonical.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>

codestation/go,nawawi/go,CAFxX/go,CAFxX/go,nawawi/go,golang/go,golang/go,josharian/go,akutz/go,CAFxX/go,akutz/go,Cofyc/go,cloudflare/go,golang/go,cloudflare/go,Cofyc/go,cloudflare/go,codestation/go,akutz/go,CAFxX/go,josharian/go,nawawi/go,akutz/go,codestation/go,CAFxX/go,golang/go,Cofyc/go,nawawi/go,josharian/go,golang/go,golang/go,nawawi/go,josharian/go,josharian/go,akutz/go,golang/go,christopher-henderson/Go,CAFxX/go,cloudflare/go,akutz/go,Cofyc/go,josharian/go,cloudflare/go,golang/go,akutz/go,codestation/go,codestation/go,Cofyc/go,nawawi/go,CAFxX/go,nawawi/go,cloudflare/go,josharian/go,cloudflare/go,akutz/go,CAFxX/go,Cofyc/go,codestation/go,Cofyc/go,cloudflare/go,nawawi/go,josharian/go,codestation/go,codestation/go,Cofyc/go