binutils-gdb/elfcpp
Luca Boccassi 701821154b 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.
2022-08-04 17:37:32 -07:00
..
aarch64.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
arm.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ChangeLog Add markers for 2.39 branch 2022-07-08 10:41:07 +01:00
ChangeLog-0815
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020 ChangeLog rotation 2021-01-01 10:31:02 +10:30
dwarf.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
elfcpp_file.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
elfcpp_internal.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
elfcpp_swap.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
elfcpp.h Add gold support for --package-metadata option. 2022-08-04 17:37:32 -07:00
i386.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
mips.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
powerpc.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
README Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
s390.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
sparc.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
tilegx.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
x86_64.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

elfcpp is a C++ library for reading and writing ELF information.  This
was written to support gold, the ELF linker, and may not be generally
useful.

elfcpp does not do file I/O.  It deals only with offsets and memory
data.

For efficiency, most accessors are templates with two arguments: the
ELF file class (32 or 64 bits) and the endianness.


Copyright (C) 2012-2022 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.