xref: /freebsd/contrib/llvm-project/lld/ELF/AArch64ErrataFix.h (revision e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5)
1 //===- AArch64ErrataFix.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_AARCH64ERRATAFIX_H
10 #define LLD_ELF_AARCH64ERRATAFIX_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 Patch843419Section;
24 
25 class AArch64Err843419Patcher {
26 public:
27   // return true if Patches have been added to the OutputSections.
28   bool createFixes();
29 
30 private:
31   std::vector<Patch843419Section *>
32   patchInputSectionDescription(InputSectionDescription &isd);
33 
34   void insertPatches(InputSectionDescription &isd,
35                      std::vector<Patch843419Section *> &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