@@ -376,6 +376,7 @@ impl<C: ContextObject> Executable<C> {
376
376
let bytes = if is_memory_aligned ( bytes. as_ptr ( ) as usize , HOST_ALIGN ) {
377
377
bytes
378
378
} else {
379
+ // debug_assert!(false);
379
380
aligned = AlignedMemory :: < { HOST_ALIGN } > :: from_slice ( bytes) ;
380
381
aligned. as_slice ( )
381
382
} ;
@@ -404,6 +405,21 @@ impl<C: ContextObject> Executable<C> {
404
405
bytes : & [ u8 ] ,
405
406
loader : Arc < BuiltinProgram < C > > ,
406
407
) -> Result < Self , ElfParserError > {
408
+ println ! ( "{:X?}" , elf. file_header( ) ) ;
409
+ for header in elf. program_header_table ( ) . iter ( ) {
410
+ println ! ( "{:X?}" , header) ;
411
+ }
412
+ for header in elf. section_header_table ( ) . iter ( ) {
413
+ println ! (
414
+ "{} {:X?}" ,
415
+ elf. section_name( header. sh_name)
416
+ . ok( )
417
+ . and_then( |bytes| std:: str :: from_utf8( bytes) . ok( ) )
418
+ . map( |str | str . to_string( ) )
419
+ . unwrap( ) ,
420
+ header
421
+ ) ;
422
+ }
407
423
const EXPECTED_PROGRAM_HEADERS : [ ( u32 , u32 , u64 ) ; 4 ] = [
408
424
( PT_LOAD , PF_R | PF_X , 0 ) , // byte code
409
425
( PT_LOAD , PF_R , ebpf:: MM_RODATA_START ) , // read only data
@@ -454,6 +470,15 @@ impl<C: ContextObject> Executable<C> {
454
470
. saturating_sub ( text_section. sh_addr )
455
471
. checked_div ( ebpf:: INSN_SIZE as u64 )
456
472
. unwrap_or_default ( ) as usize ;
473
+ println ! (
474
+ "{} {:X}" ,
475
+ elf. symbol_name( symbol. st_name as Elf64Word )
476
+ . ok( )
477
+ . and_then( |bytes| std:: str :: from_utf8( bytes) . ok( ) )
478
+ . map( |str | str . to_string( ) )
479
+ . unwrap( ) ,
480
+ target_pc
481
+ ) ;
457
482
function_registry
458
483
. register_function (
459
484
target_pc as u32 ,
0 commit comments