aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2021-12-01 14:44:25 +0000
committerNick Clifton <nickc@redhat.com>2021-12-01 14:44:25 +0000
commite5382207cdddea07c6456fc1c0e6bea73b3d9947 (patch)
tree56b48316541967e826a674e5ead3b65a567b1e30 /binutils
parente1ccbd6d3ad36569715fd12889f5ab2cca3f842c (diff)
downloadgdb-e5382207cdddea07c6456fc1c0e6bea73b3d9947.zip
gdb-e5382207cdddea07c6456fc1c0e6bea73b3d9947.tar.gz
gdb-e5382207cdddea07c6456fc1c0e6bea73b3d9947.tar.bz2
readelf: recognize FDO Packaging Metadata ELF note
As defined on: https://systemd.io/COREDUMP_PACKAGE_METADATA/ this note will be used starting from Fedora 36. Allow readelf --notes to pretty print it: Displaying notes found in: .note.package Owner Data size Description FDO 0x00000039 FDO_PACKAGING_METADATA Packaging Metadata: {"type":"deb","name":"fsverity-utils","version":"1.3-1"} Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
Diffstat (limited to 'binutils')
-rw-r--r--binutils/readelf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 2e7d285..92aa788 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -19220,6 +19220,8 @@ get_note_type (Filedata * filedata, unsigned e_type)
return _("NT_SIGINFO (siginfo_t data)");
case NT_FILE:
return _("NT_FILE (mapped files)");
+ case FDO_PACKAGING_METADATA:
+ return _("FDO_PACKAGING_METADATA");
default:
break;
}
@@ -20446,6 +20448,17 @@ print_stapsdt_note (Elf_Internal_Note *pnote)
return false;
}
+static bool
+print_fdo_note (Elf_Internal_Note * pnote)
+{
+ if (pnote->descsz > 0 && pnote->type == FDO_PACKAGING_METADATA)
+ {
+ printf (_(" Packaging Metadata: %.*s\n"), (int) pnote->descsz, pnote->descdata);
+ return true;
+ }
+ return false;
+}
+
static const char *
get_ia64_vms_note_type (unsigned e_type)
{
@@ -21179,6 +21192,8 @@ process_note (Elf_Internal_Note * pnote,
return print_stapsdt_note (pnote);
else if (startswith (pnote->namedata, "CORE"))
return print_core_note (pnote);
+ else if (startswith (pnote->namedata, "FDO"))
+ return print_fdo_note (pnote);
else if (((startswith (pnote->namedata, "GA")
&& strchr ("*$!+", pnote->namedata[2]) != NULL)
|| strchr ("*$!+", pnote->namedata[0]) != NULL)