[PATCH] LoongArch: Set defaults to exec stack 0.

WANG Xuerui i.swmail@xen0n.name
Sat Jul 30 19:20:49 GMT 2022


On 7/25/22 10:22, liuzhensong wrote:
> ---
>   bfd/elfnn-loongarch.c       | 1 +
>   ld/testsuite/ld-elf/elf.exp | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
> index 4efe3d9370c..43182ead8cd 100644
> --- a/bfd/elfnn-loongarch.c
> +++ b/bfd/elfnn-loongarch.c
> @@ -132,6 +132,7 @@ struct loongarch_elf_link_hash_table
>   
>   #define elf_backend_want_dynrelro 1
>   #define elf_backend_rela_normal 1
> +#define elf_backend_default_execstack 0
>   
>   /* Generate a PLT header.  */
>   
> diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
> index 10c635e9593..b8829b4e3ee 100644
> --- a/ld/testsuite/ld-elf/elf.exp
> +++ b/ld/testsuite/ld-elf/elf.exp
> @@ -187,6 +187,7 @@ proc target_defaults_to_execstack {} {
>   	|| [istarget "nios2*-*-*"]
>   	|| [istarget "powerpc64*-*-*"]
>   	|| [istarget "riscv*-*-*"]
> +	|| [istarget "loongarch*-*-*"]
>   	|| [istarget "tilegx*-*-*"]
>   	|| [istarget "tilepro*-*-*"] } {
>   	  return 0

Heads-up: this patch can now land, the Linux fix [1] is already upstream 
and will be included in 5.19.

[1]: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/loongarch?id=317980e6b4d03884429f2cdaf51efd28f01b71b0


More information about the Binutils mailing list