rocm.bindings.llvm.c.object

Contents

rocm.bindings.llvm.c.object#

2026-09-24

13 min read time

Applies to Linux and Windows

Advanced Micro Devices, Inc.

Attributes#

Classes#

LLVMOpaqueSectionIterator

(No short description)

LLVMOpaqueSymbolIterator

(No short description)

LLVMOpaqueRelocationIterator

(No short description)

LLVMBinaryType

(No short description)

LLVMOpaqueObjectFile

(No short description)

Functions#

has_symbol(→ bool)

LLVMCreateBinary(MemBuf, Context, ErrorMessage)

Create a binary file from the given memory buffer.

LLVMDisposeBinary(BR)

Dispose of a binary file.

LLVMBinaryCopyMemoryBuffer(BR)

Retrieves a copy of the memory buffer associated with this object file.

LLVMBinaryGetType(BR)

Retrieve the specific type of a binary.

LLVMMachOUniversalBinaryCopyObjectForArch(BR, Arch, ...)

For a Mach-O universal binary file, retrieves the object file corresponding

LLVMObjectFileCopySectionIterator(BR)

Retrieve a copy of the section iterator for this object file.

LLVMObjectFileIsSectionIteratorAtEnd(BR, SI)

Returns whether the given section iterator is at the end.

LLVMObjectFileCopySymbolIterator(BR)

Retrieve a copy of the symbol iterator for this object file.

LLVMObjectFileIsSymbolIteratorAtEnd(BR, SI)

Returns whether the given symbol iterator is at the end.

LLVMDisposeSectionIterator(SI)

Returns whether the given symbol iterator is at the end.

LLVMMoveToNextSection(SI)

Returns whether the given symbol iterator is at the end.

LLVMMoveToContainingSection(Sect, Sym)

Returns whether the given symbol iterator is at the end.

LLVMDisposeSymbolIterator(SI)

// ObjectFile Symbol iterators

LLVMMoveToNextSymbol(SI)

// ObjectFile Symbol iterators

LLVMGetSectionName(SI)

// SectionRef accessors

LLVMGetSectionSize(SI)

// SectionRef accessors

LLVMGetSectionContents(SI)

// SectionRef accessors

LLVMGetSectionAddress(SI)

// SectionRef accessors

LLVMGetSectionContainsSymbol(SI, Sym)

// SectionRef accessors

LLVMGetRelocations(Section)

// Section Relocation iterators

LLVMDisposeRelocationIterator(RI)

// Section Relocation iterators

LLVMIsRelocationIteratorAtEnd(Section, RI)

// Section Relocation iterators

LLVMMoveToNextRelocation(RI)

// Section Relocation iterators

LLVMGetSymbolName(SI)

// SymbolRef accessors

LLVMGetSymbolAddress(SI)

// SymbolRef accessors

LLVMGetSymbolSize(SI)

// SymbolRef accessors

LLVMGetRelocationOffset(RI)

// RelocationRef accessors

LLVMGetRelocationSymbol(RI)

// RelocationRef accessors

LLVMGetRelocationType(RI)

// RelocationRef accessors

LLVMGetRelocationTypeName(RI)

// following functions.

LLVMGetRelocationValueString(RI)

// following functions.

LLVMCreateObjectFile(MemBuf)

Deprecated: Use LLVMCreateBinary instead.

LLVMDisposeObjectFile(ObjectFile)

Deprecated: Use LLVMDisposeBinary instead.

LLVMGetSections(ObjectFile)

Deprecated: Use LLVMObjectFileCopySectionIterator instead.

LLVMIsSectionIteratorAtEnd(ObjectFile, SI)

Deprecated: Use LLVMObjectFileIsSectionIteratorAtEnd instead.

LLVMGetSymbols(ObjectFile)

Deprecated: Use LLVMObjectFileCopySymbolIterator instead.

LLVMIsSymbolIteratorAtEnd(ObjectFile, SI)

Deprecated: Use LLVMObjectFileIsSymbolIteratorAtEnd instead.

Module Contents#

rocm.bindings.llvm.c.object.has_symbol(name: str | bytes | bytearray) → bool#
class rocm.bindings.llvm.c.object.LLVMOpaqueSectionIterator(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.object.LLVMSectionIteratorRef#
class rocm.bindings.llvm.c.object.LLVMOpaqueSymbolIterator(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.object.LLVMSymbolIteratorRef#
class rocm.bindings.llvm.c.object.LLVMOpaqueRelocationIterator(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.object.LLVMRelocationIteratorRef#
class rocm.bindings.llvm.c.object.LLVMBinaryType#

Bases: enum.IntEnum

(No short description)

LLVMBinaryTypeArchive: int#
LLVMBinaryTypeMachOUniversalBinary: int#
LLVMBinaryTypeCOFFImportFile: int#
LLVMBinaryTypeIR: int#
LLVMBinaryTypeWinRes: int#
LLVMBinaryTypeCOFF: int#
LLVMBinaryTypeELF32L: int#
LLVMBinaryTypeELF32B: int#
LLVMBinaryTypeELF64L: int#
LLVMBinaryTypeELF64B: int#
LLVMBinaryTypeMachO32L: int#
LLVMBinaryTypeMachO32B: int#
LLVMBinaryTypeMachO64L: int#
LLVMBinaryTypeMachO64B: int#
LLVMBinaryTypeWasm: int#
LLVMBinaryTypeOffload: int#
LLVMBinaryTypeDXcontainer: int#
rocm.bindings.llvm.c.object.LLVMCreateBinary(MemBuf, Context, ErrorMessage)#

Create a binary file from the given memory buffer.

The exact type of the binary file will be inferred automatically, and the appropriate implementation selected. The context may be NULL except if the resulting file is an LLVM IR file.

The memory buffer is not consumed by this function. It is the responsibility of the caller to free it with LLVMDisposeMemoryBuffer.

If NULL is returned, the ErrorMessage parameter is populated with the error’s description. It is then the caller’s responsibility to free this message by calling LLVMDisposeMessage.

See:

llvm::object::createBinary

Args:
MemBuf (Pointer/object):

(undocumented)

Context (Pointer/object):

(undocumented)

ErrorMessage (Pointer/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf, LLVMContextRef Context, char ** ErrorMessage)
rocm.bindings.llvm.c.object.LLVMDisposeBinary(BR)#

Dispose of a binary file.

The binary file does not own its backing buffer. It is the responsibility of the caller to free it with LLVMDisposeMemoryBuffer.

Args:
BR (Pointer/object):

(undocumented)

C signature

void LLVMDisposeBinary(LLVMBinaryRef BR)
rocm.bindings.llvm.c.object.LLVMBinaryCopyMemoryBuffer(BR)#

Retrieves a copy of the memory buffer associated with this object file.

The returned buffer is merely a shallow copy and does not own the actual backing buffer of the binary. Nevertheless, it is the responsibility of the caller to free it with LLVMDisposeMemoryBuffer.

See:

llvm::object::getMemoryBufferRef

Args:
BR (Pointer/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMMemoryBufferRef LLVMBinaryCopyMemoryBuffer(LLVMBinaryRef BR)
rocm.bindings.llvm.c.object.LLVMBinaryGetType(BR)#

Retrieve the specific type of a binary.

See:

llvm::object::Binary::getType

Args:
BR (Pointer/object):

(undocumented)

Returns:

LLVMBinaryType: (undocumented)

C signature

LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR)
rocm.bindings.llvm.c.object.LLVMMachOUniversalBinaryCopyObjectForArch(BR, Arch, ArchLen, ErrorMessage)#

For a Mach-O universal binary file, retrieves the object file corresponding to the given architecture if it is present as a slice.

If NULL is returned, the ErrorMessage parameter is populated with the error’s description. It is then the caller’s responsibility to free this message by calling LLVMDisposeMessage.

It is the responsiblity of the caller to free the returned object file by calling LLVMDisposeBinary.

Args:
BR (Pointer/object):

(undocumented)

Arch (CStr/object):

(undocumented)

ArchLen (int):

(undocumented)

ErrorMessage (Pointer/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMBinaryRef LLVMMachOUniversalBinaryCopyObjectForArch(LLVMBinaryRef BR, const char * Arch, size_t ArchLen, char ** ErrorMessage)
rocm.bindings.llvm.c.object.LLVMObjectFileCopySectionIterator(BR)#

Retrieve a copy of the section iterator for this object file.

If there are no sections, the result is NULL.

The returned iterator is merely a shallow copy. Nevertheless, it is the responsibility of the caller to free it with LLVMDisposeSectionIterator.

See:

llvm::object::sections()

Args:
BR (Pointer/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMSectionIteratorRef LLVMObjectFileCopySectionIterator(LLVMBinaryRef BR)
rocm.bindings.llvm.c.object.LLVMObjectFileIsSectionIteratorAtEnd(BR, SI)#

Returns whether the given section iterator is at the end.

See:

llvm::object::section_end

Args:
BR (Pointer/object):

(undocumented)

SI (LLVMOpaqueSectionIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR, LLVMSectionIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMObjectFileCopySymbolIterator(BR)#

Retrieve a copy of the symbol iterator for this object file.

If there are no symbols, the result is NULL.

The returned iterator is merely a shallow copy. Nevertheless, it is the responsibility of the caller to free it with LLVMDisposeSymbolIterator.

See:

llvm::object::symbols()

Args:
BR (Pointer/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMSymbolIteratorRef LLVMObjectFileCopySymbolIterator(LLVMBinaryRef BR)
rocm.bindings.llvm.c.object.LLVMObjectFileIsSymbolIteratorAtEnd(BR, SI)#

Returns whether the given symbol iterator is at the end.

See:

llvm::object::symbol_end

Args:
BR (Pointer/object):

(undocumented)

SI (LLVMOpaqueSymbolIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

LLVMBool LLVMObjectFileIsSymbolIteratorAtEnd(LLVMBinaryRef BR, LLVMSymbolIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMDisposeSectionIterator(SI)#

Returns whether the given symbol iterator is at the end.

See:

llvm::object::symbol_end

Args:
SI (LLVMOpaqueSectionIterator/object):

(undocumented)

C signature

void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMMoveToNextSection(SI)#

Returns whether the given symbol iterator is at the end.

See:

llvm::object::symbol_end

Args:
SI (LLVMOpaqueSectionIterator/object):

(undocumented)

C signature

void LLVMMoveToNextSection(LLVMSectionIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMMoveToContainingSection(Sect, Sym)#

Returns whether the given symbol iterator is at the end.

See:

llvm::object::symbol_end

Args:
Sect (LLVMOpaqueSectionIterator/object):

(undocumented)

Sym (LLVMOpaqueSymbolIterator/object):

(undocumented)

C signature

void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect, LLVMSymbolIteratorRef Sym)
rocm.bindings.llvm.c.object.LLVMDisposeSymbolIterator(SI)#

// ObjectFile Symbol iterators

Args:
SI (LLVMOpaqueSymbolIterator/object):

(undocumented)

C signature

void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMMoveToNextSymbol(SI)#

// ObjectFile Symbol iterators

Args:
SI (LLVMOpaqueSymbolIterator/object):

(undocumented)

C signature

void LLVMMoveToNextSymbol(LLVMSymbolIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMGetSectionName(SI)#

// SectionRef accessors

Args:
SI (LLVMOpaqueSectionIterator/object):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * LLVMGetSectionName(LLVMSectionIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMGetSectionSize(SI)#

// SectionRef accessors

Args:
SI (LLVMOpaqueSectionIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

uint64_t LLVMGetSectionSize(LLVMSectionIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMGetSectionContents(SI)#

// SectionRef accessors

Args:
SI (LLVMOpaqueSectionIterator/object):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * LLVMGetSectionContents(LLVMSectionIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMGetSectionAddress(SI)#

// SectionRef accessors

Args:
SI (LLVMOpaqueSectionIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMGetSectionContainsSymbol(SI, Sym)#

// SectionRef accessors

Args:
SI (LLVMOpaqueSectionIterator/object):

(undocumented)

Sym (LLVMOpaqueSymbolIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI, LLVMSymbolIteratorRef Sym)
rocm.bindings.llvm.c.object.LLVMGetRelocations(Section)#

// Section Relocation iterators

Args:
Section (LLVMOpaqueSectionIterator/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section)
rocm.bindings.llvm.c.object.LLVMDisposeRelocationIterator(RI)#

// Section Relocation iterators

Args:
RI (LLVMOpaqueRelocationIterator/object):

(undocumented)

C signature

void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef RI)
rocm.bindings.llvm.c.object.LLVMIsRelocationIteratorAtEnd(Section, RI)#

// Section Relocation iterators

Args:
Section (LLVMOpaqueSectionIterator/object):

(undocumented)

RI (LLVMOpaqueRelocationIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section, LLVMRelocationIteratorRef RI)
rocm.bindings.llvm.c.object.LLVMMoveToNextRelocation(RI)#

// Section Relocation iterators

Args:
RI (LLVMOpaqueRelocationIterator/object):

(undocumented)

C signature

void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef RI)
rocm.bindings.llvm.c.object.LLVMGetSymbolName(SI)#

// SymbolRef accessors

Args:
SI (LLVMOpaqueSymbolIterator/object):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * LLVMGetSymbolName(LLVMSymbolIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMGetSymbolAddress(SI)#

// SymbolRef accessors

Args:
SI (LLVMOpaqueSymbolIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMGetSymbolSize(SI)#

// SymbolRef accessors

Args:
SI (LLVMOpaqueSymbolIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMGetRelocationOffset(RI)#

// RelocationRef accessors

Args:
RI (LLVMOpaqueRelocationIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI)
rocm.bindings.llvm.c.object.LLVMGetRelocationSymbol(RI)#

// RelocationRef accessors

Args:
RI (LLVMOpaqueRelocationIterator/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI)
rocm.bindings.llvm.c.object.LLVMGetRelocationType(RI)#

// RelocationRef accessors

Args:
RI (LLVMOpaqueRelocationIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

uint64_t LLVMGetRelocationType(LLVMRelocationIteratorRef RI)
rocm.bindings.llvm.c.object.LLVMGetRelocationTypeName(RI)#

// following functions.

Args:
RI (LLVMOpaqueRelocationIterator/object):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * LLVMGetRelocationTypeName(LLVMRelocationIteratorRef RI)
rocm.bindings.llvm.c.object.LLVMGetRelocationValueString(RI)#

// following functions.

Args:
RI (LLVMOpaqueRelocationIterator/object):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI)
class rocm.bindings.llvm.c.object.LLVMOpaqueObjectFile(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.object.LLVMObjectFileRef#
rocm.bindings.llvm.c.object.LLVMCreateObjectFile(MemBuf)#

Deprecated: Use LLVMCreateBinary instead.

Args:
MemBuf (Pointer/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf)
rocm.bindings.llvm.c.object.LLVMDisposeObjectFile(ObjectFile)#

Deprecated: Use LLVMDisposeBinary instead.

Args:
ObjectFile (LLVMOpaqueObjectFile/object):

(undocumented)

C signature

void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile)
rocm.bindings.llvm.c.object.LLVMGetSections(ObjectFile)#

Deprecated: Use LLVMObjectFileCopySectionIterator instead.

Args:
ObjectFile (LLVMOpaqueObjectFile/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef ObjectFile)
rocm.bindings.llvm.c.object.LLVMIsSectionIteratorAtEnd(ObjectFile, SI)#

Deprecated: Use LLVMObjectFileIsSectionIteratorAtEnd instead.

Args:
ObjectFile (LLVMOpaqueObjectFile/object):

(undocumented)

SI (LLVMOpaqueSectionIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile, LLVMSectionIteratorRef SI)
rocm.bindings.llvm.c.object.LLVMGetSymbols(ObjectFile)#

Deprecated: Use LLVMObjectFileCopySymbolIterator instead.

Args:
ObjectFile (LLVMOpaqueObjectFile/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef ObjectFile)
rocm.bindings.llvm.c.object.LLVMIsSymbolIteratorAtEnd(ObjectFile, SI)#

Deprecated: Use LLVMObjectFileIsSymbolIteratorAtEnd instead.

Args:
ObjectFile (LLVMOpaqueObjectFile/object):

(undocumented)

SI (LLVMOpaqueSymbolIterator/object):

(undocumented)

Returns:

int: (undocumented)

C signature

LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef ObjectFile, LLVMSymbolIteratorRef SI)