Skip to content

Commit 55fcd3f

Browse files
committedJan 8, 2025·
Document --package-metadata
1 parent 5d45430 commit 55fcd3f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎docs/mold.md

+15
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,21 @@ but as `-o magic`.
617617
* `--noinhibit-exec`:
618618
Create an output file even if errors occur.
619619

620+
* `--package-metadata`==_percent-encoded-string_:
621+
Embed a specified string into the `.note.package` section. This option
622+
is designed for build scripts that generate binary packages, such as
623+
`.rpm` or `.deb`, to include package metadata in each executable. It
624+
simplifies the process of identifying the corresponding package for a
625+
given executable or core file.
626+
627+
An argument to this option is treated as percent-encoded and decoded
628+
before being inserted into the section, allowing you to avoid the use of
629+
the comma (`,`) character in the argument. This is useful because the
630+
compiler replaces all occurrences of commas in `-Wl,` with spaces before
631+
forwarding them to the linker. Note that `mold` always interprets the
632+
argument as percent-encoded, so you also need to escape all occurrences
633+
of `%` as `%25`.
634+
620635
* `--pack-dyn-relocs`=[ `relr` | `none` ]:
621636
If `relr` is specified, all `R_*_RELATIVE` relocations are put into
622637
`.relr.dyn` section instead of `.rel.dyn` or `.rela.dyn` section. Since

0 commit comments

Comments
 (0)
Please sign in to comment.