[v2,2/2] elf: add note identifier for dlopen metadata

Message ID 20240515001035.2189418-2-luca.boccassi@gmail.com
State Committed
Commit 53f9d74322c831c76bc6cf6ed8941267e8749604
Series [v2,1/2] elf: update NT_FDO_PACKAGING_METADATA spec URL |


Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Testing passed

Commit Message

Luca Boccassi May 15, 2024, 12:10 a.m. UTC
  From: Luca Boccassi <bluca@debian.org>

This new note type is defined at https://systemd.io/ELF_DLOPEN_METADATA/
and is used to list shared library dependencies loaded via dlopen().
Distro packagers can use this, via tools like those available at
https://github.com/systemd/package-notes to automatically generate
dependencies when building projects that make use of this

By defining the note id here we can use it in other projects as a
stable identifier, for example in 'readelf' to pretty-print its

Signed-off-by: Luca Boccassi <bluca@debian.org>
 elf/elf.h | 4 ++++
 1 file changed, 4 insertions(+)


diff --git a/elf/elf.h b/elf/elf.h
index 1df9b59935..f1b935382f 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -1340,6 +1340,10 @@  typedef struct
    https://systemd.io/ELF_PACKAGE_METADATA/ */
 #define NT_FDO_PACKAGING_METADATA 0xcafe1a7e
+/* dlopen metadata as defined on
+   https://systemd.io/ELF_DLOPEN_METADATA/ */
+#define NT_FDO_DLOPEN_METADATA 0x407c0c0a
 /* Note section name of program property.   */
 #define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property"