17#ifndef LIEF_ELF_BUIDLER_H
18#define LIEF_ELF_BUIDLER_H
24#include <unordered_map>
27#include "LIEF/errors.hpp"
29#include "LIEF/visibility.h"
30#include "LIEF/iostream.hpp"
31#include "LIEF/ELF/enums.hpp"
39class DynamicEntryArray;
43class ObjectFileLayout;
52 friend class ObjectFileLayout;
54 friend class ExeLayout;
61 bool dynamic_section =
true;
62 bool fini_array =
true;
64 bool init_array =
true;
65 bool interpreter =
true;
68 bool preinit_array =
true;
70 bool android_rela =
true;
72 bool static_symtab =
true;
73 bool sym_verdef =
true;
74 bool sym_verneed =
true;
75 bool sym_versym =
true;
78 bool force_relocate =
false;
91 config_ = std::move(conf);
103 void write(
const std::string& filename)
const;
109 template<
typename ELF_T>
112 template<
typename ELF_T>
115 template<
typename ELF_T>
118 template<
typename ELF_T>
121 template<
typename ELF_T>
124 template<
typename ELF_T>
127 template<
typename ELF_T>
130 template<
typename ELF_T>
133 template<
typename ELF_T>
136 template<
typename ELF_T>
139 template<
typename ELF_T>
142 template<
typename ELF_T>
145 template<
typename ELF_T>
148 template<
typename ELF_T>
151 template<
typename ELF_T>
154 template<
typename ELF_T>
157 uint32_t sort_dynamic_symbols();
159 template<
typename ELF_T>
162 template<
typename ELF_T>
167 template<
typename ELF_T>
170 template<
typename ELF_T>
173 template<
typename ELF_T>
176 template<
typename ELF_T>
179 template<
typename ELF_T>
182 ok_error_t update_note_section(
const Note& note, std::set<const Note*>& notes);
184 template<
typename ELF_T>
187 bool should_swap()
const;
189 template<
class ELF_T>
195 std::unique_ptr<Layout> layout_;
Class which represents an ELF binary.
Definition ELF/Binary.hpp:59
Class which takes an ELF::Binary object and reconstructs a valid binary.
Definition ELF/Builder.hpp:51
void build()
Perform the build of the provided ELF binary.
void write(const std::string &filename) const
Write the built ELF binary in the filename given in parameter.
Builder & set_config(config_t conf)
Tweak the ELF builder with the provided config parameter.
Definition ELF/Builder.hpp:90
void write(std::ostream &os) const
Write the built ELF binary in the stream os given in parameter.
const std::vector< uint8_t > & get_build()
Return the built ELF binary as a byte vector.
Class which represents an ELF note. This class can be instantiated using the static Note::create func...
Definition Note.hpp:36
Definition iostream.hpp:30
LIEF namespace.
Definition Abstract/Binary.hpp:32
result< ok_t > ok_error_t
Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead,...
Definition errors.hpp:106
Configuration options to tweak the building process.
Definition ELF/Builder.hpp:58