Skip to content

Commit

Permalink
Release v2.20
Browse files Browse the repository at this point in the history
  • Loading branch information
scylaac authored and ChenghuaXu committed Nov 4, 2023
1 parent 76499f9 commit b53df30
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 101 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SRC = lapcs.adoc laelf.adoc ladwarf.adoc
SRC = la-abi.adoc lapcs.adoc laelf.adoc ladwarf.adoc
PDF = la-abi.pdf

PDF_THEME = themes/la-abi-pdf.yml
Expand All @@ -13,7 +13,7 @@ $(PDF): $(PDF:.pdf=.adoc) $(SRC) $(PDF_THEME)
-a pdf-style="$(PDF_THEME)" \
-a pdf-fontsdir=fonts \
-v \
$< -o $@
la-abi.adoc -o $@

html: $(patsubst %.adoc, %.html, $(SRC))

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ release for project management purposes.
* Clarify parameter passing rules for small `struct`s that contain both floating-point and integer members.
* Clarify parameter passing rules for `struct`s that contain zero-length arrays or bitfields.

- **v2.20**

* Revise the parameter passing rules of structures.
* Add R_LARCH_CALL36 relocation type.
* Remove R_LARCH_DELETE and mark its relocation number as reserved.
* Remove R_LARCH_CFA and mark its relocation number as reserved.
* Fix ULEB128 relocation name (R_LARCH_SUB_ULEB128).


## I18n

This specification is written in both English and Chinese. In the event of any
Expand Down
3 changes: 2 additions & 1 deletion la-abi.adoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
= Application Binary Interface for the LoongArch™ Architecture
Version 2.10
Version 2.20
Copyright © Loongson Technology 2023. All rights reserved.
:toc: macro
:toclevels: 3
:toctitle:
:doctype: article
:title-page:
:icons: font

toc::[]
Expand Down
23 changes: 17 additions & 6 deletions laelf.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
= ELF for the LoongArch™ Architecture
Version 20230519 +
Version 20231102 +
Copyright © Loongson Technology 2023. All rights reserved.

== Abstract
Expand All @@ -20,6 +20,10 @@ LoongArch, ELF, ABI, SysV gABI, ELF header, Relocations

|20230519
|initial version, derived from the original __LoongArch ELF psABI__ document.

|20231102
|added relocation R_LARCH_CALL36, removed R_LARCH_DELETE / R_LARCH_CFA, and
fixed the uleb128 relocation name.
|====

== Introduction
Expand Down Expand Up @@ -661,8 +665,8 @@ with check 28-bit signed overflow and 4-bit aligned
|

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

|102
Expand All @@ -676,8 +680,8 @@ with check 28-bit signed overflow and 4-bit aligned
|`+(*(uint32_t *) PC) [24 ... 5] = (S + A - PC) [21 ... 2]+`

|104
|R_LARCH_CFA
|Canonical Frame Address
|(reserved)
|
|

|105
Expand All @@ -696,14 +700,21 @@ with check 28-bit signed overflow and 4-bit aligned
|`+(*(uleb128 *) PC) += S + A+`

|108
|R_LARCH_ADD_ULEB128
|R_LARCH_SUB_ULEB128
|ULEB128 in-place subtraction
|`+(*(uleb128 *) PC) -= S + A+`

|109
|R_LARCH_64_PCREL
|64-bit PC relative
|`+(*(uint64_t *) PC) = (S+A-PC) [63 ... 0]+`

|110
|R_LARCH_CALL36
|Used for medium code model function call instruction sequence pcaddu18i and jirl, these two instructions must adjacent.
|`+(*(uint32_t *) PC) [24 ... 5] = (S+A-PC) [37 ... 18],+`

`+(*(uint32_t *) (PC+4)) [25 ... 10] = (S+A-PC) [17 ... 2]+`
|===

[bibliography]
Expand Down
Loading

0 comments on commit b53df30

Please sign in to comment.