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

tablejump section (__jvt_base$) need be aligned on a 64-byte boundary #106

Open
Pudding2018 opened this issue Oct 30, 2023 · 0 comments
Open

Comments

@Pudding2018
Copy link

Pudding2018 commented Oct 30, 2023

Hi,
The Zc instruction set extension spec (Zc* v1.0) said that ZCMT jump table must be a minimum of 64-byte aligned, but in the branch development-eddf4096b97, the tablejump section was defined to be aligned on a 4-byte boundary. The detailed code is as follows (/bfd/elfnn-riscv.c bfd_elf_riscv_make_tablejump_section):

      if (sec == NULL
	  || !bfd_set_section_alignment (sec, bed->s->log_file_align)
	  || !bfd_set_section_size (sec, 256 * RISCV_ELF_WORD_BYTES))
	return false;
      htab->table_jump_htab->tablejump_sec = sec;
      htab->table_jump_htab->tablejump_sec_owner = abfd;
    }

bfd_set_section_alignment (sec, bed->s->log_file_align)
In my test, bfd_set_section_alignment (sec, 6) can work normally, please help me see if this modification is appropriate. Thank you for your time.

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

No branches or pull requests

1 participant