Skip to content

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

@Pudding2018

Description

@Pudding2018

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions