xref: /freebsd/contrib/llvm-project/lld/ELF/ARMErrataFix.h (revision af23369a6deaaeb612ab266eb88b8bb8d560c322)
1 //===- ARMErrataFix.h -------------------------------------------*- 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 #ifndef LLD_ELF_ARMA8ERRATAFIX_H
10 #define LLD_ELF_ARMA8ERRATAFIX_H
11 
12 #include "lld/Common/LLVM.h"
13 #include "llvm/ADT/DenseMap.h"
14 #include <vector>
15 
16 namespace lld {
17 namespace elf {
18 
19 class Defined;
20 class InputSection;
21 class InputSectionDescription;
22 class OutputSection;
23 class Patch657417Section;
24 
25 class ARMErr657417Patcher {
26 public:
27   // Return true if Patches have been added to the OutputSections.
28   bool createFixes();
29 
30 private:
31   std::vector<Patch657417Section *>
32   patchInputSectionDescription(InputSectionDescription &isd);
33 
34   void insertPatches(InputSectionDescription &isd,
35                      std::vector<Patch657417Section *> &patches);
36 
37   void init();
38 
39   // A cache of the mapping symbols defined by the InputSection sorted in order
40   // of ascending value with redundant symbols removed. These describe
41   // the ranges of code and data in an executable InputSection.
42   llvm::DenseMap<InputSection *, std::vector<const Defined *>> sectionMap;
43 
44   bool initialized = false;
45 };
46 
47 } // namespace elf
48 } // namespace lld
49 
50 #endif
51