Skip to content

Commit 4ab3f9d

Browse files
ptosioupton
authored andcommitted
KVM: arm64: nVHE: gen-hyprel: Skip R_AARCH64_ABS32
Ignore R_AARCH64_ABS32 relocations, instead of panicking, when emitting the relocation table of the hypervisor. The toolchain might produce them when generating function calls with kCFI to represent the 32-bit type ID which can then be resolved across compilation units at link time. These are NOT actual 32-bit addresses and are therefore not needed in the final (runtime) relocation table (which is unlikely to use 32-bit absolute addresses for arm64 anyway). Signed-off-by: Pierre-Clément Tosi <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 6e3b773 commit 4ab3f9d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/arm64/kvm/hyp/nvhe/gen-hyprel.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
#ifndef R_AARCH64_ABS64
5151
#define R_AARCH64_ABS64 257
5252
#endif
53+
#ifndef R_AARCH64_ABS32
54+
#define R_AARCH64_ABS32 258
55+
#endif
5356
#ifndef R_AARCH64_PREL64
5457
#define R_AARCH64_PREL64 260
5558
#endif
@@ -383,6 +386,9 @@ static void emit_rela_section(Elf64_Shdr *sh_rela)
383386
case R_AARCH64_ABS64:
384387
emit_rela_abs64(rela, sh_orig_name);
385388
break;
389+
/* Allow 32-bit absolute relocation, for kCFI type hashes. */
390+
case R_AARCH64_ABS32:
391+
break;
386392
/* Allow position-relative data relocations. */
387393
case R_AARCH64_PREL64:
388394
case R_AARCH64_PREL32:

0 commit comments

Comments
 (0)