Fix documentation

This commit is contained in:
alejo committed 2026-09-25 03:20:35 -03:00
1 parent a317c07124
commit ab21b3f30d
27 files changed
+2137 -1043

No files matched your search

+26 -14
View File
@@ -3,12 +3,18 @@
Patches a running process's own code in place so that a new build of a
function takes effect immediately -- no restart, and every existing
caller (including a raw C function pointer someone cached ten minutes
ago) picks up the change automatically. `hot_reload.h` is the API;
`source/examples/HotReloadDemo` is a full worked example; this file is
the overview `hot_reload.h`'s own doc comments don't have room for,
especially the parts you should know are *not* guaranteed.
ago) picks up the change automatically. This is the full technical
reference; see this project's top-level `README.md` for a quicker
overview, feature summary, and build/run instructions if you haven't
already.
If you just want to see it run:
`hot_reload.h` is the API (also fully Doxygen-documented -- see the
top-level README's "Documentation" section for how to build that
locally); `source/examples/HotReloadDemo` is a full worked example;
this file is the overview `hot_reload.h`'s own doc comments don't have
room for, especially the parts you should know are *not* guaranteed.
To see it run:
```sh
cmake -S . -B out -DBUILD_EXAMPLES=ON
@@ -367,15 +373,21 @@ that file's comment for the full reasoning.
## Known, accepted gaps
- **A `.so` with its section header table deliberately stripped**
reads back as exporting no functions at all (empty, not a crash) --
`SymbolTable.cpp`'s ELF reader uses section headers to find
`.dynsym`/`.dynstr`, which is simpler and easier to get right than
walking `.dynamic`'s `DT_*` tags the way the dynamic linker itself
does, at the cost of this one edge case. Stripping section headers
from a `.so` you are actively hot-reloading is an unusual, separate
step from an ordinary `strip` and essentially never happens by
accident.
- **A `.so` with its section header table deliberately stripped,
truncated, or otherwise corrupted** reads back as exporting no
functions at all (empty, not a crash) -- `SymbolTable.cpp`'s ELF
reader uses section headers to find `.dynsym`/`.dynstr`, which is
simpler and easier to get right than walking `.dynamic`'s `DT_*` tags
the way the dynamic linker itself does, at the cost of this one edge
case for a deliberately-stripped file. Every offset, size, and index
this reader trusts is bounds-checked against the file's actual size
before use -- confirmed directly by fuzzing the section header table
of a real plugin build: 1500 randomly corrupted variants (each still
a file the OS loader itself accepts via `dlopen()`), zero crashes. An
earlier version of this same reader, without those checks, crashed on
69 of an initial 300. Stripping section headers from a `.so` you are
actively hot-reloading is, separately, an unusual step essentially
never taken by accident.
- **PE exports have no per-symbol size.** Unlike ELF's `st_size`,
which backs a real safety check, the Windows path estimates size
from the gap to the next exported function and can only ever prove