aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDan Kegel <[email protected]>2022-01-24 15:00:06 -0800
committerRon Evans <[email protected]>2022-01-25 07:26:06 +0100
commit3fbab2ede38fc21d6e3f8f3475564e86a9a7b5e6 (patch)
tree6ad27eac661b92106315cfcf3502e20af0c85824
parenta29e1d43f151f50adbc49cfcc228654dcc102576 (diff)
downloadtinygo-3fbab2ede38fc21d6e3f8f3475564e86a9a7b5e6.tar.gz
tinygo-3fbab2ede38fc21d6e3f8f3475564e86a9a7b5e6.zip
builder/buildid.go: accept alternate name for buildid section on Linux
On Ubuntu, using standard go, both go and gnu buildid sections are present. On Alpine, the gnu buildid section is absent, which caused tinygo to abort early. It is possible that we could hit a situation where only the gnu buildid section is present, so accept either one just in case. Fixes https://github.com/tinygo-org/tinygo/issues/2580
-rw-r--r--builder/buildid.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/builder/buildid.go b/builder/buildid.go
index e5529c5dd..e23c75f5d 100644
--- a/builder/buildid.go
+++ b/builder/buildid.go
@@ -31,7 +31,8 @@ func ReadBuildID() ([]byte, error) {
return nil, err
}
for _, section := range file.Sections {
- if section.Type != elf.SHT_NOTE || section.Name != ".note.gnu.build-id" {
+ if section.Type != elf.SHT_NOTE ||
+ (section.Name != ".note.gnu.build-id" && section.Name != ".note.go.buildid") {
continue
}
buf := make([]byte, section.Size)