LLVM 22.0.0git
llvm::object::SymbolRef Class Reference

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

#include "llvm/Object/ObjectFile.h"

Inheritance diagram for llvm::object::SymbolRef:
[legend]

Public Types

enum  Type {
  ST_Unknown , ST_Other , ST_Data , ST_Debug ,
  ST_File , ST_Function
}
Public Types inherited from llvm::object::BasicSymbolRef
enum  Flags : unsigned {
  SF_None = 0 , SF_Undefined = 1U << 0 , SF_Global = 1U << 1 , SF_Weak = 1U << 2 ,
  SF_Absolute = 1U << 3 , SF_Common = 1U << 4 , SF_Indirect = 1U << 5 , SF_Exported = 1U << 6 ,
  SF_FormatSpecific = 1U << 7 , SF_Thumb = 1U << 8 , SF_Hidden = 1U << 9 , SF_Const = 1U << 10 ,
  SF_Executable = 1U << 11
}

Public Member Functions

 SymbolRef ()=default
 SymbolRef (DataRefImpl SymbolP, const ObjectFile *Owner)
 SymbolRef (const BasicSymbolRef &B)
Expected< StringRefgetName () const
Expected< uint64_tgetAddress () const
 Returns the symbol virtual address (i.e.
Expected< uint64_tgetValue () const
 Return the value of the symbol depending on the object this can be an offset or a virtual address.
uint32_t getAlignment () const
 Get the alignment of this symbol as the actual value (not log 2).
uint64_t getCommonSize () const
Expected< SymbolRef::TypegetType () const
Expected< section_iteratorgetSection () const
 Get section this symbol is defined in reference to.
const ObjectFilegetObject () const
Public Member Functions inherited from llvm::object::BasicSymbolRef
 BasicSymbolRef ()=default
 BasicSymbolRef (DataRefImpl SymbolP, const SymbolicFile *Owner)
bool operator== (const BasicSymbolRef &Other) const
bool operator< (const BasicSymbolRef &Other) const
void moveNext ()
Error printName (raw_ostream &OS) const
Expected< uint32_tgetFlags () const
 Get symbol flags (bitwise OR of SymbolRef::Flags)
DataRefImpl getRawDataRefImpl () const
const SymbolicFilegetObject () const

Friends

class SectionRef

Detailed Description

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

Definition at line 170 of file ObjectFile.h.

Member Enumeration Documentation

◆ Type

Enumerator
ST_Unknown 
ST_Other 
ST_Data 
ST_Debug 
ST_File 
ST_Function 

Definition at line 174 of file ObjectFile.h.

Constructor & Destructor Documentation

◆ SymbolRef() [1/3]

◆ SymbolRef() [2/3]

llvm::object::SymbolRef::SymbolRef ( DataRefImpl SymbolP,
const ObjectFile * Owner )
inline

Definition at line 462 of file ObjectFile.h.

References llvm::object::BasicSymbolRef::BasicSymbolRef().

◆ SymbolRef() [3/3]

llvm::object::SymbolRef::SymbolRef ( const BasicSymbolRef & B)
inline

Member Function Documentation

◆ getAddress()

Expected< uint64_t > llvm::object::SymbolRef::getAddress ( ) const
inline

Returns the symbol virtual address (i.e.

address at which it will be mapped).

Definition at line 469 of file ObjectFile.h.

References getObject(), llvm::object::BasicSymbolRef::getRawDataRefImpl(), and llvm::object::ObjectFile::getSymbolAddress().

Referenced by llvm::getOffset(), getSymbolInfo(), llvm::object::XCOFFSymbolRef::isFunction(), and llvm::jitlink::printSymbolEntry().

◆ getAlignment()

uint32_t llvm::object::SymbolRef::getAlignment ( ) const
inline

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

Definition at line 477 of file ObjectFile.h.

References getObject(), llvm::object::BasicSymbolRef::getRawDataRefImpl(), and llvm::object::ObjectFile::getSymbolAlignment().

◆ getCommonSize()

uint64_t llvm::object::SymbolRef::getCommonSize ( ) const
inline

◆ getName()

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

◆ getObject()

◆ getSection()

Expected< section_iterator > llvm::object::SymbolRef::getSection ( ) const
inline

Get section this symbol is defined in reference to.

Result is section_end() if it is undefined or is an absolute symbol.

Definition at line 485 of file ObjectFile.h.

References getObject(), llvm::object::BasicSymbolRef::getRawDataRefImpl(), and llvm::object::ObjectFile::getSymbolSection().

Referenced by llvm::object::SectionRef::containsSymbol(), llvm::RuntimeDyldCOFFThumb::getJITSymbolFlags(), and getSymbolInfo().

◆ getType()

Expected< SymbolRef::Type > llvm::object::SymbolRef::getType ( ) const
inline

◆ getValue()

Expected< uint64_t > llvm::object::SymbolRef::getValue ( ) const
inline

Return the value of the symbol depending on the object this can be an offset or a virtual address.

Definition at line 473 of file ObjectFile.h.

References getObject(), llvm::object::BasicSymbolRef::getRawDataRefImpl(), and llvm::object::ObjectFile::getSymbolValue().

Referenced by llvm::object::computeSymbolSizes(), and llvm::RuntimeDyldCOFF::getSymbolOffset().

◆ SectionRef

friend class SectionRef
friend

Definition at line 171 of file ObjectFile.h.

References SectionRef.

Referenced by SectionRef.


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