treelite
Functions
elf_formatter.h File Reference

Generate a relocatable object file containing a constant, read-only array. More...

#include <vector>
Include dependency graph for elf_formatter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void AllocateELFHeader (std::vector< char > *elf)
 Pre-allocate space in a buffer to fit an ELF header. More...
 
void FormatArrayAsELF (std::vector< char > *elf)
 Format a relocatable ELF object file containing a constant, read-only array. More...
 

Detailed Description

Generate a relocatable object file containing a constant, read-only array.

Copyright (c) 2019 by Contributors

Author
Philip Cho

Definition in file elf_formatter.h.

Function Documentation

◆ AllocateELFHeader()

void AllocateELFHeader ( std::vector< char > *  elf)

Pre-allocate space in a buffer to fit an ELF header.

Parameters
elfBuffer in which space will be allocated

Definition at line 209 of file elf_formatter.cc.

◆ FormatArrayAsELF()

void FormatArrayAsELF ( std::vector< char > *  elf)

Format a relocatable ELF object file containing a constant, read-only array.

Parameters
elfWhen the function is invoked, elf should contain 1) empty bytes that have been allocated with a call to AllocateELFHeader(); followed by 2) bytes representing the content of the array. The FormatArrayAsELF() function will then modify elf, so that in the end, elf will contain a valid ELF relocatable object. Two modification will take place: 1) The preceding empty bytes in elf will be overwritten with a valid ELF header; and 2) symbol table, section headers, and other various sections will be appended after the array bytes.

Definition at line 213 of file elf_formatter.cc.