@@ -717,40 +717,25 @@ __primary_switch:
717717 * Iterate over each entry in the relocation table , and apply the
718718 * relocations in place.
719719 * /
720- ldr w8 , =__dynsym_offset // offset to symbol table
721720 ldr w9 , =__rela_offset // offset to reloc table
722721 ldr w10 , =__rela_size // size of reloc table
723722
724723 mov_q x11 , KIMAGE_VADDR // default virtual offset
725724 add x11 , x11 , x23 // actual virtual offset
726- add x8 , x8 , x11 // __va(.dynsym)
727725 add x9 , x9 , x11 // __va(.rela)
728726 add x10 , x9 , x10 // __va(.rela) + sizeof(.rela)
729727
7307280 : cmp x9 , x10
731- b.hs 2f
729+ b.hs 1f
732730 ldp x11 , x12 , [ x9 ], # 24
733731 ldr x13 , [ x9 , # - 8 ]
734732 cmp w12 , #R_AARCH64_RELATIVE
735- b.ne 1f
733+ b.ne 0b
736734 add x13 , x13 , x23 // relocate
737735 str x13 , [ x11 , x23 ]
738736 b 0b
739737
740- 1 : cmp w12 , #R_AARCH64_ABS64
741- b.ne 0b
742- add x12 , x12 , x12 , lsl # 1 // symtab offset: 24x top word
743- add x12 , x8 , x12 , lsr #( 32 - 3 ) // ... shifted into bottom word
744- ldrsh w14 , [ x12 , # 6 ] // Elf64_Sym::st_shndx
745- ldr x15 , [ x12 , # 8 ] // Elf64_Sym::st_value
746- cmp w14 , # - 0xf // SHN_ABS ( 0xfff1 ) ?
747- add x14 , x15 , x23 // relocate
748- csel x15 , x14 , x15 , ne
749- add x15 , x13 , x15
750- str x15 , [ x11 , x23 ]
751- b 0b
752-
753- 2 :
738+ 1 :
754739#endif
755740 ldr x8 , =__primary_switched
756741 br x8
0 commit comments