LLVM  14.0.0git
Public Member Functions | Friends | List of all members
llvm::object::SectionRef Class Reference

This is a value type class that represents a single section in the list of sections in the object file. More...

#include "llvm/Object/ObjectFile.h"

Inheritance diagram for llvm::object::SectionRef:
Inheritance graph
[legend]

Public Member Functions

 SectionRef ()=default
 
 SectionRef (DataRefImpl SectionP, const ObjectFile *Owner)
 SectionRef. More...
 
bool operator== (const SectionRef &Other) const
 
bool operator!= (const SectionRef &Other) const
 
bool operator< (const SectionRef &Other) const
 
void moveNext ()
 
Expected< StringRefgetName () const
 
uint64_t getAddress () const
 
uint64_t getIndex () const
 
uint64_t getSize () const
 
Expected< StringRefgetContents () const
 
uint64_t getAlignment () const
 Get the alignment of this section as the actual value (not log 2). More...
 
bool isCompressed () const
 
bool isText () const
 Whether this section contains instructions. More...
 
bool isData () const
 Whether this section contains data, not instructions. More...
 
bool isBSS () const
 Whether this section contains BSS uninitialized data. More...
 
bool isVirtual () const
 
bool isBitcode () const
 
bool isStripped () const
 
bool isBerkeleyText () const
 Whether this section will be placed in the text segment, according to the Berkeley size format. More...
 
bool isBerkeleyData () const
 Whether this section will be placed in the data segment, according to the Berkeley size format. More...
 
bool isDebugSection () const
 Whether this section is a debug section. More...
 
bool containsSymbol (SymbolRef S) const
 
relocation_iterator relocation_begin () const
 
relocation_iterator relocation_end () const
 
iterator_range< relocation_iteratorrelocations () const
 
Expected< section_iteratorgetRelocatedSection () const
 Returns the related section if this section contains relocations. More...
 
DataRefImpl getRawDataRefImpl () const
 
const ObjectFilegetObject () const
 

Friends

class SymbolRef
 

Detailed Description

This is a value type class that represents a single section in the list of sections in the object file.

Definition at line 79 of file ObjectFile.h.

Constructor & Destructor Documentation

◆ SectionRef() [1/2]

llvm::object::SectionRef::SectionRef ( )
default

◆ SectionRef() [2/2]

llvm::object::SectionRef::SectionRef ( DataRefImpl  SectionP,
const ObjectFile Owner 
)
inline

SectionRef.

Definition at line 422 of file ObjectFile.h.

Member Function Documentation

◆ containsSymbol()

bool SectionRef::containsSymbol ( SymbolRef  S) const

Definition at line 47 of file ObjectFile.cpp.

References llvm::consumeError(), S, and llvm::Expected< T >::takeError().

◆ getAddress()

uint64_t llvm::object::SectionRef::getAddress ( ) const
inline

◆ getAlignment()

uint64_t llvm::object::SectionRef::getAlignment ( ) const
inline

Get the alignment of this section as the actual value (not log 2).

Definition at line 469 of file ObjectFile.h.

References llvm::object::ObjectFile::getSectionAlignment().

◆ getContents()

Expected< StringRef > llvm::object::SectionRef::getContents ( ) const
inline

◆ getIndex()

uint64_t llvm::object::SectionRef::getIndex ( ) const
inline

Definition at line 453 of file ObjectFile.h.

References llvm::object::ObjectFile::getSectionIndex().

◆ getName()

Expected< StringRef > llvm::object::SectionRef::getName ( ) const
inline

Definition at line 445 of file ObjectFile.h.

References llvm::object::ObjectFile::getSectionName().

◆ getObject()

const ObjectFile * llvm::object::SectionRef::getObject ( ) const
inline

◆ getRawDataRefImpl()

DataRefImpl llvm::object::SectionRef::getRawDataRefImpl ( ) const
inline

◆ getRelocatedSection()

Expected< section_iterator > llvm::object::SectionRef::getRelocatedSection ( ) const
inline

Returns the related section if this section contains relocations.

The returned section may or may not have applied its relocations.

Definition at line 521 of file ObjectFile.h.

References llvm::object::ObjectFile::getRelocatedSection().

◆ getSize()

uint64_t llvm::object::SectionRef::getSize ( ) const
inline

Definition at line 457 of file ObjectFile.h.

References llvm::object::ObjectFile::getSectionSize().

◆ isBerkeleyData()

bool llvm::object::SectionRef::isBerkeleyData ( ) const
inline

Whether this section will be placed in the data segment, according to the Berkeley size format.

This is true if the section is allocatable and contains data (e.g. PROGBITS), but is not text.

Definition at line 505 of file ObjectFile.h.

References llvm::object::ObjectFile::isBerkeleyData().

◆ isBerkeleyText()

bool llvm::object::SectionRef::isBerkeleyText ( ) const
inline

Whether this section will be placed in the text segment, according to the Berkeley size format.

This is true if the section is allocatable, and contains either code or readonly data.

Definition at line 501 of file ObjectFile.h.

References llvm::object::ObjectFile::isBerkeleyText().

◆ isBitcode()

bool llvm::object::SectionRef::isBitcode ( ) const
inline

Definition at line 493 of file ObjectFile.h.

References llvm::object::ObjectFile::isSectionBitcode().

◆ isBSS()

bool llvm::object::SectionRef::isBSS ( ) const
inline

Whether this section contains BSS uninitialized data.

Definition at line 485 of file ObjectFile.h.

References llvm::object::ObjectFile::isSectionBSS().

◆ isCompressed()

bool llvm::object::SectionRef::isCompressed ( ) const
inline

Definition at line 473 of file ObjectFile.h.

References llvm::object::ObjectFile::isSectionCompressed().

◆ isData()

bool llvm::object::SectionRef::isData ( ) const
inline

Whether this section contains data, not instructions.

Definition at line 481 of file ObjectFile.h.

References llvm::object::ObjectFile::isSectionData().

◆ isDebugSection()

bool llvm::object::SectionRef::isDebugSection ( ) const
inline

Whether this section is a debug section.

Definition at line 509 of file ObjectFile.h.

References llvm::object::ObjectFile::isDebugSection().

◆ isStripped()

bool llvm::object::SectionRef::isStripped ( ) const
inline

Definition at line 497 of file ObjectFile.h.

References llvm::object::ObjectFile::isSectionStripped().

◆ isText()

bool llvm::object::SectionRef::isText ( ) const
inline

Whether this section contains instructions.

Definition at line 477 of file ObjectFile.h.

References llvm::object::ObjectFile::isSectionText().

Referenced by llvm::RuntimeDyldMachO::getRelocationValueRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().

◆ isVirtual()

bool llvm::object::SectionRef::isVirtual ( ) const
inline

Definition at line 489 of file ObjectFile.h.

References llvm::object::ObjectFile::isSectionVirtual().

◆ moveNext()

void llvm::object::SectionRef::moveNext ( )
inline

Definition at line 441 of file ObjectFile.h.

References llvm::object::ObjectFile::moveSectionNext().

◆ operator!=()

bool llvm::object::SectionRef::operator!= ( const SectionRef Other) const
inline

Definition at line 432 of file ObjectFile.h.

References Other.

◆ operator<()

bool llvm::object::SectionRef::operator< ( const SectionRef Other) const
inline

Definition at line 436 of file ObjectFile.h.

References assert(), and Other.

◆ operator==()

bool llvm::object::SectionRef::operator== ( const SectionRef Other) const
inline

Definition at line 427 of file ObjectFile.h.

References Other.

◆ relocation_begin()

relocation_iterator llvm::object::SectionRef::relocation_begin ( ) const
inline

Definition at line 513 of file ObjectFile.h.

References llvm::object::ObjectFile::section_rel_begin().

Referenced by relocations().

◆ relocation_end()

relocation_iterator llvm::object::SectionRef::relocation_end ( ) const
inline

Definition at line 517 of file ObjectFile.h.

References llvm::object::ObjectFile::section_rel_end().

Referenced by relocations().

◆ relocations()

iterator_range<relocation_iterator> llvm::object::SectionRef::relocations ( ) const
inline

Definition at line 131 of file ObjectFile.h.

References llvm::make_range(), relocation_begin(), and relocation_end().

Friends And Related Function Documentation

◆ SymbolRef

friend class SymbolRef
friend

Definition at line 80 of file ObjectFile.h.


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