Lines Matching refs:section

301 /// Find and return a section by its name.
305 /// @param name the section name.
307 /// @return the section found, nor nil if none was found.
315 Elf_Scn* section = 0;
317 while ((section = elf_nextscn(elf_handle, section)) != 0)
319 header = gelf_getshdr(section, &header_mem);
326 return section;
332 /// Find and return a section by its name and its type.
336 /// @param name the name of the section.
338 /// @param section_type the type of the section. This is the
342 /// @return the section found, nor nil if none was found.
350 Elf_Scn* section = 0;
352 while ((section = elf_nextscn(elf_handle, section)) != 0)
354 header = gelf_getshdr(section, &header_mem);
361 return section;
367 /// Find and return a section by its type.
371 /// @param section_type the type of the section. This is the
375 /// @return the section found, or nil if none was found.
379 Elf_Scn* section = nullptr;
380 while ((section = elf_nextscn(elf_handle, section)) != 0)
383 header = gelf_getshdr(section, &header_mem);
387 return section;
390 /// Find and return the .symtab section
394 /// @return the section found, or nil if none was found
401 /// Find and return the .symtab section
405 /// @return the section found, or nil if none was found
423 /// @return the symbol table section
443 /// Find the index (in the section headers table) of the symbol table
444 /// section.
455 /// @return true iff the symbol table section index was found.
459 Elf_Scn* section = find_symbol_table_section(elf_handle);
461 if (!section)
464 symtab_index = elf_ndxscn(section);
468 /// Get the offset offset of the hash table section.
473 /// of the hash table section. This is set iff the function returns true.
475 /// @param symtab_section_offset the offset of the section of the
487 for (Elf_Scn* section = elf_nextscn(elf_handle, 0);
488 section != 0;
489 section = elf_nextscn(elf_handle, section))
491 section_header= gelf_getshdr(section, &header_mem);
496 ht_section_index = elf_ndxscn(section);
513 /// Find and return the .text section.
517 /// @return the .text section found.
522 /// Find and return the .bss section.
526 /// @return the .bss section found.
531 /// Find and return the .rodata section.
535 /// @return the .rodata section found.
540 /// Find and return the .data section.
544 /// @return the .data section found.
549 /// Find and return the .data1 section.
553 /// @return the .data1 section found.
558 /// Return the "Official Procedure descriptors section." This
559 /// section is named .opd, and is usually present only on PPC64
564 /// @return the .opd section, if found. Return nil otherwise.
574 /// @param versym_section the SHT_GNU_versym section found. If the
575 /// section wasn't found, this is set to nil.
577 /// @param verdef_section the SHT_GNU_verdef section found. If the
578 /// section wasn't found, this is set to nil.
580 /// @param verneed_section the SHT_GNU_verneed section found. If the
581 /// section wasn't found, this is set to nil.
590 Elf_Scn* section = NULL;
594 while ((section = elf_nextscn(elf_handle, section)) != NULL)
596 GElf_Shdr* h = gelf_getshdr(section, &mem);
598 versym = section;
600 verdef = section;
602 verneed = section;
617 /// Return the __ksymtab section of a linux kernel ELF file (either
622 /// @return the __ksymtab section if found, nil otherwise.
627 /// Return the __ksymtab_gpl section of a linux kernel ELF file (either
632 /// @return the __ksymtab section if found, nil otherwise.
637 /// Find the __ksymtab_strings section of a Linux kernel binary.
642 /// binary denoted by @p elf_handle, or nil if such a section could
652 /// Return the .rel{a,} section corresponding to a given section.
656 /// @param target_section the section to search the relocation section for
658 /// @return the .rel{a,} section if found, null otherwise.
664 // the relo section we are searching for has this index as sh_info
668 // find the one that points to the section we are searching for
669 Elf_Scn* section = 0;
671 while ((section = elf_nextscn(elf_handle, section)) != 0)
673 header = gelf_getshdr(section, &header_mem);
679 return section;
689 /// @param symtab_section section containing a symbol table.
708 /// Get the version definition (from the SHT_GNU_verdef section) of a
715 /// @param verdef_section the SHT_GNU_verdef section.
768 /// Get the version needed (from the SHT_GNU_verneed section) to
776 /// @param verneed_section the SHT_GNU_verneed section.
837 /// SHT_SYMTAB section.
845 /// looked for in a section of type SHT_GNU_verdef. Otherwise, if
849 /// section of type SHT_GNU_verneed.
1119 /// section. Each function descriptor is a triplet of three
1136 /// .opd section (e.g because we are not on ppc64) or more generally
1155 // The section header of the .opd section.
1159 // section.
1168 // A pointer to the data of the .opd section, that we can actually
1305 /// Translate a section-relative symbol address (i.e, symbol value)
1307 /// section the symbol belongs to, to the address value.
1319 /// @return the section-relative address, translated into an
1345 /// Test if a given address is in a given section.
1349 /// @param section the section to consider.
1351 /// @return true iff @p addr is in section @p section.
1353 address_is_in_section(Dwarf_Addr addr, Elf_Scn* section)
1355 if (!section)
1359 GElf_Shdr* sheader = gelf_getshdr(section, &sheader_mem);
1367 /// Return true if an address is in the ".opd" section that is
1373 /// section.
1412 // Poke at the dynamic segment like a section, so that we can
1413 // get its section header information; also we'd like to read
1418 // access section data.
1427 // Get data of the dynamic segment (seen as a section).
1432 // Get the index of the section headers string table.
1451 // segment/section