Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riscv: avoid compressed instructions #2419

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Arusekk
Copy link
Member

@Arusekk Arusekk commented Jun 15, 2024

... and do not throw errors if there are relocs (might be benign)

... and do not throw errors if there are relocs (might be benign)
@@ -267,8 +268,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=rv32g', '-mabi=ilp32'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prevents you from using compressed instructions when manually writing shellcode and compiling using asm, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, and therefore I am not very sure about this change. I don't know any way to avoid C and yet allow c.* opcodes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we thought about adding assembler command line args to context when adding riscv support? Or just asm?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do this like we do with thumb (separate arch) but I doubt whether it is worth it. Maybe we can revisit this one day.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to make two different archs? That way you could do asm -c riscv32 and asm -c riscv32c or something similar?

@Arusekk Arusekk linked an issue Sep 5, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assembly seems to be broken on riscv
3 participants