[PATCH v2 11/15] RISC-V: Linux ABI

Joseph Myers joseph@codesourcery.com
Wed Dec 20 17:33:00 GMT 2017


On Tue, 19 Dec 2017, Palmer Dabbelt wrote:

> diff --git a/sysdeps/unix/sysv/linux/riscv/____longjmp_chk.S b/sysdeps/unix/sysv/linux/riscv/____longjmp_chk.S
> new file mode 100644
> index 000000000000..e903c7e0df2a
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/riscv/____longjmp_chk.S
> @@ -0,0 +1,2 @@
> +#define __longjmp ____longjmp_chk
> +#include <__longjmp.S>

I'm not clear how this is meant to achieve the ____longjmp_chk semantics, 
which involve comparing current and saved stack pointers to avoid jumping 
into a frame that has returned.  (See 
sysdeps/unix/sysv/linux/generic/____longjmp_chk.c for a C version of the 
required logic.)

> diff --git a/sysdeps/unix/sysv/linux/riscv/libthread_db.abilist b/sysdeps/unix/sysv/linux/riscv/libthread_db.abilist

You need a full set of abilist baselines, not just this one.

> +extern int __riscv_flush_icache (void *start, void *end, unsigned long flags);

Should use __start, __end, __flags, unless you really intend start, end 
and flags to be part of the public API for this header.

> diff --git a/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h b/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h

This header does not look appropriately namespace-clean.  Please make sure 
that all the conform/ tests pass, conditioning contents as necessary.  
It's also missing some preprocessor indentation.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list