@@ -204,33 +204,20 @@ def emit_aarch64_trampoline(self, hole: Hole, alignment: int) -> None:
204
204
return
205
205
206
206
self .disassembly += [
207
- f"{ base + 4 * 0 :x} : d2800008 mov x8, #0x0" ,
208
- f"{ base + 4 * 0 :016x} : R_AARCH64_MOVW_UABS_G0_NC { hole .symbol } " ,
209
- f"{ base + 4 * 1 :x} : f2a00008 movk x8, #0x0, lsl #16" ,
210
- f"{ base + 4 * 1 :016x} : R_AARCH64_MOVW_UABS_G1_NC { hole .symbol } " ,
211
- f"{ base + 4 * 2 :x} : f2c00008 movk x8, #0x0, lsl #32" ,
212
- f"{ base + 4 * 2 :016x} : R_AARCH64_MOVW_UABS_G2_NC { hole .symbol } " ,
213
- f"{ base + 4 * 3 :x} : f2e00008 movk x8, #0x0, lsl #48" ,
214
- f"{ base + 4 * 3 :016x} : R_AARCH64_MOVW_UABS_G3 { hole .symbol } " ,
215
- f"{ base + 4 * 4 :x} : d61f0100 br x8" ,
207
+ f"{ base + 4 * 0 :x} : 58000048 ldr x8, 8" ,
208
+ f"{ base + 4 * 1 :x} : d61f0100 br x8" ,
209
+ f"{ base + 4 * 2 :x} : 00000000" ,
210
+ f"{ base + 4 * 2 :016x} : R_AARCH64_ABS64 { hole .symbol } " ,
211
+ f"{ base + 4 * 3 :x} : 00000000" ,
216
212
]
217
213
for code in [
218
- 0xD2800008 .to_bytes (4 , sys .byteorder ),
219
- 0xF2A00008 .to_bytes (4 , sys .byteorder ),
220
- 0xF2C00008 .to_bytes (4 , sys .byteorder ),
221
- 0xF2E00008 .to_bytes (4 , sys .byteorder ),
214
+ 0x58000048 .to_bytes (4 , sys .byteorder ),
222
215
0xD61F0100 .to_bytes (4 , sys .byteorder ),
216
+ 0x00000000 .to_bytes (4 , sys .byteorder ),
217
+ 0x00000000 .to_bytes (4 , sys .byteorder ),
223
218
]:
224
219
self .body .extend (code )
225
- for i , kind in enumerate (
226
- [
227
- "R_AARCH64_MOVW_UABS_G0_NC" ,
228
- "R_AARCH64_MOVW_UABS_G1_NC" ,
229
- "R_AARCH64_MOVW_UABS_G2_NC" ,
230
- "R_AARCH64_MOVW_UABS_G3" ,
231
- ]
232
- ):
233
- self .holes .append (hole .replace (offset = base + 4 * i , kind = kind ))
220
+ self .holes .append (hole .replace (offset = base + 8 , kind = "R_AARCH64_ABS64" ))
234
221
self .trampolines [hole .symbol ] = base
235
222
236
223
def remove_jump (self , * , alignment : int = 1 ) -> None :
0 commit comments