Represents an ELF machine code symbol.

Synopsis

Declared in <llvm/MC/MCSymbolELF.h>

class MCSymbolELF
    : public MCSymbol

Base Classes

Name

Description

MCSymbol

Represents a symbol name in the MC file.

Member Functions

Name

Description

MCSymbolELF [constructor]

Construct an ELF symbol, optionally named, possibly as a temporary.

declareCommon

Declare this symbol as being 'common'.

dump

dump ‐ Print the value to stderr.

getBinding

Return the ELF symbol binding (STB_*).

getCommonAlignment

Return the alignment of a 'common' symbol.

getCommonSize

Return the size of a 'common' symbol.

getFragment

Get the fragment this symbol is associated with, resolving aliases.

getIndex

Get the (implementation defined) index.

getName

getName ‐ Get the symbol name.

getOffset

Get the byte offset of this regular symbol within its fragment.

getOther

Return the non‐visibility bits of the ELF st_other field (STO_*).

getSection

Get the section associated with a defined, non‐absolute symbol.

getSize

Return the expression that computes this symbol's size.

getType

Return the ELF symbol type (STT_*).

getVariableValue

Get the expression of the variable symbol.

getVisibility

Return the ELF symbol visibility (STV_*).

isAbsolute

isAbsolute ‐ Check if this is an absolute symbol.

isBindingSet

Return true if an explicit binding has been set.

isCommon

Is this a 'common' symbol.

isDefined

isDefined ‐ Check if this symbol is defined (i.e., it has an address).

isInSection

isInSection ‐ Check if this symbol is defined in some section (i.e., it is defined but not absolute).

isMemtag

Return true if this symbol is memory‐tagged.

isRedefinable

Check if this symbol is redefinable.

isRegistered

Return true if this symbol has been registered.

isResolving

Return whether this symbol is currently being resolved (cycle detection).

isSignature

Return true if this symbol is an ELF section group signature.

isTemporary

isTemporary ‐ Check if this is an assembler temporary symbol.

isUndefined

isUndefined ‐ Check if this symbol undefined (i.e., implicitly defined).

isUsedInReloc

Return true if a relocation has used this symbol.

isVariable

isVariable ‐ Check if this is a variable symbol.

isWeakExternal

Return true if this is a COFF weak‐external symbol.

isWeakref

Return true if this symbol is a .weakref alias.

print

print overloads

redefineIfPossible

Prepare this symbol to be redefined.

setBinding

Set the ELF symbol binding (STB_*).

setCommon

Mark this symbol as being 'common'.

setFragment

Mark the symbol as defined in the fragment F.

setIndex

Set the (implementation defined) index.

setIsRegistered

Set whether this symbol has been registered.

setIsResolving

Set whether this symbol is currently being resolved (cycle detection).

setIsSignature

Mark this symbol as an ELF section group signature.

setIsWeakref

Mark this symbol as a .weakref alias.

setMemtag

Set whether this symbol is memory‐tagged.

setOffset

Set the byte offset of this regular symbol within its fragment.

setOther

Set the non‐visibility bits of the ELF st_other field (STO_*).

setRedefinable

Mark this symbol as redefinable.

setSize

Set the expression that computes this symbol's size.

setType

Set the ELF symbol type (STT_*).

setUsedInReloc

Mark this symbol as used in a relocation.

setVariableValue

Set this symbol as a variable whose value is the given expression.

setVisibility

Set the ELF symbol visibility (STV_*).

Data Members

Name

Description

CommonSize [variant member]

The size of the symbol, if it is 'common'.

Offset [variant member]

The offset to apply to the fragment address to form this symbol's value.

Value [variant member]

If non‐null, the value for a variable symbol.

Protected Types

Name

Description

Unnamed union

Discriminated storage for offset, common size, or variable expression.

NameEntryStorageTy

Storage preceding an MCSymbol for an optional name entry.

Protected Type Aliases

Name

Description

NameEntryStorageTy

Storage preceding an MCSymbol for an optional name entry.

Protected Enums

Name

Description

Unnamed enum

Number of bits used to encode common‐symbol alignment.

Kind

Discriminator for how this symbol's value is represented.

Protected Member Functions

Name

Description

operator= [deleted]

Deleted copy assignment.

getFlags

Get the (implementation defined) symbol flags.

modifyFlags

Modify the flags via a mask.

operator new

Allocate an MCSymbol, optionally reserving space for a name entry.

setFlags

Set the (implementation defined) symbol flags.

Protected Data Members

Name

Description

CommonAlignLog2

The alignment of the symbol if it is 'common'.

Flags

Object‐file‐specific per‐symbol flags not easily classified elsewhere.

Fragment

Fragment or absolute sentinel that locates this symbol's value.

HasName

True if this symbol is named. A named symbol will have a pointer to the name allocated in the bytes immediately prior to the MCSymbol.

Index

Index field, for use by the object file implementation.

IsExternal

True if this symbol is visible outside this translation unit. Note: ELF uses binding instead of this bit.

IsPrivateExtern

Mach‐O specific: This symbol is private extern.

IsRedefinable

True if this symbol can be redefined.

IsRegistered

True if this symbol has been registered with the context/object writer.

IsResolving

Used to detect cyclic dependency like a = a + 1 and a = b; b = a.

IsTemporary

IsTemporary ‐ True if this is an assembler temporary label, which typically does not survive in the .o file's symbol table. Usually "Lfoo" or ".foo".

IsUsedInReloc

True if we have created a relocation that uses this symbol.

IsWeakExternal

This symbol is weak external.

kind

The symbol kind. Use an unsigned bitfield to achieve better bitpacking with MSVC.

Protected Static Data Members

Name

Description

AbsolutePseudoFragment

Sentinel fragment value used for absolute symbols.

Friends

Name

Description

llvm::MCAsmInfoELF

Target asm properties for ELF‐based targets.

Non-Member Functions

Name

Description

isRangeRelaxable

Return true if the distance between Begin and End may change at link time.

Created with MrDocs