From 9874a9daa7e8fdfcde7b00212dd2ef7d3abfa828 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 18 Jul 2024 11:54:54 +0900 Subject: [PATCH] Document --encoded-package-metadata https://github.com/rui314/mold/pull/1308 --- docs/mold.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/mold.md b/docs/mold.md index 0becc85a8e..d8a9573f3e 100644 --- a/docs/mold.md +++ b/docs/mold.md @@ -580,11 +580,19 @@ but as `-o magic`. shared libraries linked with `--pack-dyn-relocs=relr`. As of 2022, only ChromeOS, Android and Fuchsia support it. -* `--package-metadata`=_string_: +* `--package-metadata`=_string_, `--encoded-package-metadata`=_string_: Embed _string_ to a `.note.package` section. This option is intended to be used by a package management command such as rpm(8) to embed metadata regarding a package to each executable file. + The difference between `--package-metadata` and `--encoded-package-metadata` + is that the former takes a plain string while the latter takes a + percent-encoded string. In other words, `--package-metadata={"foo":"bar"}` + is equivalent to `--encoded-package-metadata=%7B%22foo%22%3A%22bar%22%7D`. + The latter option is useful to use with the compiler's `-Wl,` option because + you can escape commas in a JSON string, which would otherwise be interpreted + as an argument separator by the compiler. + * `--pie`, `--pic-executable`, `--no-pie`, `--no-pic-executable`: Create a position-independent executable.