Bug 1295951

Summary: Unsupported/confusing golang notes
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: elfutilsAssignee: Mark Wielaard <mjw>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: aoliva, fche, jakub, me, mjw, mjw, roland
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: elfutils-0.166-1.fc24 elfutils-0.166-1.fc23 elfutils-0.166-1.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-09 14:21:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Kratochvil 2016-01-05 21:34:38 UTC
Description of problem:
Upstream 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
echo -e 'package main\nfunc main() {}' >foo.go;/usr/lib/golang/bin/go build -a foo.go;eu-readelf -Wn foo

Actual results:
Note section [11] '.note.go.buildid' of 56 bytes at offset 0xfc8:
  Owner          Data size  Type
  Go                    40  GNU_GOLD_VERSION

Expected results:
Note section [11] '.note.go.buildid' of 56 bytes at offset 0xfc8:
  Owner          Data size  Type
  Go                    40  ELF_NOTE_GOBUILDID_TAG
    Build ID: db4fe260f8ebfa316307ed224cc8fa860fe60e3f

Additional info:
https://go.googlesource.com/go/+/master/src/cmd/link/internal/ld/elf.go#1280
	ELF_NOTE_GOPKGLIST_TAG = 1
	ELF_NOTE_GOABIHASH_TAG = 2
	ELF_NOTE_GODEPS_TAG    = 3
	ELF_NOTE_GOBUILDID_TAG = 4
vs.
/usr/include/elf.h
#define NT_GNU_GOLD_VERSION     4

$ objdump -s -j .note.go.buildid foo
Contents of section .note.go.buildid:
 400fc8 04000000 28000000 04000000 476f0000  ....(.......Go..
 400fd8 64623466 65323630 66386562 66613331  db4fe260f8ebfa31
 400fe8 36333037 65643232 34636338 66613836  6307ed224cc8fa86
 400ff8 30666536 30653366                    0fe60e3f        

$ readelf -n foo
Displaying notes found at file offset 0x00000fc8 with length 0x00000038:
  Owner                 Data size	Description
  Go                   0x00000028	Unknown note type: (0x00000004)

Comment 1 Mark Wielaard 2016-01-06 14:19:28 UTC
You are right, we seem to not check the note originator name and assume it is "GNU" if we don't recognize it. This needs fixing in ebl_object_note and ebl_object_note_type_name.

Comment 2 Mark Wielaard 2016-02-12 14:14:01 UTC
Proposed a patch upstream:

commit 58ec17dbc828160f46c9bb4bc7ab97b44ac6b8fc
Author: Mark Wielaard <mjw>
Date:   Fri Feb 12 15:04:00 2016 +0100

    libebl: Don't assume ELF notes are "GNU" when unknown, recognize "Go" notes.
    
    We used to assume any unknown ELF note provider name was "GNU" and didn't
    recognize any of the "Go" provider types. We now check the provider name
    explictly in ebl_object_note_type_name and recognize the following Go
    note names: PKGLIST, ABIHASH, DEPS and BUILDID. But there is no attempt
    yet in ebl_object_note to decode the description of these notes.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1295951
    
    Signed-off-by: Mark Wielaard <mjw>

Comment 3 Jan Kurik 2016-02-24 14:13:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 4 Mike McCune 2016-03-28 23:00:31 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 5 Fedora Update System 2016-03-31 20:57:20 UTC
elfutils-0.166-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-e54f96cc35

Comment 6 Fedora Update System 2016-04-02 05:25:27 UTC
elfutils-0.166-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-e54f96cc35

Comment 7 Fedora Update System 2016-04-04 17:23:47 UTC
elfutils-0.166-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2016-04-05 09:29:48 UTC
elfutils-0.166-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-9ebdb3d44e

Comment 9 Fedora Update System 2016-04-05 12:01:09 UTC
elfutils-0.166-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-6d6f111230

Comment 10 Fedora Update System 2016-04-06 18:21:20 UTC
elfutils-0.166-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-9ebdb3d44e

Comment 11 Fedora Update System 2016-04-07 16:50:00 UTC
elfutils-0.166-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-6d6f111230

Comment 12 Fedora Update System 2016-04-09 14:21:10 UTC
elfutils-0.166-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2016-04-22 01:51:19 UTC
elfutils-0.166-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.