Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Add relaxation relocations #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/LoongArch-ELF-ABI-CN.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,46 @@ v2.01
|R_LARCH_RELAX
|在相同的地址和其它重定位成对使用,标识指令可能被修改或删除(relaxed)。
|

|101
|R_LARCH_DELETE
|指令在链接时被删除。
|

|102
|R_LARCH_ALIGN
|对齐声明,重定位加数表示 NOP 指令在重定位位置所占用的字节数,对齐边界向上舍入到大于重定位加数的最小的 2 的 n 次幂。
|

|103
|R_LARCH_PCREL20_S2
|22 位相对 PC 偏移
|`+(*(uint32_t *) PC) [24 ... 5] = (S + A - PC) [21 ... 2]+`

|104
|R_LARCH_CFA
|Canonical Frame Address
|

|105
|R_LARCH_ADD6
|6 位原地加法
|

|106
|R_LARCH_SUB6
|6 位原地减法
|

|107
|R_LARCH_ADD_ULEB128
|ULEB128 原地加法
|

|108
|R_LARCH_SUB_ULEB128
|ULEB128 原地减法
|
|===


Expand Down
40 changes: 40 additions & 0 deletions docs/LoongArch-ELF-ABI-EN.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,46 @@ with check 28-bit signed overflow and 4-bit aligned
|R_LARCH_RELAX
|Instruction can be relaxed, paired with a normal relocation at the same address
|

|101
|R_LARCH_DELETE
|The instruction should be deleted at link time.
|

|102
|R_LARCH_ALIGN
|Alignment statement. The addend indicates the number of bytes occupied by nop instructions at the relocation offset. The alignment boundary is specified by the addend rounded up to the next power of two.
|

|103
|R_LARCH_PCREL20_S2
|22 bits PC-relative offset
|`+(*(uint32_t *) PC) [24 ... 5] = (S + A - PC) [21 ... 2]+`

|104
|R_LARCH_CFA
|Canonical Frame Address
|

|105
|R_LARCH_ADD6
|6-bit in-place addition
|

|106
|R_LARCH_SUB6
|6-bit in-place subtraction
|

|107
|R_LARCH_ADD_ULEB128
|ULEB128 in-place addition
|

|108
|R_LARCH_SUB_ULEB128
|ULEB128 in-place subtraction
|
|===


Expand Down