lla

RISC-V lla Pseudo-Instruction Details

Assembler pseudo-instruction

Load-local-address pseudo-instruction that expands, per the official assembly manual, to a PC-relative AUIPC+ADDI sequence. It fits local symbols or non-PIC address paths that do not need GOT indirection.

What You Write
lla rd, symbol
Typical Real Expansion
.Llla: auipc rd, %pcrel_hi(symbol) addi rd, rd, %pcrel_lo(.Llla)

What This Pseudo Instruction Is Saving You From Writing

Makes the local-address, no-GOT intent explicit; it is the concrete form behind la for nopic/local paths.

lla primarily means "Load a local symbol address". It is assembler-level shorthand; when debugging, auditing, or reading machine code, reason from the real expansion and relocation semantics listed on this page.

Official Semantics Checklist

The official assembly manual treats lla as an assembler-level pseudo-instruction or alias; hardware executes the expanded real instruction sequence.
The real semantics come from the ISA definitions of AUIPC and the other expanded instructions, not from a separate lla hardware opcode.
Address-loading relocations such as %pcrel_hi/%pcrel_lo or %got_pcrel_hi must be read with the pairing rules in the assembly manual and psABI.

Toolchain And Linker Boundaries

lla expresses local-address loading and normally uses PC-relative relocations; the final AUIPC/ADDI sequence may be linker-relaxed.
The low 12-bit relocation must pair with the matching AUIPC label; do not mix labels in hand-written expansions.

How To Read The Expansion

Step 1
AUIPC uses the PC at .Llla as the base to form the high PC-relative part of the local symbol address.
Step 2
ADDI uses the low 12-bit relocation matched to .Llla to complete the local symbol address.

What You May See In objdump / Disassembly

AUIPC+ADDI may be shown as lla or la; linker relaxation may also shorten the sequence.

Official References And Reading Order

This page treats pseudo-instructions as assembler-level aliases or macros: first read what real instructions they expand to, then use the official ISA manual for the behavior of those real instructions. ABI, relocation, and linker-relaxation details follow the psABI document.

When To Think Of It First

Load a label address in the same link unit
Get the address of a local static object, string, or jump table
Write non-PIC assembly and avoid GOT indirection
Explain the real path of la in nopic mode

Pitfalls / Common Confusions

lla is not the right PIC access for preemptible global symbols; those usually need the lga/GOT path
The ADDI low relocation must match the preceding AUIPC label
It is still a pseudo-instruction; final machine code follows AUIPC/ADDI or linker relaxation

FAQ

Is lla a real RISC-V instruction?

lla is an assembler pseudo-instruction or alias, not a separate hardware opcode. The “Typical Real Expansion” section lists the official expansion, and behavior is defined by the expanded ISA instructions.

What is the main trap when using lla?

lla is not the right PIC access for preemptible global symbols; those usually need the lga/GOT path