16#ifndef LIEF_MACHO_LINKER_OPT_HINT_COMMAND_H
17#define LIEF_MACHO_LINKER_OPT_HINT_COMMAND_H
20#include "LIEF/visibility.h"
21#include "LIEF/span.hpp"
23#include "LIEF/MachO/LoadCommand.hpp"
33struct linkedit_data_command;
49 std::unique_ptr<LoadCommand> clone()
const override {
50 return std::unique_ptr<LinkerOptHint>(
new LinkerOptHint(*
this));
63 void data_offset(uint32_t offset) {
64 data_offset_ = offset;
67 void data_size(uint32_t size) {
71 span<const uint8_t> content()
const {
75 span<uint8_t> content() {
79 ~LinkerOptHint()
override =
default;
81 void accept(Visitor& visitor)
const override;
83 std::ostream& print(std::ostream& os)
const override;
85 static bool classof(
const LoadCommand* cmd) {
86 return cmd->command() == LoadCommand::TYPE::LINKER_OPTIMIZATION_HINT;
90 uint32_t data_offset_ = 0;
91 uint32_t data_size_ = 0;
92 span<uint8_t> content_;
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:73
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:54
Definition LinkEdit.hpp:42
Class which represents the LC_LINKER_OPTIMIZATION_HINT command.
Definition LinkerOptHint.hpp:37
uint32_t data_size() const
Size of the raw signature.
Definition LinkerOptHint.hpp:59
uint32_t data_offset() const
Offset in the binary where the signature starts.
Definition LinkerOptHint.hpp:54
Based class for the Mach-O load commands.
Definition LoadCommand.hpp:36
LIEF namespace.
Definition Abstract/Binary.hpp:32