summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2023-03-16 00:17:50 +0000
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-03-16 08:38:39 +0100
commite0b8bbbdbece50e7c58b09c633e0ebe6e47c99e7 (patch)
treecaf1edf49eb21f06ac0852e6f01b58e73e031234 /docs
parent3b1b0f1aeb484a13ce6b730ad30f1e8b449e38ea (diff)
downloadsystemd-e0b8bbbdbece50e7c58b09c633e0ebe6e47c99e7.tar.gz
doc: update ELF_PACKAGE_METADATA to use linker flag instead of manual script
bfd/gold/mold/lld support this flag, so document it explicitly, and drop the manually written linker script which is no longer necessary
Diffstat (limited to 'docs')
-rw-r--r--docs/ELF_PACKAGE_METADATA.md54
1 files changed, 5 insertions, 49 deletions
diff --git a/docs/ELF_PACKAGE_METADATA.md b/docs/ELF_PACKAGE_METADATA.md
index fd2099f8e0..bbc77ec85d 100644
--- a/docs/ELF_PACKAGE_METADATA.md
+++ b/docs/ELF_PACKAGE_METADATA.md
@@ -82,55 +82,11 @@ these JSON objects are thus permitted to encode numeric values from these
ranges as JSON numbers, and should not use numeric values not covered by these
types and ranges.
-A reference implementations of a [build-time tool is provided](https://github.com/systemd/package-notes)
-and can be used to generate a linker script, which can then be used at build time via
-```LDFLAGS="-Wl,-T,/path/to/generated/script"``` to include the note in the binary.
-
-Generator:
-```console
-$ ./generate-package-notes.py --rpm systemd-248~rc2-1.fc33.arm32 --cpe cpe:/o:fedoraproject:fedora:33
-SECTIONS
-{
- .note.package (READONLY) : ALIGN(4) {
- LONG(0x0004) /* Length of Owner including NUL */
- LONG(0x007b) /* Length of Value including NUL */
- LONG(0xcafe1a7e) /* Note ID */
- BYTE(0x46) BYTE(0x44) BYTE(0x4f) BYTE(0x00) /* Owner: 'FDO\x00' */
- BYTE(0x7b) BYTE(0x22) BYTE(0x74) BYTE(0x79) /* Value: '{"type":"rpm","name":"systemd","version":"248~rc2-1.fc33","architecture":"arm32","osCpe":"cpe:/o:fedoraproject:fedora:33"}\x00\x00' */
- BYTE(0x70) BYTE(0x65) BYTE(0x22) BYTE(0x3a)
- BYTE(0x22) BYTE(0x72) BYTE(0x70) BYTE(0x6d)
- BYTE(0x22) BYTE(0x2c) BYTE(0x22) BYTE(0x6e)
- BYTE(0x61) BYTE(0x6d) BYTE(0x65) BYTE(0x22)
- BYTE(0x3a) BYTE(0x22) BYTE(0x73) BYTE(0x79)
- BYTE(0x73) BYTE(0x74) BYTE(0x65) BYTE(0x6d)
- BYTE(0x64) BYTE(0x22) BYTE(0x2c) BYTE(0x22)
- BYTE(0x76) BYTE(0x65) BYTE(0x72) BYTE(0x73)
- BYTE(0x69) BYTE(0x6f) BYTE(0x6e) BYTE(0x22)
- BYTE(0x3a) BYTE(0x22) BYTE(0x32) BYTE(0x34)
- BYTE(0x38) BYTE(0x7e) BYTE(0x72) BYTE(0x63)
- BYTE(0x32) BYTE(0x2d) BYTE(0x31) BYTE(0x2e)
- BYTE(0x66) BYTE(0x63) BYTE(0x33) BYTE(0x33)
- BYTE(0x22) BYTE(0x2c) BYTE(0x22) BYTE(0x61)
- BYTE(0x72) BYTE(0x63) BYTE(0x68) BYTE(0x69)
- BYTE(0x74) BYTE(0x65) BYTE(0x63) BYTE(0x74)
- BYTE(0x75) BYTE(0x72) BYTE(0x65) BYTE(0x22)
- BYTE(0x3a) BYTE(0x22) BYTE(0x61) BYTE(0x72)
- BYTE(0x6d) BYTE(0x33) BYTE(0x32) BYTE(0x22)
- BYTE(0x2c) BYTE(0x22) BYTE(0x6f) BYTE(0x73)
- BYTE(0x43) BYTE(0x70) BYTE(0x65) BYTE(0x22)
- BYTE(0x3a) BYTE(0x22) BYTE(0x63) BYTE(0x70)
- BYTE(0x65) BYTE(0x3a) BYTE(0x2f) BYTE(0x6f)
- BYTE(0x3a) BYTE(0x66) BYTE(0x65) BYTE(0x64)
- BYTE(0x6f) BYTE(0x72) BYTE(0x61) BYTE(0x70)
- BYTE(0x72) BYTE(0x6f) BYTE(0x6a) BYTE(0x65)
- BYTE(0x63) BYTE(0x74) BYTE(0x3a) BYTE(0x66)
- BYTE(0x65) BYTE(0x64) BYTE(0x6f) BYTE(0x72)
- BYTE(0x61) BYTE(0x3a) BYTE(0x33) BYTE(0x33)
- BYTE(0x22) BYTE(0x7d) BYTE(0x00) BYTE(0x00)
- }
-}
-INSERT AFTER .note.gnu.build-id;
-```
+Reference implementations of [packaging tools for .deb and .rpm](https://github.com/systemd/package-notes)
+are available, and provide macros/helpers to include the note in binaries built
+by the package build system. They make use of the new `--package-metadata` flag that
+is available in the bfd, gold, mold and lld linkers (versions 2.39, 1.3.0 and 15.0
+respectively). This linker flag takes a JSON payload as parameter.
## Well-known keys