Skip to content

Commit

Permalink
Document --package-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Jan 8, 2025
1 parent 5d45430 commit 55fcd3f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/mold.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,21 @@ but as `-o magic`.
* `--noinhibit-exec`:
Create an output file even if errors occur.

* `--package-metadata`==_percent-encoded-string_:
Embed a specified string into the `.note.package` section. This option
is designed for build scripts that generate binary packages, such as
`.rpm` or `.deb`, to include package metadata in each executable. It
simplifies the process of identifying the corresponding package for a
given executable or core file.

An argument to this option is treated as percent-encoded and decoded
before being inserted into the section, allowing you to avoid the use of
the comma (`,`) character in the argument. This is useful because the
compiler replaces all occurrences of commas in `-Wl,` with spaces before
forwarding them to the linker. Note that `mold` always interprets the
argument as percent-encoded, so you also need to escape all occurrences
of `%` as `%25`.

* `--pack-dyn-relocs`=[ `relr` | `none` ]:
If `relr` is specified, all `R_*_RELATIVE` relocations are put into
`.relr.dyn` section instead of `.rel.dyn` or `.rela.dyn` section. Since
Expand Down

0 comments on commit 55fcd3f

Please sign in to comment.