LLVM  14.0.0git
RelocationResolver.h
Go to the documentation of this file.
1 //===- RelocVisitor.h - Visitor for object file relocations -----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file provides a wrapper around all the different types of relocations
10 // in different file formats, such that a client can handle them in a unified
11 // manner by only implementing a minimal number of functions.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_OBJECT_RELOCATIONRESOLVER_H
16 #define LLVM_OBJECT_RELOCATIONRESOLVER_H
17 
18 #include "llvm/ADT/Triple.h"
19 #include "llvm/BinaryFormat/ELF.h"
21 #include "llvm/Object/COFF.h"
23 #include "llvm/Object/MachO.h"
24 #include "llvm/Object/ObjectFile.h"
25 #include "llvm/Object/Wasm.h"
26 #include "llvm/Support/Casting.h"
28 #include <cstdint>
29 #include <system_error>
30 
31 namespace llvm {
32 namespace object {
33 
34 using SupportsRelocation = bool (*)(uint64_t);
35 using RelocationResolver = uint64_t (*)(uint64_t Type, uint64_t Offset,
36  uint64_t S, uint64_t LocData,
37  int64_t Addend);
38 
39 std::pair<SupportsRelocation, RelocationResolver>
41 
43  uint64_t S, uint64_t LocData);
44 
45 } // end namespace object
46 } // end namespace llvm
47 
48 #endif // LLVM_OBJECT_RELOCATIONRESOLVER_H
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::object::RelocationResolver
uint64_t(*)(uint64_t Type, uint64_t Offset, uint64_t S, uint64_t LocData, int64_t Addend) RelocationResolver
Definition: RelocationResolver.h:37
ErrorHandling.h
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
MachO.h
llvm::Resolver
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
Definition: Record.h:2000
ELF.h
Wasm.h
llvm::object::SupportsRelocation
bool(*)(uint64_t) SupportsRelocation
Definition: RelocationResolver.h:34
object
bar al al movzbl eax ret Missed when stored in a memory object
Definition: README.txt:1411
ObjectFile.h
llvm::object::getRelocationResolver
std::pair< SupportsRelocation, RelocationResolver > getRelocationResolver(const ObjectFile &Obj)
Definition: RelocationResolver.cpp:645
Triple.h
llvm::object::ObjectFile
This class is the base class for all object file types.
Definition: ObjectFile.h:228
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
ELFObjectFile.h
Casting.h
COFF.h
MachO.h
llvm::object::RelocationRef
This is a value type class that represents a single relocation in the list of relocations in the obje...
Definition: ObjectFile.h:51
llvm::object::resolveRelocation
uint64_t resolveRelocation(RelocationResolver Resolver, const RelocationRef &R, uint64_t S, uint64_t LocData)
Definition: RelocationResolver.cpp:736