ELF: added support for SHT_RISCV_ATTRIBUTES seg

master
vhaudiquet 11 months ago
parent 326b52ef86
commit a0935f0aad
  1. 4
      src/bootloader/elf/elf.c
  2. 1
      src/bootloader/elf/elf.h

@ -68,8 +68,12 @@ uint32_t elf_32_load(void* file)
// Check segment type // Check segment type
if(current.segment_type != SEGMENT_TYPE_LOAD) if(current.segment_type != SEGMENT_TYPE_LOAD)
{
// Don't message for riscv-specific attributes segment
if(current.segment_type != SEGMENT_TYPE_RISCV_SPECIFIC_SHT_RISCV_ATTRIBUTES)
{ {
fprintf(stderr, "WARNING: Unknown segment type %u in ELF file ; skipping\n", current.segment_type); fprintf(stderr, "WARNING: Unknown segment type %u in ELF file ; skipping\n", current.segment_type);
}
continue; continue;
} }

@ -77,6 +77,7 @@ typedef struct ELF_PROGRAM_HEADER_32
#define SEGMENT_TYPE_DYNAMIC 2 #define SEGMENT_TYPE_DYNAMIC 2
#define SEGMENT_TYPE_INTERP 3 #define SEGMENT_TYPE_INTERP 3
#define SEGMENT_TYPE_NOTE 4 #define SEGMENT_TYPE_NOTE 4
#define SEGMENT_TYPE_RISCV_SPECIFIC_SHT_RISCV_ATTRIBUTES 0x70000003
uint32_t elf_32_load(void* file); uint32_t elf_32_load(void* file);

Loading…
Cancel
Save