Halide
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 = 0x70000000, SHT_HIPROC = 0x7fffffff, SHT_LOUSER = 0x80000000, SHT_HIUSER = 0xffffffff
}
 
enum  Flag : uint32_t { SHF_WRITE = 0x1, SHF_ALLOC = 0x2, SHF_EXECINSTR = 0x4, SHF_MASKPROC = 0xf0000000 }
 
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. More...
 
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. More...
 
uint64_t get_size () const
 Get or set the size of the section. More...
 

Detailed Description

Describes a section of an object file.

Definition at line 213 of file Elf.h.

Member Typedef Documentation

◆ RelocationList

Definition at line 241 of file Elf.h.

◆ relocation_iterator

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

Definition at line 242 of file Elf.h.

◆ const_relocation_iterator

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

Definition at line 243 of file Elf.h.

◆ contents_iterator

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

Definition at line 245 of file Elf.h.

◆ const_contents_iterator

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

Definition at line 246 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 215 of file Elf.h.

◆ Flag

Enumerator
SHF_WRITE 
SHF_ALLOC 
SHF_EXECINSTR 
SHF_MASKPROC 

Definition at line 234 of file Elf.h.

Constructor & Destructor Documentation

◆ Section() [1/2]

Halide::Internal::Elf::Section::Section ( )
default

◆ Section() [2/2]

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

Definition at line 260 of file Elf.h.

Member Function Documentation

◆ set_name()

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

Definition at line 264 of file Elf.h.

◆ get_name()

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

Definition at line 268 of file Elf.h.

◆ set_type()

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

Definition at line 272 of file Elf.h.

◆ get_type()

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

Definition at line 276 of file Elf.h.

◆ set_flag()

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

Definition at line 280 of file Elf.h.

◆ remove_flag()

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

Definition at line 284 of file Elf.h.

◆ set_flags()

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

Definition at line 288 of file Elf.h.

◆ get_flags()

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

Definition at line 292 of file Elf.h.

◆ is_alloc()

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

Definition at line 295 of file Elf.h.

References SHF_ALLOC.

◆ is_writable()

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

Definition at line 298 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 305 of file Elf.h.

◆ 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 309 of file Elf.h.

References Halide::max().

◆ set_alignment()

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

Definition at line 314 of file Elf.h.

◆ get_alignment()

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

Definition at line 318 of file Elf.h.

◆ set_contents() [1/3]

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

Definition at line 322 of file Elf.h.

◆ set_contents() [2/3]

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

Definition at line 327 of file Elf.h.

◆ append_contents() [1/2]

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

Definition at line 332 of file Elf.h.

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 337 of file Elf.h.

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 353 of file Elf.h.

◆ append_contents() [2/2]

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

Definition at line 358 of file Elf.h.

References append_contents().

◆ prepend_contents() [2/2]

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

Definition at line 362 of file Elf.h.

References prepend_contents().

◆ get_contents()

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

Definition at line 365 of file Elf.h.

◆ contents_begin() [1/2]

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

Definition at line 368 of file Elf.h.

◆ contents_end() [1/2]

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

Definition at line 371 of file Elf.h.

◆ contents_begin() [2/2]

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

Definition at line 374 of file Elf.h.

◆ contents_end() [2/2]

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

Definition at line 377 of file Elf.h.

◆ contents_data()

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

Definition at line 380 of file Elf.h.

◆ contents_size()

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

Definition at line 383 of file Elf.h.

◆ contents_empty()

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

Definition at line 386 of file Elf.h.

◆ set_relocations() [1/2]

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

Definition at line 390 of file Elf.h.

◆ set_relocations() [2/2]

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

Definition at line 395 of file Elf.h.

◆ add_relocation()

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

Definition at line 399 of file Elf.h.

◆ relocations_begin() [1/2]

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

Definition at line 402 of file Elf.h.

◆ relocations_end() [1/2]

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

Definition at line 405 of file Elf.h.

◆ relocations() [1/2]

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

Definition at line 408 of file Elf.h.

◆ relocations_begin() [2/2]

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

Definition at line 411 of file Elf.h.

◆ relocations_end() [2/2]

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

Definition at line 414 of file Elf.h.

◆ relocations() [2/2]

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

Definition at line 417 of file Elf.h.

◆ relocations_size()

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

Definition at line 420 of file Elf.h.


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