Treelite
|
Generate a relocatable object file containing a constant, read-only array. More...
#include <treelite/logging.h>
#include <fstream>
#include <iterator>
#include <stdexcept>
#include <vector>
#include <cstdio>
#include <cstring>
#include "./elf_formatter.h"
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... | |
Generate a relocatable object file containing a constant, read-only array.
Copyright (c) 2019-2021 by Contributors
Definition in file elf_formatter.cc.
void AllocateELFHeader | ( | std::vector< char > * | elf | ) |
Pre-allocate space in a buffer to fit an ELF header.
elf | Buffer in which space will be allocated |
Definition at line 207 of file elf_formatter.cc.
void FormatArrayAsELF | ( | std::vector< char > * | elf | ) |
Format a relocatable ELF object file containing a constant, read-only array.
elf | When 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 211 of file elf_formatter.cc.