Repository navigation
Commit 48a7ab5
committed
a static image cannot answer dladdr, and that is not a failure
expat's member asserts that the code which parsed is not the ecosystem
payload's libexpat, and asks `dladdr` to attribute it. musl's `dladdr` is
`weak_alias(stub_dladdr, dladdr)` returning 0 (src/ldso/dladdr.c); the dynamic
loader overrides it, and a static link has no loader to do so. An openkal
program is statically linked, so the call returns 0 for every address and the
member failed one check on both targets.
The risk the check exists for cannot arise there either: nothing was loaded at
runtime, so the only expat in the process is the one that was linked in.
Skipping it would make "no loader" and "the loader answered wrongly" the same
reading, so the fallback asserts what distinguishes them. `main` is in this
executable by construction; if `dladdr` cannot locate that either, there is no
dynamic symbol information at all. If it locates `main` and not
`XML_ParserCreate`, the check fails as it did before.
Measured both ways: `runs` on both openkal targets, and on a dynamic host
build the positive branch still runs and still prints what it resolved.1 parent e82b320 commit 48a7ab5
1 file changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
105 | 120 | | |
106 | 121 | | |
107 | 122 | | |
108 | 123 | | |
109 | 124 | | |
110 | | - | |
111 | 125 | | |
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
115 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
116 | 138 | | |
117 | 139 | | |
118 | 140 | | |
| |||
0 commit comments