openhwgroup / corev-binutils-gdb

GNU General Public License v2.0
9 stars 26 forks source link

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

Open Pudding2018 opened 8 months ago

Pudding2018 commented 8 months ago

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.

MaryBennett commented 1 week ago

This bug is fixed in upstream. Just requires us to roll forward.