From e602ac775e4677f18274dcfeac67992a49a5cdf3 Mon Sep 17 00:00:00 2001 From: OB Date: Tue, 4 Feb 2025 13:08:17 -0800 Subject: [PATCH 1/2] Enable bit-manipulation extensions to RISC-V --- pwnlib/asm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pwnlib/asm.py b/pwnlib/asm.py index a41352a91..bb577301a 100644 --- a/pwnlib/asm.py +++ b/pwnlib/asm.py @@ -274,8 +274,8 @@ def _assembler(): 'ia64': [gas, '-m%ce' % context.endianness[0]], # riscv64-unknown-elf-as supports riscv32 as well as riscv64 - 'riscv32': [gas, '-march=rv32gc', '-mabi=ilp32'], - 'riscv64': [gas, '-march=rv64gc', '-mabi=lp64'], + 'riscv32': [gas, '-march=rv32gc_zba_zbb_zbc_zbs', '-mabi=ilp32'], + 'riscv64': [gas, '-march=rv64gc_zba_zbb_zbc_zbs', '-mabi=lp64'], # loongarch64 supports none of -64, -EB, -EL or -march 'loongarch64' : [gas], From bd7443d63041efe15f5395120c4b4669b37c441f Mon Sep 17 00:00:00 2001 From: OB Date: Tue, 25 Feb 2025 19:52:14 -0800 Subject: [PATCH 2/2] add vector extension, remove zbc --- pwnlib/asm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pwnlib/asm.py b/pwnlib/asm.py index bb577301a..cf7146440 100644 --- a/pwnlib/asm.py +++ b/pwnlib/asm.py @@ -274,8 +274,8 @@ def _assembler(): 'ia64': [gas, '-m%ce' % context.endianness[0]], # riscv64-unknown-elf-as supports riscv32 as well as riscv64 - 'riscv32': [gas, '-march=rv32gc_zba_zbb_zbc_zbs', '-mabi=ilp32'], - 'riscv64': [gas, '-march=rv64gc_zba_zbb_zbc_zbs', '-mabi=lp64'], + 'riscv32': [gas, '-march=rv32gcv_zba_zbb_zbs', '-mabi=ilp32'], + 'riscv64': [gas, '-march=rv64gcv_zba_zbb_zbs', '-mabi=lp64'], # loongarch64 supports none of -64, -EB, -EL or -march 'loongarch64' : [gas],