Commit: readelf: recognise GO buildid notes

Message ID 87sg1jl86f.fsf@redhat.com
State New
Headers show
Series
  • Commit: readelf: recognise GO buildid notes
Related show

Commit Message

H.J. Lu via Binutils June 15, 2021, 10:43 a.m.
Hi Guys,

  I am checking in the patch below so that readelf can recognise notes
  found in .note.go.buildid sections.  It does not add the ability to
  decode the contents of these notes, as I have not been able to find a
  description of the format.

Cheers
  Nick

binutils/ChangeLog
2021-06-15  Nick Clifton  <nickc@redhat.com>

	* readelf.c (get_note_type): Add support for NT_GO_BUILDID.

include/ChangeLog
2021-06-15  Nick Clifton  <nickc@redhat.com>

	* elf/common.h (NT_GO_BUILDID): Define.

Patch

diff --git a/binutils/readelf.c b/binutils/readelf.c
index e104a7ed2a1..20100f11ce6 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -18859,6 +18859,8 @@  get_note_type (Filedata * filedata, unsigned e_type)
 	return _("OPEN");
       case NT_GNU_BUILD_ATTRIBUTE_FUNC:
 	return _("func");
+      case NT_GO_BUILDID:
+	return _("GO BUILDID");
       default:
 	break;
       }
diff --git a/include/elf/common.h b/include/elf/common.h
index 24d0a09b7c8..58b0936db3b 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -748,6 +748,7 @@ 
 
 #define NT_VERSION	1		/* Contains a version string.  */
 #define NT_ARCH		2		/* Contains an architecture string.  */
+#define NT_GO_BUILDID	4		/* Contains GO buildid data.  */
 
 /* Values for notes in non-core files using name "GNU".  */