1;%HEADER%
2;/** @file
3;  Macros to work around lack of Apple support for LDR register, =expr
4;
5;  Copyright (c) 2009, Apple Inc. All rights reserved.<BR>
6;  Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>
7;
8;  SPDX-License-Identifier: BSD-2-Clause-Patent
9;
10;**/
11
12
13  MACRO
14  adrll   $Reg, $Symbol
15  add     $Reg, pc, #-8
16  RELOC   R_ARM_ALU_PC_G0_NC, $Symbol
17  add     $Reg, $Reg, #-4
18  RELOC   R_ARM_ALU_PC_G1_NC, $Symbol
19  add     $Reg, $Reg, #0
20  RELOC   R_ARM_ALU_PC_G2, $Symbol
21  MEND
22
23  MACRO
24  ldrl    $Reg, $Symbol
25  add     $Reg, pc, #-8
26  RELOC   R_ARM_ALU_PC_G0_NC, $Symbol
27  add     $Reg, $Reg, #-4
28  RELOC   R_ARM_ALU_PC_G1_NC, $Symbol
29  ldr     $Reg, [$Reg, #0]
30  RELOC   R_ARM_LDR_PC_G2, $Symbol
31  MEND
32
33  END
34