Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:20

0001 //===- RelocVisitor.h - Visitor for object file relocations -----*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file provides a wrapper around all the different types of relocations
0010 // in different file formats, such that a client can handle them in a unified
0011 // manner by only implementing a minimal number of functions.
0012 //
0013 //===----------------------------------------------------------------------===//
0014 
0015 #ifndef LLVM_OBJECT_RELOCATIONRESOLVER_H
0016 #define LLVM_OBJECT_RELOCATIONRESOLVER_H
0017 
0018 #include <cstdint>
0019 #include <utility>
0020 
0021 namespace llvm {
0022 namespace object {
0023 
0024 class ObjectFile;
0025 class RelocationRef;
0026 
0027 using SupportsRelocation = bool (*)(uint64_t);
0028 using RelocationResolver = uint64_t (*)(uint64_t Type, uint64_t Offset,
0029                                         uint64_t S, uint64_t LocData,
0030                                         int64_t Addend);
0031 
0032 std::pair<SupportsRelocation, RelocationResolver>
0033 getRelocationResolver(const ObjectFile &Obj);
0034 
0035 uint64_t resolveRelocation(RelocationResolver Resolver, const RelocationRef &R,
0036                            uint64_t S, uint64_t LocData);
0037 
0038 } // end namespace object
0039 } // end namespace llvm
0040 
0041 #endif // LLVM_OBJECT_RELOCATIONRESOLVER_H