@@ -840,8 +840,6 @@ fd_sbpf_lenient_elf_parse( fd_sbpf_elf_info_t * info,
840840 /* This documents the values that will be set in this function */
841841 info -> rodata_sz = (uint )bin_sz ; // FIXME
842842 info -> rodata_footprint = (uint )bin_sz ;
843- info -> dynstr_off = 0U ;
844- info -> dynstr_sz = 0U ;
845843 info -> phndx_dyn = -1 ;
846844 info -> shndx_dyn = -1 ;
847845 info -> shndx_symtab = -1 ;
@@ -853,13 +851,6 @@ fd_sbpf_lenient_elf_parse( fd_sbpf_elf_info_t * info,
853851 if ( FD_UNLIKELY ( bin_sz < sizeof (fd_elf64_ehdr ) ) ) {
854852 return FD_SBPF_ELF_PARSER_ERR_OUT_OF_BOUNDS ;
855853 }
856- /* TODO: decide whether we want to enforce that bin is aligned,
857- in which case we can simply cast pointers to the various
858- table entries, or if we want to allow misaligned bin,
859- in which case we have to keep the FD_LOAD calls. */
860- if ( FD_UNLIKELY ( !fd_ulong_is_aligned ( (ulong )bin , 8UL ) ) ) {
861- return FD_SBPF_ELF_PARSER_ERR_INVALID_ALIGNMENT ;
862- }
863854
864855 fd_elf64_ehdr ehdr = FD_LOAD ( fd_elf64_ehdr , bin );
865856 ulong ehdr_start = 0 ;
@@ -1071,8 +1062,6 @@ fd_sbpf_lenient_elf_parse( fd_sbpf_elf_info_t * info,
10711062 return FD_SBPF_ELF_PARSER_ERR_INVALID_SECTION_HEADER ;
10721063 }
10731064 info -> shndx_dynstr = (int )i ;
1074- info -> dynstr_off = (uint )shdr .sh_offset ;
1075- info -> dynstr_sz = (uint )shdr .sh_size ;
10761065 }
10771066 }
10781067 }
@@ -1102,7 +1091,7 @@ fd_sbpf_lenient_elf_parse( fd_sbpf_elf_info_t * info,
11021091 if ( FD_UNLIKELY ( dynamic_table_end < dynamic_table_start ||
11031092 dynamic_table_end > bin_sz ||
11041093 dyn_ph .p_filesz %sizeof (fd_elf64_dyn )!= 0UL ||
1105- (( ulong ) bin + dynamic_table_start )% 8UL != 0UL ) ) {
1094+ ! fd_ulong_is_aligned ( dynamic_table_start , 8UL ) ) ) {
11061095 /* skip - try SHT_DYNAMIC instead */
11071096 dynamic_table_start = ULONG_MAX ;
11081097 dynamic_table_end = ULONG_MAX ;
@@ -1432,8 +1421,6 @@ fd_sbpf_elf_peek( fd_sbpf_elf_info_t * info,
14321421 .text_off = 0U ,
14331422 .text_cnt = 0U ,
14341423 .text_sz = 0UL ,
1435- .dynstr_off = 0U ,
1436- .dynstr_sz = 0U ,
14371424 .rodata_sz = 0U ,
14381425 .rodata_footprint = 0U ,
14391426 .shndx_text = -1 ,
0 commit comments