xref: /openbsd/gnu/llvm/lld/ELF/AArch64ErrataFix.h (revision dfe94b16)
1ece8a530Spatrick //===- AArch64ErrataFix.h ---------------------------------------*- C++ -*-===//
2ece8a530Spatrick //
3ece8a530Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4ece8a530Spatrick // See https://llvm.org/LICENSE.txt for license information.
5ece8a530Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6ece8a530Spatrick //
7ece8a530Spatrick //===----------------------------------------------------------------------===//
8ece8a530Spatrick 
9ece8a530Spatrick #ifndef LLD_ELF_AARCH64ERRATAFIX_H
10ece8a530Spatrick #define LLD_ELF_AARCH64ERRATAFIX_H
11ece8a530Spatrick 
12ece8a530Spatrick #include "lld/Common/LLVM.h"
13*dfe94b16Srobert #include "llvm/ADT/DenseMap.h"
14ece8a530Spatrick #include <vector>
15ece8a530Spatrick 
16*dfe94b16Srobert namespace lld::elf {
17ece8a530Spatrick 
18ece8a530Spatrick class Defined;
19ece8a530Spatrick class InputSection;
201cf9926bSpatrick class InputSectionDescription;
21ece8a530Spatrick class Patch843419Section;
22ece8a530Spatrick 
23ece8a530Spatrick class AArch64Err843419Patcher {
24ece8a530Spatrick public:
25ece8a530Spatrick   // return true if Patches have been added to the OutputSections.
26ece8a530Spatrick   bool createFixes();
27ece8a530Spatrick 
28ece8a530Spatrick private:
29ece8a530Spatrick   std::vector<Patch843419Section *>
30ece8a530Spatrick   patchInputSectionDescription(InputSectionDescription &isd);
31ece8a530Spatrick 
32ece8a530Spatrick   void insertPatches(InputSectionDescription &isd,
33ece8a530Spatrick                      std::vector<Patch843419Section *> &patches);
34ece8a530Spatrick 
35ece8a530Spatrick   void init();
36ece8a530Spatrick 
37ece8a530Spatrick   // A cache of the mapping symbols defined by the InputSection sorted in order
38ece8a530Spatrick   // of ascending value with redundant symbols removed. These describe
39ece8a530Spatrick   // the ranges of code and data in an executable InputSection.
40*dfe94b16Srobert   llvm::DenseMap<InputSection *, std::vector<const Defined *>> sectionMap;
41ece8a530Spatrick 
42ece8a530Spatrick   bool initialized = false;
43ece8a530Spatrick };
44ece8a530Spatrick 
45*dfe94b16Srobert } // namespace lld::elf
46ece8a530Spatrick 
47ece8a530Spatrick #endif
48