blob: 847b6ae527ff2b49943957351440cd0ef127a827 [file] [log] [blame]
Peter Smithea99ce52019-09-16 09:38:381//===- 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"
Peter Smithea99ce52019-09-16 09:38:3814#include <vector>
15
Nico Weber87248ba2022-08-10 19:31:5816namespace lld::elf {
Fangrui Songb3e0bd32024-10-06 07:31:5117struct Ctx;
Peter Smithea99ce52019-09-16 09:38:3818class Defined;
19class InputSection;
Andrew Ng77152a62020-09-09 09:48:2120class InputSectionDescription;
Peter Smithea99ce52019-09-16 09:38:3821class Patch657417Section;
22
23class ARMErr657417Patcher {
24public:
Fangrui Songb3e0bd32024-10-06 07:31:5125 ARMErr657417Patcher(Ctx &ctx) : ctx(ctx) {}
Peter Smithea99ce52019-09-16 09:38:3826 // Return true if Patches have been added to the OutputSections.
27 bool createFixes();
28
29private:
30 std::vector<Patch657417Section *>
31 patchInputSectionDescription(InputSectionDescription &isd);
32
33 void insertPatches(InputSectionDescription &isd,
34 std::vector<Patch657417Section *> &patches);
35
36 void init();
37
Fangrui Songb3e0bd32024-10-06 07:31:5138 Ctx &ctx;
Peter Smithea99ce52019-09-16 09:38:3839 // 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
Nico Weber87248ba2022-08-10 19:31:5847} // namespace lld::elf
Peter Smithea99ce52019-09-16 09:38:3848
49#endif