16#ifndef LIEF_MACHO_RELOCATION_OBJECT_COMMAND_H
17#define LIEF_MACHO_RELOCATION_OBJECT_COMMAND_H
20#include "LIEF/visibility.h"
22#include "LIEF/MachO/Relocation.hpp"
30struct relocation_info;
31struct scattered_relocation_info;
43 using Relocation::Relocation;
46 RelocationObject(
const details::scattered_relocation_info& scattered_relocinfo);
55 std::unique_ptr<Relocation> clone()
const override {
65 size_t size()
const override;
87 Relocation::ORIGIN
origin()
const override {
88 return Relocation::ORIGIN::RELOC_TABLE;
91 void pc_relative(
bool val)
override {
94 void size(
size_t size)
override;
96 void value(int32_t value);
98 void accept(
Visitor& visitor)
const override;
100 std::ostream& print(std::ostream& os)
const override {
101 return Relocation::print(os);
104 static bool classof(
const Relocation& r) {
105 return r.origin() == Relocation::ORIGIN::RELOC_TABLE;
109 bool is_pcrel_ =
false;
110 bool is_scattered_ =
false;
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:73
Class that represents a relocation presents in the MachO object file (.o). Usually,...
Definition RelocationObject.hpp:38
bool is_scattered() const
true if the relocation is a scattered one
Definition RelocationObject.hpp:72
Relocation::ORIGIN origin() const override
Origin of the relocation. For this object it should be Relocation::ORIGIN::RELOC_TABLE)
Definition RelocationObject.hpp:87
int32_t value() const
For scattered relocations: The address of the relocatable expression for the item in the file that ne...
bool is_pc_relative() const override
Whether the relocation is PC relative.
Definition RelocationObject.hpp:60
uint64_t address() const override
Address where the relocation is applied This address is relative to the start of the section where th...
size_t size() const override
Size of the relocation.
Class that represents a Mach-O relocation.
Definition MachO/Relocation.hpp:40
Definition Visitor.hpp:219
LIEF namespace.
Definition Abstract/Binary.hpp:32