Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add runtime-path to DynamicLinking.md #246

Merged
merged 3 commits into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions DynamicLinking.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ The current list of valid `type` codes are:

- `4 / WASM_DYLINK_IMPORT_INFO` - Specify additional metadata about imports.

- `5 / WASM_DYLINK_RUNTIME_PATH` - Specify the runtime path, corresponding to `DT_RUNPATH` in an ELF `.dynamic` section.

For `WASM_DYLINK_MEM_INFO` the following fields are present in the
subsection:

Expand Down Expand Up @@ -117,6 +119,14 @@ The "import_info" type is defined as:
The set of possible symbol flags are the same as those specified in
[Linking](Linking.md).

For `WASM_DYLINK_RUNTIME_PATH` the following fields are present in the
subsection:

| Field | Type | Description |
| ---------------------- | --------------- | ------------------------------------- |
| runtime_path_count | `varuint32` | Number of runtime_path entries |
| runtime_path_entries | `string*` | string values of runtime_path entries |

The "dylink" section should be the very first section in the module; this allows
detection of whether a binary is a dynamic library without having to scan the
entire contents.
Expand Down Expand Up @@ -309,6 +319,18 @@ present in `WASM_DYLINK_NEEDED`:
)
```

** `runtime-path` **
hoodmane marked this conversation as resolved.
Show resolved Hide resolved

The `runtime-path` contains a list of paths. The loader should look in these
hoodmane marked this conversation as resolved.
Show resolved Hide resolved
directories to locate `needed` dependencies that do not contain a slash in their
name.

Dynamic string tokens: The loader should expand certain string tokens appearing
in the `runtime-path`. The tokens are as follows:

* `$ORIGIN` and `${ORIGIN}` -- these expand to the directory containing the
shared object.
hoodmane marked this conversation as resolved.
Show resolved Hide resolved

**`export-info` / `import-info`**

The `export-info` and `import-info` constructs correspond to
Expand Down