Bug 1295951 - Unsupported/confusing golang notes
Unsupported/confusing golang notes
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: elfutils (Show other bugs)
24
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Mark Wielaard
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-05 16:34 EST by Jan Kratochvil
Modified: 2016-04-21 21:51 EDT (History)
7 users (show)

See Also:
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 10:21:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Kratochvil 2016-01-05 16:34:38 EST
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 09:19:28 EST
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 09:14:01 EST
Proposed a patch upstream:

commit 58ec17dbc828160f46c9bb4bc7ab97b44ac6b8fc
Author: Mark Wielaard <mjw@redhat.com>
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@redhat.com>
Comment 3 Jan Kurik 2016-02-24 09:13:56 EST
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 19:00:31 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 5 Fedora Update System 2016-03-31 16:57:20 EDT
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 01:25:27 EDT
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 13:23:47 EDT
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 05:29:48 EDT
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 08:01:09 EDT
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 14:21:20 EDT
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 12:50:00 EDT
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 10:21:10 EDT
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-21 21:51:19 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.