mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 13:12:26 +00:00
Since #10483, an unapplied loader relocation in a non-writable block made that whole block volatile. TLS slots are such relocations and sit in .got beside the entries Ghidra did apply, so in any shared object or PIE with initial-exec or dynamic TLS every GOT-indirect call decompiled as pointer arithmetic instead of a named call. Mark each unapplied destination volatile through its data item's Mutability setting, creating an undefined item of the relocation's length where nothing is defined. Fall back to the whole block only when an instruction or a data item starting before the destination occupies it. Eligibility, limitations, the read-only path, permissions and source FileBytes are unchanged. The loader-relocation fixture now reads an initial-exec TLS variable whose R_X86_64_TPOFF64 slot shares .got with the applied entries. The probe requires that block and its applied entries to stay non-volatile and both unapplied destinations to have volatile data items; on the previous bridge it fails at applied_got_relocations_not_volatile. Rename loader_relocation_semantics to volatile-unapplied-relocation-destinations to state the new behavior. Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>