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

Change X32 Flag to N32 #3

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ typedef struct {
#define EF_RISCV_FLOAT_ABI_QUAD 0x0006
#define EF_RISCV_RVE 0x0008
#define EF_RISCV_TSO 0x0010
#define EF_RISCV_X32 0x0020
#define EF_RISCV_N32 0x0020

typedef struct elf32_rel {
Elf32_Addr r_offset;
Expand Down
6 changes: 3 additions & 3 deletions linux-user/elfload.c
Original file line number Diff line number Diff line change
Expand Up @@ -1697,8 +1697,8 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,
#define ELF_START_MMAP 0x80000000
#define ELF_ARCH EM_RISCV

#ifndef ABI_X32_P
#define ABI_X32_P(e_flags) ((e_flags & EF_RISCV_X32) != 0)
#ifndef ABI_N32_P
#define ABI_N32_P(e_flags) ((e_flags & EF_RISCV_N32) != 0)
#endif

#if defined(TARGET_RISCV32) || defined(TARGET_RISCV64ILP32)
Expand Down Expand Up @@ -2063,7 +2063,7 @@ static bool elf_check_ident(struct elfhdr *ehdr)
&& ehdr->e_ident[EI_MAG2] == ELFMAG2
&& ehdr->e_ident[EI_MAG3] == ELFMAG3
#ifdef TARGET_RISCV64ILP32
&& ABI_X32_P(ehdr->e_flags)
&& ABI_N32_P(ehdr->e_flags)
#endif
&& ehdr->e_ident[EI_CLASS] == ELF_CLASS
&& ehdr->e_ident[EI_DATA] == ELF_DATA
Expand Down
Loading