Skip to main content

10 Assembler Relocation Functions

The following table lists assembler relocation expansions:

Table 3. Assembler Relocation Functions

| Assembler Notation | Description | Instruction/Macro | | %hi(symbol) | Absolute (HI20) | lui | | %lo(symbol) | Absolute (LO12) | load, store, add | | %pcrel_hi(symbol) | PC-relative (HI20) | auipc | | %pcrel_lo(label) | PC-relative (LO12) | load, store, add | | %tprel_hi(symbol) | TLS LE "Local Exec" | lui | | %tprel_lo(symbol) | TLS LE "Local Exec" | load, store, add | | %tprel_add(symbol) | TLS LE "Local Exec" | add | | %tls_ie_pcrel_hi(symbol) * | TLS IE "Initial Exec" (HI20) | auipc | | %tls_gd_pcrel_hi(symbol) * | TLS GD "Global Dynamic" (HI20) | auipc | | %got_pcrel_hi(symbol) * | GOT PC-relative (HI20) | auipc |

  • These reuse %pcrel_lo(label) for their lower half