diff options
author | Luca Boccassi <bluca@debian.org> | 2022-08-04 17:19:52 -0700 |
---|---|---|
committer | Cary Coutant <ccoutant@gmail.com> | 2022-08-04 17:37:32 -0700 |
commit | 701821154b110230f52a0367e120ecc51f490e56 (patch) | |
tree | ffbb47ef447a2cbddafa2b2bd0bc5c220771b924 /gold/Makefile.am | |
parent | 1369522f36eece1b37139a81f7f2139ba3915172 (diff) | |
download | gdb-701821154b110230f52a0367e120ecc51f490e56.zip gdb-701821154b110230f52a0367e120ecc51f490e56.tar.gz gdb-701821154b110230f52a0367e120ecc51f490e56.tar.bz2 |
Add gold support for --package-metadata option.
Following the same format as the implementation in ld:
9e2bb0cb5e74aed4158f08495534922d7108f928
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.
Diffstat (limited to 'gold/Makefile.am')
-rw-r--r-- | gold/Makefile.am | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gold/Makefile.am b/gold/Makefile.am index 2e40671..934e366 100644 --- a/gold/Makefile.am +++ b/gold/Makefile.am @@ -35,7 +35,7 @@ THREADFLAGS = @PTHREAD_CFLAGS@ THREADLIBS = @PTHREAD_LIBS@ AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC) $(THREADFLAGS) -AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC) $(THREADFLAGS) +AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC) $(THREADFLAGS) $(JANSSON_CFLAGS) AM_LDFLAGS = $(THREADFLAGS) AM_CPPFLAGS = \ @@ -187,7 +187,7 @@ libgold_a_LIBADD = $(LIBOBJS) sources_var = main.cc deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP) ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) \ - $(THREADLIBS) $(LIBDL) $(ZLIB) + $(THREADLIBS) $(LIBDL) $(ZLIB) $(JANSSON_LIBS) ldflags_var = $(GOLD_LDFLAGS) ld_new_SOURCES = $(sources_var) @@ -201,12 +201,12 @@ incremental_dump_SOURCES = incremental-dump.cc incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \ $(LIBINTL_DEP) incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \ - $(THREADLIBS) $(LIBDL) $(ZLIB) + $(THREADLIBS) $(LIBDL) $(ZLIB) $(JANSSON_LIBS) dwp_SOURCES = dwp.cc dwp_DEPENDENCIES = libgold.a $(LIBIBERTY) $(LIBINTL_DEP) dwp_LDADD = libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) $(THREADLIBS) \ - $(LIBDL) $(ZLIB) + $(LIBDL) $(ZLIB) $(JANSSON_LIBS) dwp_LDFLAGS = $(GOLD_LDFLAGS) CONFIG_STATUS_DEPENDENCIES = $(srcdir)/../bfd/development.sh |