mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
Add gold support for --package-metadata option.
Following the same format as the implementation in ld:
9e2bb0cb5e
Generate a .note.package FDO package metadata ELF note, following
the spec: https://systemd.io/ELF_PACKAGE_METADATA/
If the jansson library is available at build time (and it is explicitly
enabled), link ld to it, and use it to validate that the input is
correct JSON, to avoid writing garbage to the file. The
configure option --enable-jansson has to be used to explicitly enable
it (error out when not found). This allows bootstrappers (or others who
are not interested) to seamlessly skip it without issues.
elfcpp/
* elfcpp.h: Add FDO_PACKAGING_METADATA note type.
gold/
* Makefile.am: Add jansson flags and libraries.
* configure.ac: Check for jansson library.
* layout.cc (Layout::create_notes): Call create_package_metadata().
(Layout::create_package_metadata): New function.
* layout.h (Layout::create_package_metadata): New function.
(Layout::package_metadata_note_): New data member.
* options.h (class General_options): Add --package-metadata option.
* testsuite/Makefile.am (object_unittest): Add jansson libraries.
(binary_unittest): Likewise.
(leb128_unittest): Likewise.
(overflow_unittest): Likewise.
(package_metadata_test): New test.
* testsuite/package_metadata_main.c: New test source.
This commit is contained in:
committed by
Cary Coutant
parent
1369522f36
commit
701821154b
@@ -999,7 +999,9 @@ enum
|
||||
// string.
|
||||
NT_GNU_GOLD_VERSION = 4,
|
||||
// Program property note, as described in "Linux Extensions to the gABI".
|
||||
NT_GNU_PROPERTY_TYPE_0 = 5
|
||||
NT_GNU_PROPERTY_TYPE_0 = 5,
|
||||
// FDO .note.package notes as defined on https://systemd.io/ELF_PACKAGE_METADATA/
|
||||
FDO_PACKAGING_METADATA = 0xcafe1a7e
|
||||
};
|
||||
|
||||
// The OS values which may appear in word 0 of a NT_GNU_ABI_TAG note.
|
||||
|
||||
Reference in New Issue
Block a user