* [musl] [PATCH] LoongArch64: add new reloc types and NT_LOONGARCH_HW_* into elf.h
@ 2025-01-04 8:41 Jingyun Hua
2025-04-03 9:57 ` Yao Zi
0 siblings, 1 reply; 6+ messages in thread
From: Jingyun Hua @ 2025-01-04 8:41 UTC (permalink / raw)
To: musl; +Cc: lixing, wanghongliang, dalias, Jingyun Hua
These new LoongArch reloc types(101 to 126) have been added in LoongArch psABI
v2.30 and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH sync Linux 6.12 elf.h.
Link:
https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#relocation-types
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/elf.h?h=v6.12#n458
Also refer to glibc:
https://sourceware.org/git/?p=glibc.git;a=blob;f=elf/elf.h
---
include/elf.h | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/include/elf.h b/include/elf.h
index 8b622f63..a3635d03 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -712,6 +712,8 @@ typedef struct {
#define NT_LOONGARCH_LSX 0xa02
#define NT_LOONGARCH_LASX 0xa03
#define NT_LOONGARCH_LBT 0xa04
+#define NT_LOONGARCH_HW_BREAK 0xa05
+#define NT_LOONGARCH_HW_WATCH 0xa06
@@ -3406,6 +3408,32 @@ enum
#define R_LARCH_TLS_GD_HI20 98
#define R_LARCH_32_PCREL 99
#define R_LARCH_RELAX 100
+#define R_LARCH_DELETE 101
+#define R_LARCH_ALIGN 102
+#define R_LARCH_PCREL20_S2 103
+#define R_LARCH_CFA 104
+#define R_LARCH_ADD6 105
+#define R_LARCH_SUB6 106
+#define R_LARCH_ADD_ULEB128 107
+#define R_LARCH_SUB_ULEB128 108
+#define R_LARCH_64_PCREL 109
+#define R_LARCH_CALL36 110
+#define R_LARCH_TLS_DESC_PC_HI20 111
+#define R_LARCH_TLS_DESC_PC_LO12 112
+#define R_LARCH_TLS_DESC64_PC_LO20 113
+#define R_LARCH_TLS_DESC64_PC_HI12 114
+#define R_LARCH_TLS_DESC_HI20 115
+#define R_LARCH_TLS_DESC_LO12 116
+#define R_LARCH_TLS_DESC64_LO20 117
+#define R_LARCH_TLS_DESC64_HI12 118
+#define R_LARCH_TLS_DESC_LD 119
+#define R_LARCH_TLS_DESC_CALL 120
+#define R_LARCH_TLS_LE_HI20_R 121
+#define R_LARCH_TLS_LE_ADD_R 122
+#define R_LARCH_TLS_LE_LO12_R 123
+#define R_LARCH_TLS_LD_PCREL20_S2 124
+#define R_LARCH_TLS_GD_PCREL20_S2 125
+#define R_LARCH_TLS_DESC_PCREL20_S2 126
#ifdef __cplusplus
}
--
2.47.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [musl] [PATCH] LoongArch64: add new reloc types and NT_LOONGARCH_HW_* into elf.h
2025-01-04 8:41 [musl] [PATCH] LoongArch64: add new reloc types and NT_LOONGARCH_HW_* into elf.h Jingyun Hua
@ 2025-04-03 9:57 ` Yao Zi
2025-06-18 4:02 ` Yao Zi
0 siblings, 1 reply; 6+ messages in thread
From: Yao Zi @ 2025-04-03 9:57 UTC (permalink / raw)
To: musl; +Cc: lixing, wanghongliang, dalias, Jingyun Hua
On Sat, Jan 04, 2025 at 04:41:44PM +0800, Jingyun Hua wrote:
> These new LoongArch reloc types(101 to 126) have been added in LoongArch psABI
> v2.30 and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH sync Linux 6.12 elf.h.
>
> Link:
> https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#relocation-types
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/elf.h?h=v6.12#n458
>
> Also refer to glibc:
> https://sourceware.org/git/?p=glibc.git;a=blob;f=elf/elf.h
Ping on this patch, This is necessary for LLDB 20.1.2 to be built for
loongarch64. Although there's a workaround introduced later[1], it will
be nice to have these definitions presented in musl's elf.h as soon as
possible :)
Thanks,
Yao Zi
[1]: https://github.com/llvm/llvm-project/commit/50ae1c7bf40ba50aaf3132fa869eda8f06648155
> ---
> include/elf.h | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
>
> diff --git a/include/elf.h b/include/elf.h
> index 8b622f63..a3635d03 100644
> --- a/include/elf.h
> +++ b/include/elf.h
> @@ -712,6 +712,8 @@ typedef struct {
> #define NT_LOONGARCH_LSX 0xa02
> #define NT_LOONGARCH_LASX 0xa03
> #define NT_LOONGARCH_LBT 0xa04
> +#define NT_LOONGARCH_HW_BREAK 0xa05
> +#define NT_LOONGARCH_HW_WATCH 0xa06
>
>
>
> @@ -3406,6 +3408,32 @@ enum
> #define R_LARCH_TLS_GD_HI20 98
> #define R_LARCH_32_PCREL 99
> #define R_LARCH_RELAX 100
> +#define R_LARCH_DELETE 101
> +#define R_LARCH_ALIGN 102
> +#define R_LARCH_PCREL20_S2 103
> +#define R_LARCH_CFA 104
> +#define R_LARCH_ADD6 105
> +#define R_LARCH_SUB6 106
> +#define R_LARCH_ADD_ULEB128 107
> +#define R_LARCH_SUB_ULEB128 108
> +#define R_LARCH_64_PCREL 109
> +#define R_LARCH_CALL36 110
> +#define R_LARCH_TLS_DESC_PC_HI20 111
> +#define R_LARCH_TLS_DESC_PC_LO12 112
> +#define R_LARCH_TLS_DESC64_PC_LO20 113
> +#define R_LARCH_TLS_DESC64_PC_HI12 114
> +#define R_LARCH_TLS_DESC_HI20 115
> +#define R_LARCH_TLS_DESC_LO12 116
> +#define R_LARCH_TLS_DESC64_LO20 117
> +#define R_LARCH_TLS_DESC64_HI12 118
> +#define R_LARCH_TLS_DESC_LD 119
> +#define R_LARCH_TLS_DESC_CALL 120
> +#define R_LARCH_TLS_LE_HI20_R 121
> +#define R_LARCH_TLS_LE_ADD_R 122
> +#define R_LARCH_TLS_LE_LO12_R 123
> +#define R_LARCH_TLS_LD_PCREL20_S2 124
> +#define R_LARCH_TLS_GD_PCREL20_S2 125
> +#define R_LARCH_TLS_DESC_PCREL20_S2 126
>
> #ifdef __cplusplus
> }
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] LoongArch64: add new reloc types and NT_LOONGARCH_HW_* into elf.h
2025-04-03 9:57 ` Yao Zi
@ 2025-06-18 4:02 ` Yao Zi
2025-06-18 4:19 ` Rich Felker
0 siblings, 1 reply; 6+ messages in thread
From: Yao Zi @ 2025-06-18 4:02 UTC (permalink / raw)
To: musl; +Cc: lixing, wanghongliang, dalias, Jingyun Hua
On Thu, Apr 03, 2025 at 09:57:16AM +0000, Yao Zi wrote:
> On Sat, Jan 04, 2025 at 04:41:44PM +0800, Jingyun Hua wrote:
> > These new LoongArch reloc types(101 to 126) have been added in LoongArch psABI
> > v2.30 and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH sync Linux 6.12 elf.h.
> >
> > Link:
> > https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#relocation-types
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/elf.h?h=v6.12#n458
> >
> > Also refer to glibc:
> > https://sourceware.org/git/?p=glibc.git;a=blob;f=elf/elf.h
>
> Ping on this patch, This is necessary for LLDB 20.1.2 to be built for
> loongarch64. Although there's a workaround introduced later[1], it will
> be nice to have these definitions presented in musl's elf.h as soon as
> possible :)
>
> Thanks,
> Yao Zi
Gently ping again on this, it will be nice if we could include it in
musl v1.2.6 :)
> [1]: https://github.com/llvm/llvm-project/commit/50ae1c7bf40ba50aaf3132fa869eda8f06648155
Thanks,
Yao Zi
> > ---
> > include/elf.h | 28 ++++++++++++++++++++++++++++
> > 1 file changed, 28 insertions(+)
> >
> > diff --git a/include/elf.h b/include/elf.h
> > index 8b622f63..a3635d03 100644
> > --- a/include/elf.h
> > +++ b/include/elf.h
> > @@ -712,6 +712,8 @@ typedef struct {
> > #define NT_LOONGARCH_LSX 0xa02
> > #define NT_LOONGARCH_LASX 0xa03
> > #define NT_LOONGARCH_LBT 0xa04
> > +#define NT_LOONGARCH_HW_BREAK 0xa05
> > +#define NT_LOONGARCH_HW_WATCH 0xa06
> >
> >
> >
> > @@ -3406,6 +3408,32 @@ enum
> > #define R_LARCH_TLS_GD_HI20 98
> > #define R_LARCH_32_PCREL 99
> > #define R_LARCH_RELAX 100
> > +#define R_LARCH_DELETE 101
> > +#define R_LARCH_ALIGN 102
> > +#define R_LARCH_PCREL20_S2 103
> > +#define R_LARCH_CFA 104
> > +#define R_LARCH_ADD6 105
> > +#define R_LARCH_SUB6 106
> > +#define R_LARCH_ADD_ULEB128 107
> > +#define R_LARCH_SUB_ULEB128 108
> > +#define R_LARCH_64_PCREL 109
> > +#define R_LARCH_CALL36 110
> > +#define R_LARCH_TLS_DESC_PC_HI20 111
> > +#define R_LARCH_TLS_DESC_PC_LO12 112
> > +#define R_LARCH_TLS_DESC64_PC_LO20 113
> > +#define R_LARCH_TLS_DESC64_PC_HI12 114
> > +#define R_LARCH_TLS_DESC_HI20 115
> > +#define R_LARCH_TLS_DESC_LO12 116
> > +#define R_LARCH_TLS_DESC64_LO20 117
> > +#define R_LARCH_TLS_DESC64_HI12 118
> > +#define R_LARCH_TLS_DESC_LD 119
> > +#define R_LARCH_TLS_DESC_CALL 120
> > +#define R_LARCH_TLS_LE_HI20_R 121
> > +#define R_LARCH_TLS_LE_ADD_R 122
> > +#define R_LARCH_TLS_LE_LO12_R 123
> > +#define R_LARCH_TLS_LD_PCREL20_S2 124
> > +#define R_LARCH_TLS_GD_PCREL20_S2 125
> > +#define R_LARCH_TLS_DESC_PCREL20_S2 126
> >
> > #ifdef __cplusplus
> > }
> > --
> > 2.47.1
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] LoongArch64: add new reloc types and NT_LOONGARCH_HW_* into elf.h
2025-06-18 4:02 ` Yao Zi
@ 2025-06-18 4:19 ` Rich Felker
2025-06-18 5:18 ` Yao Zi
0 siblings, 1 reply; 6+ messages in thread
From: Rich Felker @ 2025-06-18 4:19 UTC (permalink / raw)
To: Yao Zi; +Cc: musl, lixing, wanghongliang, Jingyun Hua
On Wed, Jun 18, 2025 at 04:02:37AM +0000, Yao Zi wrote:
> On Thu, Apr 03, 2025 at 09:57:16AM +0000, Yao Zi wrote:
> > On Sat, Jan 04, 2025 at 04:41:44PM +0800, Jingyun Hua wrote:
> > > These new LoongArch reloc types(101 to 126) have been added in LoongArch psABI
> > > v2.30 and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH sync Linux 6.12 elf.h.
> > >
> > > Link:
> > > https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#relocation-types
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/elf.h?h=v6.12#n458
> > >
> > > Also refer to glibc:
> > > https://sourceware.org/git/?p=glibc.git;a=blob;f=elf/elf.h
> >
> > Ping on this patch, This is necessary for LLDB 20.1.2 to be built for
> > loongarch64. Although there's a workaround introduced later[1], it will
> > be nice to have these definitions presented in musl's elf.h as soon as
> > possible :)
> >
> > Thanks,
> > Yao Zi
>
> Gently ping again on this, it will be nice if we could include it in
> musl v1.2.6 :)
>
> > [1]: https://github.com/llvm/llvm-project/commit/50ae1c7bf40ba50aaf3132fa869eda8f06648155
Yes, I want to make sure the missing loongarch stuff gets in without
being overlooked. Pleae ping any other stuff that's missing too. Thanks!
Rich
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] LoongArch64: add new reloc types and NT_LOONGARCH_HW_* into elf.h
2025-06-18 4:19 ` Rich Felker
@ 2025-06-18 5:18 ` Yao Zi
2025-06-18 7:15 ` lixing
0 siblings, 1 reply; 6+ messages in thread
From: Yao Zi @ 2025-06-18 5:18 UTC (permalink / raw)
To: musl; +Cc: lixing, wanghongliang, Jingyun Hua
On Wed, Jun 18, 2025 at 12:19:27AM -0400, Rich Felker wrote:
> On Wed, Jun 18, 2025 at 04:02:37AM +0000, Yao Zi wrote:
> > On Thu, Apr 03, 2025 at 09:57:16AM +0000, Yao Zi wrote:
> > > On Sat, Jan 04, 2025 at 04:41:44PM +0800, Jingyun Hua wrote:
> > > > These new LoongArch reloc types(101 to 126) have been added in LoongArch psABI
> > > > v2.30 and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH sync Linux 6.12 elf.h.
> > > >
> > > > Link:
> > > > https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#relocation-types
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/elf.h?h=v6.12#n458
> > > >
> > > > Also refer to glibc:
> > > > https://sourceware.org/git/?p=glibc.git;a=blob;f=elf/elf.h
> > >
> > > Ping on this patch, This is necessary for LLDB 20.1.2 to be built for
> > > loongarch64. Although there's a workaround introduced later[1], it will
> > > be nice to have these definitions presented in musl's elf.h as soon as
> > > possible :)
> > >
> > > Thanks,
> > > Yao Zi
> >
> > Gently ping again on this, it will be nice if we could include it in
> > musl v1.2.6 :)
> >
> > > [1]: https://github.com/llvm/llvm-project/commit/50ae1c7bf40ba50aaf3132fa869eda8f06648155
>
> Yes, I want to make sure the missing loongarch stuff gets in without
> being overlooked. Pleae ping any other stuff that's missing too. Thanks!
I'm maintaining a LLVM-based distro, and with this patch merged, no more
backport is required to build loongarch64 packages.
Also had a quick glance at Alpine's aports, there're two extra patches
backported by Alpine,
1. Define fpu and simd context in signal.h[1][2]
2. Define structures for LSX and LASX vector registers in bits/user.h[3][4]
where 1 affects dotnet and 2 affects binutils-gdb, according to the
commit messages.
Those're all patches which I'm aware of. I'm not sure whether the links
point to the latest revisions (the openwall archive is a little hard to
search).
Anyway, thanks for your great work!
> Rich
Best regards,
Yao Zi
[1]: https://www.openwall.com/lists/musl/2024/09/23/1
[2]: https://git.alpinelinux.org/aports/commit/main/musl/loongarch64-add-fpu-and-simd-context-to-signal.h.patch?id=e54df144c2e361cc1a8207303ae93ef978dcf36c
[3]: https://www.openwall.com/lists/musl/2024/08/02/1
[4]: https://git.alpinelinux.org/aports/commit/main/musl/loongarch64-Add-lsx-and-lasx-vector-structure-defini.patch?id=ed8fd489f491913855b3bea040c0957f8a460403
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] LoongArch64: add new reloc types and NT_LOONGARCH_HW_* into elf.h
2025-06-18 5:18 ` Yao Zi
@ 2025-06-18 7:15 ` lixing
0 siblings, 0 replies; 6+ messages in thread
From: lixing @ 2025-06-18 7:15 UTC (permalink / raw)
To: Yao Zi, musl; +Cc: wanghongliang, shanjiantao
Thanks, Yao.
And also thanks for Rich to review these patches again, including the
new reloc types.
[1] https://www.openwall.com/lists/musl/2024/09/23/1
[2] https://www.openwall.com/lists/musl/2024/08/02/1
在 2025/6/18 下午1:18, Yao Zi 写道:
> On Wed, Jun 18, 2025 at 12:19:27AM -0400, Rich Felker wrote:
>> On Wed, Jun 18, 2025 at 04:02:37AM +0000, Yao Zi wrote:
>>> On Thu, Apr 03, 2025 at 09:57:16AM +0000, Yao Zi wrote:
>>>> On Sat, Jan 04, 2025 at 04:41:44PM +0800, Jingyun Hua wrote:
>>>>> These new LoongArch reloc types(101 to 126) have been added in LoongArch psABI
>>>>> v2.30 and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH sync Linux 6.12 elf.h.
>>>>>
>>>>> Link:
>>>>> https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#relocation-types
>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/elf.h?h=v6.12#n458
>>>>>
>>>>> Also refer to glibc:
>>>>> https://sourceware.org/git/?p=glibc.git;a=blob;f=elf/elf.h
>>>> Ping on this patch, This is necessary for LLDB 20.1.2 to be built for
>>>> loongarch64. Although there's a workaround introduced later[1], it will
>>>> be nice to have these definitions presented in musl's elf.h as soon as
>>>> possible :)
>>>>
>>>> Thanks,
>>>> Yao Zi
>>> Gently ping again on this, it will be nice if we could include it in
>>> musl v1.2.6 :)
>>>
>>>> [1]: https://github.com/llvm/llvm-project/commit/50ae1c7bf40ba50aaf3132fa869eda8f06648155
>> Yes, I want to make sure the missing loongarch stuff gets in without
>> being overlooked. Pleae ping any other stuff that's missing too. Thanks!
> I'm maintaining a LLVM-based distro, and with this patch merged, no more
> backport is required to build loongarch64 packages.
>
> Also had a quick glance at Alpine's aports, there're two extra patches
> backported by Alpine,
>
> 1. Define fpu and simd context in signal.h[1][2]
> 2. Define structures for LSX and LASX vector registers in bits/user.h[3][4]
>
> where 1 affects dotnet and 2 affects binutils-gdb, according to the
> commit messages.
>
> Those're all patches which I'm aware of. I'm not sure whether the links
> point to the latest revisions (the openwall archive is a little hard to
> search).
>
> Anyway, thanks for your great work!
>
>> Rich
> Best regards,
> Yao Zi
>
> [1]: https://www.openwall.com/lists/musl/2024/09/23/1
> [2]: https://git.alpinelinux.org/aports/commit/main/musl/loongarch64-add-fpu-and-simd-context-to-signal.h.patch?id=e54df144c2e361cc1a8207303ae93ef978dcf36c
> [3]: https://www.openwall.com/lists/musl/2024/08/02/1
> [4]: https://git.alpinelinux.org/aports/commit/main/musl/loongarch64-Add-lsx-and-lasx-vector-structure-defini.patch?id=ed8fd489f491913855b3bea040c0957f8a460403
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-06-18 7:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-04 8:41 [musl] [PATCH] LoongArch64: add new reloc types and NT_LOONGARCH_HW_* into elf.h Jingyun Hua
2025-04-03 9:57 ` Yao Zi
2025-06-18 4:02 ` Yao Zi
2025-06-18 4:19 ` Rich Felker
2025-06-18 5:18 ` Yao Zi
2025-06-18 7:15 ` lixing
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).