]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf: add pretty printing for FDO Dlopen Metadata note
authorLuca Boccassi <bluca@debian.org>
Fri, 10 May 2024 21:58:02 +0000 (22:58 +0100)
committerMark Wielaard <mark@klomp.org>
Fri, 31 May 2024 12:30:21 +0000 (14:30 +0200)
The node ID and the string format are now fixed, even if the content
of the string might change, it will still be a string.

     * libebl/eblobjnote.c (ebl_object_note): Handle both type
     being NT_FDO_PACKAGING_METADATA or NT_FDO_DLOPEN_METADATA when
     name is "FDO".
     * libebl/eblobjnotetypename.c (ebl_object_note_type_name): Handle
     "FDO" name and type NT_FDO_DLOPEN_METADATA.

Signed-off-by: Luca Boccassi <bluca@debian.org>
libebl/eblobjnote.c
libebl/eblobjnotetypename.c

index 1ba5d8b32354e7e550aded29753547b8e0f83d9e..ad3f49de34569982e5c5a6e1acfd1bfd9d6bdc2e 100644 (file)
@@ -288,9 +288,14 @@ ebl_object_note (Ebl *ebl, uint32_t namesz, const char *name, uint32_t type,
       if (descsz == 0 && type == NT_VERSION)
        return;
 
-      if (strcmp ("FDO", name) == 0 && type == NT_FDO_PACKAGING_METADATA
+      if (strcmp ("FDO", name) == 0
          && descsz > 0 && desc[descsz - 1] == '\0')
-       printf("    Packaging Metadata: %.*s\n", (int) descsz, desc);
+       {
+         if (type == NT_FDO_PACKAGING_METADATA)
+           printf("    Packaging Metadata: %.*s\n", (int) descsz, desc);
+         else if (type == NT_FDO_DLOPEN_METADATA)
+           printf("    Dlopen  Metadata: %.*s\n", (int) descsz, desc);
+       }
 
       /* Everything else should have the "GNU" owner name.  */
       if (strcmp ("GNU", name) != 0)
index 473a1f2f2fd4cb0c717f3e4c3588606422271575..79ff010a37d8c73e041dbd6baf840fd923bbd39b 100644 (file)
@@ -104,6 +104,9 @@ ebl_object_note_type_name (Ebl *ebl, const char *name, uint32_t type,
       if (strcmp (name, "FDO") == 0 && type == NT_FDO_PACKAGING_METADATA)
        return "FDO_PACKAGING_METADATA";
 
+      if (strcmp (name, "FDO") == 0 && type == NT_FDO_DLOPEN_METADATA)
+       return "FDO_DLOPEN_METADATA";
+
       if (strcmp (name, "GNU") != 0)
        {
          /* NT_VERSION is special, all data is in the name.  */