The relocation is missing mask so an address that has non-zero bits in 47:43 may overwrite the register number. (Frequently shows up as target register changed to xzr....)
Details
Diff Detail
Event Timeline
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | ||
---|---|---|
364 | Now that the diff is much bigger I should point out that this line is the actual bug fix (adding mask). Other changes are necessary so that the added test can be run without causing trouble on big endian systems. |
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | ||
---|---|---|
441–443 | (10 - 2) -> 8 | |
455–457 | any reason why (10 - 3) is not spelled 7 (here and everywhere else) | |
test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s | ||
2–3 | We need tests for both little and big endian, no? | |
10–16 | Can you add comments pointing out the relocations emitted? |
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | ||
---|---|---|
455–457 | I believe it's because these are the last bits of the source (3) and the destination (10). I'm fine with either but I think the 10 - 3 is reasonably clear what it is doing along with the comment above each of these. | |
test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s | ||
2–3 | Sure. I don't have hardware to actually check if it's actually the correct output but I'll just reference clang/gcc output in be mode. | |
10–16 | Sorry, what exactly do you mean? The relocations are explicitly specified in the code (#:abs_g3: etc.). Do you mean to write the name like R_AARCH64_MOVW_UABS_G3? Or something else? |
test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s | ||
---|---|---|
10–16 | Or do you mean the disassemble of the relocated instructions? |
(and add the required tests please)
Sure.
test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s | ||
---|---|---|
10–16 | OK. Will do. |
Tests added. Also discovered and had to fix two other bugs since the arch detection was wrong for aarch64_be ELF file....
Now that the diff is much bigger I should point out that this line is the actual bug fix (adding mask). Other changes are necessary so that the added test can be run without causing trouble on big endian systems.