* [Qemu-devel] [PATCH v2] elf: Add RISC-V PSABI ELF header defines
@ 2018-05-25 7:22 Michael Clark
2018-05-25 7:53 ` Laurent Vivier
0 siblings, 1 reply; 3+ messages in thread
From: Michael Clark @ 2018-05-25 7:22 UTC (permalink / raw)
To: qemu-devel, qemu-trivial
Cc: patches, Michael Clark, Michael Tokarev, Laurent Vivier,
Richard Henderson, Alistair Francis
Refer to the RISC-V PSABI specification for details:
- https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md
Cc: Michael Tokarev <mjt@tls.msk.ru>
Cc: Laurent Vivier <laurent@vivier.eu>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
---
include/elf.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/elf.h b/include/elf.h
index 934dbbd6b3ae..bd0493f43d19 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -1285,6 +1285,14 @@ typedef struct {
#define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */
#define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */
+/* RISC-V specific definitions. */
+#define EF_RISCV_RVC 0x0001
+#define EF_RISCV_FLOAT_ABI_SINGLE 0x0002
+#define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004
+#define EF_RISCV_FLOAT_ABI_QUAD 0x0006
+#define EF_RISCV_RVE 0x0008
+#define EF_RISCV_TSO 0x0010
+
typedef struct elf32_rel {
Elf32_Addr r_offset;
Elf32_Word r_info;
--
2.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] elf: Add RISC-V PSABI ELF header defines
2018-05-25 7:22 [Qemu-devel] [PATCH v2] elf: Add RISC-V PSABI ELF header defines Michael Clark
@ 2018-05-25 7:53 ` Laurent Vivier
2018-05-25 9:25 ` Michael Clark
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2018-05-25 7:53 UTC (permalink / raw)
To: Michael Clark, qemu-devel, qemu-trivial
Cc: patches, Michael Tokarev, Richard Henderson, Alistair Francis
Le 25/05/2018 à 09:22, Michael Clark a écrit :
> Refer to the RISC-V PSABI specification for details:
>
> - https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md
>
> Cc: Michael Tokarev <mjt@tls.msk.ru>
> Cc: Laurent Vivier <laurent@vivier.eu>
> Cc: Richard Henderson <richard.henderson@linaro.org>
> Cc: Alistair Francis <Alistair.Francis@wdc.com>
> Signed-off-by: Michael Clark <mjc@sifive.com>
> ---
> include/elf.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/elf.h b/include/elf.h
> index 934dbbd6b3ae..bd0493f43d19 100644
> --- a/include/elf.h
> +++ b/include/elf.h
> @@ -1285,6 +1285,14 @@ typedef struct {
> #define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */
> #define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */
>
> +/* RISC-V specific definitions. */
> +#define EF_RISCV_RVC 0x0001
> +#define EF_RISCV_FLOAT_ABI_SINGLE 0x0002
> +#define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004
> +#define EF_RISCV_FLOAT_ABI_QUAD 0x0006
> +#define EF_RISCV_RVE 0x0008
> +#define EF_RISCV_TSO 0x0010
> +
> typedef struct elf32_rel {
> Elf32_Addr r_offset;
> Elf32_Word r_info;
>
from glibc (and binutils), I have:
/* RISC-V ELF Flags */
#define EF_RISCV_RVC 0x0001
#define EF_RISCV_FLOAT_ABI 0x0006
#define EF_RISCV_FLOAT_ABI_SOFT 0x0000
#define EF_RISCV_FLOAT_ABI_SINGLE 0x0002
#define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004
#define EF_RISCV_FLOAT_ABI_QUAD 0x0006
Perhaps you can also define EF_RISCV_FLOAT_ABI_SOFT and EF_RISCV_FLOAT_ABI?
Anyway:
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] elf: Add RISC-V PSABI ELF header defines
2018-05-25 7:53 ` Laurent Vivier
@ 2018-05-25 9:25 ` Michael Clark
0 siblings, 0 replies; 3+ messages in thread
From: Michael Clark @ 2018-05-25 9:25 UTC (permalink / raw)
To: Laurent Vivier
Cc: QEMU Developers, qemu-trivial, RISC-V Patches, Michael Tokarev,
Richard Henderson, Alistair Francis, Jim Wilson
On Fri, May 25, 2018 at 7:53 PM, Laurent Vivier <laurent@vivier.eu> wrote:
> Le 25/05/2018 à 09:22, Michael Clark a écrit :
> > Refer to the RISC-V PSABI specification for details:
> >
> > - https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md
> >
> > Cc: Michael Tokarev <mjt@tls.msk.ru>
> > Cc: Laurent Vivier <laurent@vivier.eu>
> > Cc: Richard Henderson <richard.henderson@linaro.org>
> > Cc: Alistair Francis <Alistair.Francis@wdc.com>
> > Signed-off-by: Michael Clark <mjc@sifive.com>
> > ---
> > include/elf.h | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/include/elf.h b/include/elf.h
> > index 934dbbd6b3ae..bd0493f43d19 100644
> > --- a/include/elf.h
> > +++ b/include/elf.h
> > @@ -1285,6 +1285,14 @@ typedef struct {
> > #define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */
> > #define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)),
> imm22 */
> >
> > +/* RISC-V specific definitions. */
> > +#define EF_RISCV_RVC 0x0001
> > +#define EF_RISCV_FLOAT_ABI_SINGLE 0x0002
> > +#define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004
> > +#define EF_RISCV_FLOAT_ABI_QUAD 0x0006
> > +#define EF_RISCV_RVE 0x0008
> > +#define EF_RISCV_TSO 0x0010
> > +
> > typedef struct elf32_rel {
> > Elf32_Addr r_offset;
> > Elf32_Word r_info;
> >
>
> from glibc (and binutils), I have:
>
> /* RISC-V ELF Flags */
> #define EF_RISCV_RVC 0x0001
> #define EF_RISCV_FLOAT_ABI 0x0006
> #define EF_RISCV_FLOAT_ABI_SOFT 0x0000
> #define EF_RISCV_FLOAT_ABI_SINGLE 0x0002
> #define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004
> #define EF_RISCV_FLOAT_ABI_QUAD 0x0006
>
> Perhaps you can also define EF_RISCV_FLOAT_ABI_SOFT and EF_RISCV_FLOAT_ABI?
>
Will do. I'll align them also.
Anyway:
>
> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
>
>
Thanks for checking glibc and binutils. I'll update to add the extra
definitions before I make a PR. Thanks!
Michael.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-25 9:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-25 7:22 [Qemu-devel] [PATCH v2] elf: Add RISC-V PSABI ELF header defines Michael Clark
2018-05-25 7:53 ` Laurent Vivier
2018-05-25 9:25 ` Michael Clark
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.