Halide 21.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
Halide::Internal::Elf::Section Class Reference

Describes a section of an object file. More...

#include <Elf.h>

Public Types

enum  Type : uint32_t {
  SHT_NULL = 0 , SHT_PROGBITS = 1 , SHT_SYMTAB = 2 , SHT_STRTAB = 3 ,
  SHT_RELA = 4 , SHT_HASH = 5 , SHT_DYNAMIC = 6 , SHT_NOTE = 7 ,
  SHT_NOBITS = 8 , SHT_REL = 9 , SHT_SHLIB = 10 , SHT_DYNSYM = 11 ,
  SHT_LOPROC = 0x70000000u , SHT_HIPROC = 0x7fffffffu , SHT_LOUSER = 0x80000000u , SHT_HIUSER = 0xffffffffu
}
enum  Flag : uint32_t { SHF_WRITE = 0x1 , SHF_ALLOC = 0x2 , SHF_EXECINSTR = 0x4 , SHF_MASKPROC = 0xf0000000u }
typedef std::vector< RelocationRelocationList
typedef RelocationList::iterator relocation_iterator
typedef RelocationList::const_iterator const_relocation_iterator
typedef std::vector< char >::iterator contents_iterator
typedef std::vector< char >::const_iterator const_contents_iterator

Public Member Functions

 Section ()=default
 Section (const std::string &name, Type type)
Sectionset_name (const std::string &name)
const std::string & get_name () const
Sectionset_type (Type type)
Type get_type () const
Sectionset_flag (Flag flag)
Sectionremove_flag (Flag flag)
Sectionset_flags (uint32_t flags)
uint32_t get_flags () const
bool is_alloc () const
bool is_writable () const
Sectionset_alignment (uint64_t alignment)
uint64_t get_alignment () const
Sectionset_contents (std::vector< char > contents)
template<typename It>
Sectionset_contents (It begin, It end)
template<typename It>
Sectionappend_contents (It begin, It end)
template<typename It>
Sectionprepend_contents (It begin, It end)
template<typename T>
Sectionset_contents (const std::vector< T > &contents)
 Set, append or prepend an object to the contents, assuming T is a trivially copyable datatype.
template<typename T>
Sectionappend_contents (const T &x)
template<typename T>
Sectionprepend_contents (const T &x)
const std::vector< char > & get_contents () const
contents_iterator contents_begin ()
contents_iterator contents_end ()
const_contents_iterator contents_begin () const
const_contents_iterator contents_end () const
const char * contents_data () const
size_t contents_size () const
bool contents_empty () const
Sectionset_relocations (std::vector< Relocation > relocs)
template<typename It>
Sectionset_relocations (It begin, It end)
void add_relocation (const Relocation &reloc)
relocation_iterator relocations_begin ()
relocation_iterator relocations_end ()
iterator_range< relocation_iteratorrelocations ()
const_relocation_iterator relocations_begin () const
const_relocation_iterator relocations_end () const
iterator_range< const_relocation_iteratorrelocations () const
size_t relocations_size () const
Sectionset_size (uint64_t size)
 Get or set the size of the section.
uint64_t get_size () const
 Get or set the size of the section.

Detailed Description

Describes a section of an object file.

Definition at line 214 of file Elf.h.

Member Typedef Documentation

◆ RelocationList

Definition at line 242 of file Elf.h.

◆ relocation_iterator

typedef RelocationList::iterator Halide::Internal::Elf::Section::relocation_iterator

Definition at line 243 of file Elf.h.

◆ const_relocation_iterator

typedef RelocationList::const_iterator Halide::Internal::Elf::Section::const_relocation_iterator

Definition at line 244 of file Elf.h.

◆ contents_iterator

typedef std::vector<char>::iterator Halide::Internal::Elf::Section::contents_iterator

Definition at line 246 of file Elf.h.

◆ const_contents_iterator

typedef std::vector<char>::const_iterator Halide::Internal::Elf::Section::const_contents_iterator

Definition at line 247 of file Elf.h.

Member Enumeration Documentation

◆ Type

Enumerator
SHT_NULL 
SHT_PROGBITS 
SHT_SYMTAB 
SHT_STRTAB 
SHT_RELA 
SHT_HASH 
SHT_DYNAMIC 
SHT_NOTE 
SHT_NOBITS 
SHT_REL 
SHT_SHLIB 
SHT_DYNSYM 
SHT_LOPROC 
SHT_HIPROC 
SHT_LOUSER 
SHT_HIUSER 

Definition at line 216 of file Elf.h.

◆ Flag

Enumerator
SHF_WRITE 
SHF_ALLOC 
SHF_EXECINSTR 
SHF_MASKPROC 

Definition at line 235 of file Elf.h.

Constructor & Destructor Documentation

◆ Section() [1/2]

◆ Section() [2/2]

Halide::Internal::Elf::Section::Section ( const std::string & name,
Type type )
inline

Definition at line 261 of file Elf.h.

Member Function Documentation

◆ set_name()

Section & Halide::Internal::Elf::Section::set_name ( const std::string & name)
inline

Definition at line 265 of file Elf.h.

References Section().

◆ get_name()

const std::string & Halide::Internal::Elf::Section::get_name ( ) const
inline

Definition at line 269 of file Elf.h.

◆ set_type()

Section & Halide::Internal::Elf::Section::set_type ( Type type)
inline

Definition at line 273 of file Elf.h.

References Section().

◆ get_type()

Type Halide::Internal::Elf::Section::get_type ( ) const
inline

Definition at line 277 of file Elf.h.

◆ set_flag()

Section & Halide::Internal::Elf::Section::set_flag ( Flag flag)
inline

Definition at line 281 of file Elf.h.

References Section().

◆ remove_flag()

Section & Halide::Internal::Elf::Section::remove_flag ( Flag flag)
inline

Definition at line 285 of file Elf.h.

References Section().

◆ set_flags()

Section & Halide::Internal::Elf::Section::set_flags ( uint32_t flags)
inline

Definition at line 289 of file Elf.h.

References Section().

◆ get_flags()

uint32_t Halide::Internal::Elf::Section::get_flags ( ) const
inline

Definition at line 293 of file Elf.h.

◆ is_alloc()

bool Halide::Internal::Elf::Section::is_alloc ( ) const
inline

Definition at line 296 of file Elf.h.

References SHF_ALLOC.

◆ is_writable()

bool Halide::Internal::Elf::Section::is_writable ( ) const
inline

Definition at line 299 of file Elf.h.

References SHF_WRITE.

◆ set_size()

Section & Halide::Internal::Elf::Section::set_size ( uint64_t size)
inline

Get or set the size of the section.

The size may be larger than the content.

Definition at line 306 of file Elf.h.

References Section().

◆ get_size()

uint64_t Halide::Internal::Elf::Section::get_size ( ) const
inline

Get or set the size of the section.

The size may be larger than the content.

Definition at line 310 of file Elf.h.

◆ set_alignment()

Section & Halide::Internal::Elf::Section::set_alignment ( uint64_t alignment)
inline

Definition at line 315 of file Elf.h.

References Section().

◆ get_alignment()

uint64_t Halide::Internal::Elf::Section::get_alignment ( ) const
inline

Definition at line 319 of file Elf.h.

◆ set_contents() [1/3]

Section & Halide::Internal::Elf::Section::set_contents ( std::vector< char > contents)
inline

Definition at line 323 of file Elf.h.

References Section().

◆ set_contents() [2/3]

template<typename It>
Section & Halide::Internal::Elf::Section::set_contents ( It begin,
It end )
inline

Definition at line 328 of file Elf.h.

References Halide::Internal::begin(), Halide::Internal::end(), and Section().

◆ append_contents() [1/2]

template<typename It>
Section & Halide::Internal::Elf::Section::append_contents ( It begin,
It end )
inline

Definition at line 333 of file Elf.h.

References Halide::Internal::begin(), Halide::Internal::end(), and Section().

Referenced by append_contents().

◆ prepend_contents() [1/2]

template<typename It>
Section & Halide::Internal::Elf::Section::prepend_contents ( It begin,
It end )
inline

Definition at line 338 of file Elf.h.

References Halide::Internal::begin(), Halide::Internal::end(), relocations(), and Section().

Referenced by prepend_contents().

◆ set_contents() [3/3]

template<typename T>
Section & Halide::Internal::Elf::Section::set_contents ( const std::vector< T > & contents)
inline

Set, append or prepend an object to the contents, assuming T is a trivially copyable datatype.

Definition at line 354 of file Elf.h.

References Section().

◆ append_contents() [2/2]

template<typename T>
Section & Halide::Internal::Elf::Section::append_contents ( const T & x)
inline

Definition at line 359 of file Elf.h.

References append_contents(), and Section().

◆ prepend_contents() [2/2]

template<typename T>
Section & Halide::Internal::Elf::Section::prepend_contents ( const T & x)
inline

Definition at line 363 of file Elf.h.

References prepend_contents(), and Section().

◆ get_contents()

const std::vector< char > & Halide::Internal::Elf::Section::get_contents ( ) const
inline

Definition at line 366 of file Elf.h.

◆ contents_begin() [1/2]

contents_iterator Halide::Internal::Elf::Section::contents_begin ( )
inline

Definition at line 369 of file Elf.h.

◆ contents_end() [1/2]

contents_iterator Halide::Internal::Elf::Section::contents_end ( )
inline

Definition at line 372 of file Elf.h.

◆ contents_begin() [2/2]

const_contents_iterator Halide::Internal::Elf::Section::contents_begin ( ) const
inline

Definition at line 375 of file Elf.h.

◆ contents_end() [2/2]

const_contents_iterator Halide::Internal::Elf::Section::contents_end ( ) const
inline

Definition at line 378 of file Elf.h.

◆ contents_data()

const char * Halide::Internal::Elf::Section::contents_data ( ) const
inline

Definition at line 381 of file Elf.h.

◆ contents_size()

size_t Halide::Internal::Elf::Section::contents_size ( ) const
inline

Definition at line 384 of file Elf.h.

◆ contents_empty()

bool Halide::Internal::Elf::Section::contents_empty ( ) const
inline

Definition at line 387 of file Elf.h.

◆ set_relocations() [1/2]

Section & Halide::Internal::Elf::Section::set_relocations ( std::vector< Relocation > relocs)
inline

Definition at line 391 of file Elf.h.

References Section().

◆ set_relocations() [2/2]

template<typename It>
Section & Halide::Internal::Elf::Section::set_relocations ( It begin,
It end )
inline

Definition at line 396 of file Elf.h.

References Halide::Internal::begin(), Halide::Internal::end(), and Section().

◆ add_relocation()

void Halide::Internal::Elf::Section::add_relocation ( const Relocation & reloc)
inline

Definition at line 400 of file Elf.h.

◆ relocations_begin() [1/2]

relocation_iterator Halide::Internal::Elf::Section::relocations_begin ( )
inline

Definition at line 403 of file Elf.h.

◆ relocations_end() [1/2]

relocation_iterator Halide::Internal::Elf::Section::relocations_end ( )
inline

Definition at line 406 of file Elf.h.

◆ relocations() [1/2]

iterator_range< relocation_iterator > Halide::Internal::Elf::Section::relocations ( )
inline

Definition at line 409 of file Elf.h.

Referenced by prepend_contents().

◆ relocations_begin() [2/2]

const_relocation_iterator Halide::Internal::Elf::Section::relocations_begin ( ) const
inline

Definition at line 412 of file Elf.h.

◆ relocations_end() [2/2]

const_relocation_iterator Halide::Internal::Elf::Section::relocations_end ( ) const
inline

Definition at line 415 of file Elf.h.

◆ relocations() [2/2]

iterator_range< const_relocation_iterator > Halide::Internal::Elf::Section::relocations ( ) const
inline

Definition at line 418 of file Elf.h.

◆ relocations_size()

size_t Halide::Internal::Elf::Section::relocations_size ( ) const
inline

Definition at line 421 of file Elf.h.


The documentation for this class was generated from the following file: