From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:ELF (Executable and Linkable Format)" |
|---|
| claim | "DT_RELR (36) / SHT_RELR (19) holds pointer-sized words: an even word is the address of one word to relocate (add the load bias) and sets base = address + wordsize; an odd word is a bitmap whose bit k (k >= 1) relocates the word at base + (k-1)*wordsize, after which base advances by (8*wordsize-1)*wordsize (63 words on 64-bit). Old Android numbers: SHT_ANDROID_RELR 0x6fffff00, DT_ANDROID_RELR 0x6fffe000, RELRSZ 0x6fffe001, RELRENT 0x6fffe003." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:ELF (Executable and Linkable Format)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "loading an ELF with DT_RELR" |
|---|
| effect | "every addressed word has the load bias added in place; no symbols involved" |
|---|
| condition | "entries are 8 bytes on ELF64 and 4 on ELF32" |
|---|
| function | "relocate_relr" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "relocate_relr and the DT_RELR/DT_ANDROID_RELR dynamic tags" |
|---|
| repo | "https://android.googlesource.com/platform/bionic" |
|---|
| commit | "731631f300090436d7f5df80d50b6275c8c60a93" |
|---|
| path | "linker/linker.cpp" |
|---|
| lines | "2797-2850, 3092-3115" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "RELR decoding" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T09:13:25.182Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T07:18:42.211Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read relocate_relr (even entry applies and sets base=offset+wordsize; odd entry bitmap from bit 1; base += (8*wordsize-1)*wordsize) and the DT_RELR/DT_ANDROID_RELR, RELRSZ, RELRENT cases in bionic linker.cpp at 731631f. The numeric values of the old Android constants and SHT_RELR=19 are not in that file and were not checked." |
|---|
| notes | "Partial scope: algorithm confirmed; constants not re-read." |
|---|
|
|
|---|