]> Cypherpunks repositories - gostls13.git/commit
cmd/link/internal/loadelf: fix logic for computing ELF flags on ARM
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Wed, 7 Feb 2018 02:46:26 +0000 (15:46 +1300)
committerIan Lance Taylor <iant@golang.org>
Wed, 7 Feb 2018 05:10:13 +0000 (05:10 +0000)
commitb2d3d6e676450cc1a5d5a611d3711dce2800bc0d
tree65c141b3eb3aa5d3b8470d534e3f8acbe02259b8
parentc07095cd287e2e0a5d7deadabb1c371be4a542f7
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 <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/loadelf/ldelf.go