Lines Matching refs:reader
35 void checkHeader( const elfio& reader,
49 EXPECT_EQ( reader.get_class(), nClass );
50 EXPECT_EQ( reader.get_encoding(), encoding );
51 EXPECT_EQ( reader.get_elf_version(), elfVersion );
52 EXPECT_EQ( reader.get_os_abi(), OSABI );
53 EXPECT_EQ( reader.get_abi_version(), ABIVersion );
54 EXPECT_EQ( reader.get_type(), type );
55 EXPECT_EQ( reader.get_machine(), machine );
56 EXPECT_EQ( reader.get_version(), version );
57 EXPECT_EQ( reader.get_entry(), entry );
58 EXPECT_EQ( reader.get_flags(), flags );
59 EXPECT_EQ( reader.sections.size(), secNum );
60 EXPECT_EQ( reader.segments.size(), segNum );
206 elfio reader;
207 ASSERT_EQ( reader.load( "elf_examples/hello_32", is_lazy ), true );
208 checkHeader( reader, ELFCLASS32, ELFDATA2LSB, EV_CURRENT, ET_EXEC,
213 const section* sec = reader.sections[0];
216 sec = reader.sections[1];
220 sec = reader.sections[9];
224 sec = reader.sections[19];
228 sec = reader.sections[27];
232 for ( Elf_Half i = 0; i < reader.sections.size(); ++i ) {
233 sec = reader.sections[i];
237 const section* sec1 = reader.sections[".strtab"];
242 const segment* seg = reader.segments[0];
246 seg = reader.segments[4];
250 seg = reader.segments[6];
255 sec = reader.sections[".symtab"];
257 const_symbol_section_accessor sr( reader, sec );
276 sec = reader.sections[".rel.dyn"];
278 const_relocation_section_accessor reloc( reader, sec );
284 sec = reader.sections[".rel.plt"];
286 const_relocation_section_accessor reloc1( reader, sec );
297 // Check note reader
298 sec = reader.sections[".note.ABI-tag"];
300 const_note_section_accessor notes( reader, sec );
313 elfio reader;
315 ASSERT_EQ( reader.load( "elf_examples/hello_64", is_lazy ), true );
319 checkHeader( reader, ELFCLASS64, ELFDATA2LSB, EV_CURRENT, ET_EXEC,
324 const section* sec = reader.sections[0];
328 sec = reader.sections[1];
333 sec = reader.sections[9];
338 sec = reader.sections[20];
343 sec = reader.sections[28];
348 const section* sec1 = reader.sections[".strtab"];
353 const segment* seg = reader.segments[0];
357 seg = reader.segments[2];
362 seg = reader.segments[7];
367 sec = reader.sections[".symtab"];
369 const_symbol_section_accessor sr( reader, sec );
389 sec = reader.sections[".rela.dyn"];
391 const_relocation_section_accessor reloc( reader, sec );
397 sec = reader.sections[".rela.plt"];
399 const_relocation_section_accessor reloc1( reader, sec );
408 // Check note reader
409 sec = reader.sections[".note.ABI-tag"];
411 const_note_section_accessor notes( reader, sec );
421 elfio reader;
423 ASSERT_EQ( reader.load( "elf_examples/hello_64.o" ), true );
427 checkHeader( reader, ELFCLASS64, ELFDATA2LSB, EV_CURRENT, ET_REL, EM_X86_64,
432 const section* sec = reader.sections[0];
436 sec = reader.sections[1];
441 const section* sec1 = reader.sections[".text"];
444 sec = reader.sections[12];
447 sec1 = reader.sections[".strtab"];
452 sec = reader.sections[".symtab"];
454 const_symbol_section_accessor sr( reader, sec );
462 sec = reader.sections[".rela.text"];
464 const_relocation_section_accessor reloc( reader, sec );
471 sec = reader.sections[".rela.eh_frame"];
473 const_relocation_section_accessor reloc1( reader, sec );
482 elfio reader;
484 ASSERT_EQ( reader.load( "elf_examples/hello_32.o" ), true );
488 checkHeader( reader, ELFCLASS32, ELFDATA2LSB, EV_CURRENT, ET_REL, EM_386, 1,
493 const section* sec = reader.sections[0];
497 sec = reader.sections[1];
502 const section* sec1 = reader.sections[".text"];
505 sec = reader.sections[10];
509 sec1 = reader.sections[".strtab"];
514 sec = reader.sections[".symtab"];
516 const_symbol_section_accessor sr( reader, sec );
524 sec = reader.sections[".rel.text"];
526 const_relocation_section_accessor reloc( reader, sec );
536 elfio reader;
538 ASSERT_EQ( reader.load( "elf_examples/test_ppc.o" ), true );
542 checkHeader( reader, ELFCLASS32, ELFDATA2MSB, EV_CURRENT, ET_REL, EM_PPC, 1,
547 const section* sec = reader.sections[0];
551 sec = reader.sections[1];
556 const section* sec1 = reader.sections[".text"];
559 sec = reader.sections[15];
563 sec1 = reader.sections[".strtab"];
568 sec = reader.sections[".symtab"];
570 const_symbol_section_accessor sr( reader, sec );
580 sec = reader.sections[".rela.text"];
582 const_relocation_section_accessor reloc( reader, sec );
589 sec = reader.sections[".rela.ctors"];
591 const_relocation_section_accessor reloc1( reader, sec );
596 sec = reader.sections[".rela.eh_frame"];
598 const_relocation_section_accessor reloc2( reader, sec );
607 elfio reader;
609 ASSERT_EQ( reader.load( "elf_examples/test_ppc" ), true );
613 checkHeader( reader, ELFCLASS32, ELFDATA2MSB, EV_CURRENT, ET_EXEC, EM_PPC,
618 const section* sec = reader.sections[0];
622 sec = reader.sections[1];
627 sec = reader.sections[9];
632 sec = reader.sections[20];
637 sec = reader.sections[28];
641 const section* sec1 = reader.sections[".shstrtab"];
646 const segment* seg = reader.segments[0];
650 seg = reader.segments[2];
654 seg = reader.segments[7];
659 sec = reader.sections[".symtab"];
661 const_symbol_section_accessor sr( reader, sec );
682 sec = reader.sections[".rela.dyn"];
684 const_relocation_section_accessor reloc( reader, sec );
689 sec = reader.sections[".rela.plt"];
691 const_relocation_section_accessor reloc1( reader, sec );
699 // Check note reader
700 sec = reader.sections[".note.ABI-tag"];
702 const_note_section_accessor notes( reader, sec );
737 elfio reader;
738 ASSERT_EQ( reader.load( "elf_examples/elf_dummy_header_i386_32.elf" ),
743 checkHeader( reader, ELFCLASS32, ELFDATA2LSB, EV_CURRENT, ET_REL, EM_386,
747 const section* sec = reader.sections[""];
751 sec = reader.sections[".shstrtab"];
755 sec = reader.sections[".note"];
790 elfio reader;
791 ASSERT_EQ( reader.load( "elf_examples/elf_dummy_header_ppc_32.elf" ),
796 checkHeader( reader, ELFCLASS32, ELFDATA2MSB, EV_CURRENT, ET_REL, EM_PPC,
800 const section* sec = reader.sections[""];
804 sec = reader.sections[".note"];
809 sec = reader.sections[".shstrtab"];
843 elfio reader;
844 ASSERT_EQ( reader.load( "elf_examples/elf_dummy_header_i386_64.elf" ),
849 checkHeader( reader, ELFCLASS64, ELFDATA2LSB, EV_CURRENT, ET_REL, EM_X86_64,
853 const section* sec = reader.sections[""];
857 sec = reader.sections[".note"];
862 sec = reader.sections[".shstrtab"];
896 elfio reader;
897 ASSERT_EQ( reader.load( "elf_examples/elf_dummy_header_ppc_64.elf" ),
902 checkHeader( reader, ELFCLASS64, ELFDATA2MSB, EV_CURRENT, ET_REL, EM_PPC64,
906 const section* sec = reader.sections[""];
910 sec = reader.sections[".shstrtab"];
914 sec = reader.sections[".note"];
923 elfio reader;
925 ASSERT_EQ( reader.load( "elf_examples/main" ), true );
927 section* dynsec = reader.sections[".dynamic"];
930 dynamic_section_accessor da( reader, dynsec );
957 elfio reader;
959 ASSERT_EQ( reader.load( "elf_examples/libfunc.so" ), true );
961 section* dynsec = reader.sections[".dynamic"];
964 dynamic_section_accessor da( reader, dynsec );
1021 elfio reader( new ( std::nothrow ) mock_wiiu_compression() );
1029 ASSERT_EQ( reader.load( "elf_examples/helloworld.rpx" ), true );
1030 const section* text2 = reader.sections[1];
1037 elfio reader;
1039 ASSERT_EQ( reader.load( "elf_examples/main" ), true );
1041 section* dynsec = reader.sections[".dynamic"];
1044 dynamic_section_accessor da( reader, dynsec );
1047 section* strsec1 = reader.sections.add( ".dynstr" );
1049 strsec1->set_entry_size( reader.get_default_entry_size( SHT_STRTAB ) );
1051 section* dynsec1 = reader.sections.add( ".dynamic1" );
1053 dynsec1->set_entry_size( reader.get_default_entry_size( SHT_DYNAMIC ) );
1055 dynamic_section_accessor da1( reader, dynsec1 );