From 24a07e23ccf2b5bc99d7fd9db3fbad1b62b09286 Mon Sep 17 00:00:00 2001 From: Charles <a837940593@gmail.com> Date: Sun, 6 Dec 2020 17:31:09 +0800 Subject: [PATCH] Add section method to set section_ in class Relocation in ELF --- include/LIEF/ELF/Relocation.hpp | 1 + src/ELF/Relocation.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/LIEF/ELF/Relocation.hpp b/include/LIEF/ELF/Relocation.hpp index 09a2820..22d5763 100644 --- a/include/LIEF/ELF/Relocation.hpp +++ b/include/LIEF/ELF/Relocation.hpp @@ -97,6 +97,7 @@ class LIEF_API Relocation : public LIEF::Relocation { void purpose(RELOCATION_PURPOSES purpose); void info(uint32_t v); void symbol(Symbol* symbol); + void section(Section* section); virtual void accept(Visitor& visitor) const override; diff --git a/src/ELF/Relocation.cpp b/src/ELF/Relocation.cpp index 2830703..b032604 100644 --- a/src/ELF/Relocation.cpp +++ b/src/ELF/Relocation.cpp @@ -306,6 +306,10 @@ void Relocation::symbol(Symbol* sym) { this->symbol_ = sym; } +void Relocation::section(Section* section) { + this->section_ = section; +} + void Relocation::purpose(RELOCATION_PURPOSES purpose) { this->purpose_ = purpose;