Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 1 | //===- ICF.cpp ------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Linker |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // Identical Code Folding is a feature to merge sections not by name (which |
| 11 | // is regular comdat handling) but by contents. If two non-writable sections |
| 12 | // have the same data, relocations, attributes, etc., then the two |
| 13 | // are considered identical and merged by the linker. This optimization |
| 14 | // makes outputs smaller. |
| 15 | // |
| 16 | // ICF is theoretically a problem of reducing graphs by merging as many |
| 17 | // identical subgraphs as possible if we consider sections as vertices and |
| 18 | // relocations as edges. It may sound simple, but it is a bit more |
| 19 | // complicated than you might think. The order of processing sections |
| 20 | // matters because merging two sections can make other sections, whose |
| 21 | // relocations now point to the same section, mergeable. Graphs may contain |
| 22 | // cycles. We need a sophisticated algorithm to do this properly and |
| 23 | // efficiently. |
| 24 | // |
| 25 | // What we do in this file is this. We split sections into groups. Sections |
| 26 | // in the same group are considered identical. |
| 27 | // |
| 28 | // We begin by optimistically putting all sections into a single equivalence |
| 29 | // class. Then we apply a series of checks that split this initial |
| 30 | // equivalence class into more and more refined equivalence classes based on |
| 31 | // the properties by which a section can be distinguished. |
| 32 | // |
| 33 | // We begin by checking that the section contents and flags are the |
| 34 | // same. This only needs to be done once since these properties don't depend |
| 35 | // on the current equivalence class assignment. |
| 36 | // |
| 37 | // Then we split the equivalence classes based on checking that their |
| 38 | // relocations are the same, where relocation targets are compared by their |
| 39 | // equivalence class, not the concrete section. This may need to be done |
| 40 | // multiple times because as the equivalence classes are refined, two |
| 41 | // sections that had a relocation target in the same equivalence class may |
| 42 | // now target different equivalence classes, and hence these two sections |
| 43 | // must be put in different equivalence classes (whereas in the previous |
| 44 | // iteration they were not since the relocation target was the same.) |
| 45 | // |
| 46 | // Our algorithm is smart enough to merge the following mutually-recursive |
| 47 | // functions. |
| 48 | // |
| 49 | // void foo() { bar(); } |
| 50 | // void bar() { foo(); } |
| 51 | // |
| 52 | // This algorithm is so-called "optimistic" algorithm described in |
| 53 | // http://research.google.com/pubs/pub36912.html. (Note that what GNU |
| 54 | // gold implemented is different from the optimistic algorithm.) |
| 55 | // |
| 56 | //===----------------------------------------------------------------------===// |
| 57 | |
| 58 | #include "ICF.h" |
| 59 | #include "Config.h" |
| 60 | #include "OutputSections.h" |
| 61 | #include "SymbolTable.h" |
| 62 | |
| 63 | #include "llvm/ADT/Hashing.h" |
| 64 | #include "llvm/Object/ELF.h" |
| 65 | #include "llvm/Support/ELF.h" |
| 66 | #include "llvm/Support/raw_ostream.h" |
Rui Ueyama | a05134e | 2016-11-19 20:15:55 +0000 | [diff] [blame] | 67 | #include <algorithm> |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 68 | |
| 69 | using namespace lld; |
Rafael Espindola | e0df00b | 2016-02-28 00:25:54 +0000 | [diff] [blame] | 70 | using namespace lld::elf; |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 71 | using namespace llvm; |
| 72 | using namespace llvm::ELF; |
| 73 | using namespace llvm::object; |
| 74 | |
| 75 | namespace lld { |
Rafael Espindola | e0df00b | 2016-02-28 00:25:54 +0000 | [diff] [blame] | 76 | namespace elf { |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 77 | template <class ELFT> class ICF { |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 78 | typedef typename ELFT::Shdr Elf_Shdr; |
| 79 | typedef typename ELFT::Sym Elf_Sym; |
| 80 | typedef typename ELFT::uint uintX_t; |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 81 | typedef Elf_Rel_Impl<ELFT, false> Elf_Rel; |
| 82 | |
| 83 | using Comparator = std::function<bool(const InputSection<ELFT> *, |
| 84 | const InputSection<ELFT> *)>; |
| 85 | |
| 86 | public: |
Rui Ueyama | 4f8d21f | 2016-05-02 19:30:42 +0000 | [diff] [blame] | 87 | void run(); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 88 | |
| 89 | private: |
| 90 | uint64_t NextId = 1; |
| 91 | |
| 92 | static void setLive(SymbolTable<ELFT> *S); |
| 93 | static uint64_t relSize(InputSection<ELFT> *S); |
| 94 | static uint64_t getHash(InputSection<ELFT> *S); |
| 95 | static bool isEligible(InputSectionBase<ELFT> *Sec); |
Rui Ueyama | 4f8d21f | 2016-05-02 19:30:42 +0000 | [diff] [blame] | 96 | static std::vector<InputSection<ELFT> *> getSections(); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 97 | |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 98 | void segregate(MutableArrayRef<InputSection<ELFT> *> Arr, Comparator Eq); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 99 | |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 100 | void |
| 101 | forEachGroup(std::vector<InputSection<ELFT> *> &V, |
| 102 | std::function<void(MutableArrayRef<InputSection<ELFT> *>)> Fn); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 103 | |
| 104 | template <class RelTy> |
Rafael Espindola | 0f7ccc3 | 2016-04-05 14:47:28 +0000 | [diff] [blame] | 105 | static bool relocationEq(ArrayRef<RelTy> RA, ArrayRef<RelTy> RB); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 106 | |
| 107 | template <class RelTy> |
Rui Ueyama | a05134e | 2016-11-19 20:15:55 +0000 | [diff] [blame] | 108 | static bool variableEq(const InputSection<ELFT> *A, ArrayRef<RelTy> RA, |
| 109 | const InputSection<ELFT> *B, ArrayRef<RelTy> RB); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 110 | |
| 111 | static bool equalsConstant(const InputSection<ELFT> *A, |
| 112 | const InputSection<ELFT> *B); |
| 113 | |
| 114 | static bool equalsVariable(const InputSection<ELFT> *A, |
| 115 | const InputSection<ELFT> *B); |
| 116 | }; |
| 117 | } |
| 118 | } |
| 119 | |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 120 | // Returns a hash value for S. Note that the information about |
| 121 | // relocation targets is not included in the hash value. |
| 122 | template <class ELFT> uint64_t ICF<ELFT>::getHash(InputSection<ELFT> *S) { |
Rui Ueyama | a05134e | 2016-11-19 20:15:55 +0000 | [diff] [blame] | 123 | return hash_combine(S->Flags, S->getSize(), S->NumRelocations); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | // Returns true if Sec is subject of ICF. |
| 127 | template <class ELFT> bool ICF<ELFT>::isEligible(InputSectionBase<ELFT> *Sec) { |
Rafael Espindola | 8f9026b | 2016-11-08 18:23:02 +0000 | [diff] [blame] | 128 | if (!Sec->Live) |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 129 | return false; |
| 130 | auto *S = dyn_cast<InputSection<ELFT>>(Sec); |
| 131 | if (!S) |
| 132 | return false; |
| 133 | |
| 134 | // .init and .fini contains instructions that must be executed to |
| 135 | // initialize and finalize the process. They cannot and should not |
| 136 | // be merged. |
Rafael Espindola | 042a3f2 | 2016-09-08 14:06:08 +0000 | [diff] [blame] | 137 | StringRef Name = S->Name; |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 138 | if (Name == ".init" || Name == ".fini") |
| 139 | return false; |
| 140 | |
Rafael Espindola | 1854a8e | 2016-10-26 12:36:56 +0000 | [diff] [blame] | 141 | return (S->Flags & SHF_ALLOC) && !(S->Flags & SHF_WRITE); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | template <class ELFT> |
Rui Ueyama | 4f8d21f | 2016-05-02 19:30:42 +0000 | [diff] [blame] | 145 | std::vector<InputSection<ELFT> *> ICF<ELFT>::getSections() { |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 146 | std::vector<InputSection<ELFT> *> V; |
Rui Ueyama | 8c6a5aa | 2016-11-05 22:37:59 +0000 | [diff] [blame] | 147 | for (InputSectionBase<ELFT> *S : Symtab<ELFT>::X->Sections) |
| 148 | if (isEligible(S)) |
| 149 | V.push_back(cast<InputSection<ELFT>>(S)); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 150 | return V; |
| 151 | } |
| 152 | |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 153 | // All sections between Begin and End must have the same group ID before |
| 154 | // you call this function. This function compare sections between Begin |
| 155 | // and End using Eq and assign new group IDs for new groups. |
| 156 | template <class ELFT> |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 157 | void ICF<ELFT>::segregate(MutableArrayRef<InputSection<ELFT> *> Arr, |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 158 | Comparator Eq) { |
| 159 | // This loop rearranges [Begin, End) so that all sections that are |
| 160 | // equal in terms of Eq are contiguous. The algorithm is quadratic in |
| 161 | // the worst case, but that is not an issue in practice because the |
| 162 | // number of distinct sections in [Begin, End) is usually very small. |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 163 | InputSection<ELFT> **I = Arr.begin(); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 164 | for (;;) { |
| 165 | InputSection<ELFT> *Head = *I; |
| 166 | auto Bound = std::stable_partition( |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 167 | I + 1, Arr.end(), [&](InputSection<ELFT> *S) { return Eq(Head, S); }); |
| 168 | if (Bound == Arr.end()) |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 169 | return; |
| 170 | uint64_t Id = NextId++; |
| 171 | for (; I != Bound; ++I) |
| 172 | (*I)->GroupId = Id; |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | template <class ELFT> |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 177 | void ICF<ELFT>::forEachGroup( |
| 178 | std::vector<InputSection<ELFT> *> &V, |
| 179 | std::function<void(MutableArrayRef<InputSection<ELFT> *>)> Fn) { |
Rui Ueyama | eec23eb | 2016-02-26 15:13:24 +0000 | [diff] [blame] | 180 | for (InputSection<ELFT> **I = V.data(), **E = I + V.size(); I != E;) { |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 181 | InputSection<ELFT> *Head = *I; |
| 182 | auto Bound = std::find_if(I + 1, E, [&](InputSection<ELFT> *S) { |
| 183 | return S->GroupId != Head->GroupId; |
| 184 | }); |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 185 | Fn({I, Bound}); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 186 | I = Bound; |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | // Compare two lists of relocations. |
| 191 | template <class ELFT> |
| 192 | template <class RelTy> |
Rafael Espindola | 0f7ccc3 | 2016-04-05 14:47:28 +0000 | [diff] [blame] | 193 | bool ICF<ELFT>::relocationEq(ArrayRef<RelTy> RelsA, ArrayRef<RelTy> RelsB) { |
Rui Ueyama | a05134e | 2016-11-19 20:15:55 +0000 | [diff] [blame] | 194 | auto Eq = [](const RelTy &A, const RelTy &B) { |
| 195 | return A.r_offset == B.r_offset && |
| 196 | A.getType(Config->Mips64EL) == B.getType(Config->Mips64EL) && |
| 197 | getAddend<ELFT>(A) == getAddend<ELFT>(B); |
| 198 | }; |
| 199 | |
| 200 | return RelsA.size() == RelsB.size() && |
| 201 | std::equal(RelsA.begin(), RelsA.end(), RelsB.begin(), Eq); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | // Compare "non-moving" part of two InputSections, namely everything |
| 205 | // except relocation targets. |
| 206 | template <class ELFT> |
| 207 | bool ICF<ELFT>::equalsConstant(const InputSection<ELFT> *A, |
| 208 | const InputSection<ELFT> *B) { |
Rafael Espindola | 9f0c4bb | 2016-11-10 14:53:24 +0000 | [diff] [blame] | 209 | if (A->NumRelocations != B->NumRelocations) |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 210 | return false; |
| 211 | |
Rafael Espindola | 9f0c4bb | 2016-11-10 14:53:24 +0000 | [diff] [blame] | 212 | if (A->AreRelocsRela) { |
| 213 | if (!relocationEq(A->relas(), B->relas())) |
| 214 | return false; |
| 215 | } else { |
| 216 | if (!relocationEq(A->rels(), B->rels())) |
| 217 | return false; |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 218 | } |
| 219 | |
Rafael Espindola | 1854a8e | 2016-10-26 12:36:56 +0000 | [diff] [blame] | 220 | return A->Flags == B->Flags && A->getSize() == B->getSize() && |
Rafael Espindola | 58139d1 | 2016-10-25 16:14:25 +0000 | [diff] [blame] | 221 | A->Data == B->Data; |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 222 | } |
| 223 | |
| 224 | template <class ELFT> |
| 225 | template <class RelTy> |
Rui Ueyama | a05134e | 2016-11-19 20:15:55 +0000 | [diff] [blame] | 226 | bool ICF<ELFT>::variableEq(const InputSection<ELFT> *A, ArrayRef<RelTy> RelsA, |
| 227 | const InputSection<ELFT> *B, ArrayRef<RelTy> RelsB) { |
| 228 | auto Eq = [&](const RelTy &RA, const RelTy &RB) { |
| 229 | SymbolBody &SA = A->File->getRelocTargetSym(RA); |
| 230 | SymbolBody &SB = B->File->getRelocTargetSym(RB); |
Rafael Espindola | 67d72c0 | 2016-03-11 12:06:30 +0000 | [diff] [blame] | 231 | if (&SA == &SB) |
Rui Ueyama | a05134e | 2016-11-19 20:15:55 +0000 | [diff] [blame] | 232 | return true; |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 233 | |
| 234 | // Or, the symbols should be pointing to the same section |
| 235 | // in terms of the group ID. |
Rafael Espindola | 67d72c0 | 2016-03-11 12:06:30 +0000 | [diff] [blame] | 236 | auto *DA = dyn_cast<DefinedRegular<ELFT>>(&SA); |
| 237 | auto *DB = dyn_cast<DefinedRegular<ELFT>>(&SB); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 238 | if (!DA || !DB) |
| 239 | return false; |
Rafael Espindola | ccfe3cb | 2016-04-04 14:04:16 +0000 | [diff] [blame] | 240 | if (DA->Value != DB->Value) |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 241 | return false; |
| 242 | InputSection<ELFT> *X = dyn_cast<InputSection<ELFT>>(DA->Section); |
| 243 | InputSection<ELFT> *Y = dyn_cast<InputSection<ELFT>>(DB->Section); |
Rui Ueyama | a05134e | 2016-11-19 20:15:55 +0000 | [diff] [blame] | 244 | return X && Y && X->GroupId && X->GroupId == Y->GroupId; |
| 245 | }; |
| 246 | |
| 247 | return std::equal(RelsA.begin(), RelsA.end(), RelsB.begin(), Eq); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | // Compare "moving" part of two InputSections, namely relocation targets. |
| 251 | template <class ELFT> |
| 252 | bool ICF<ELFT>::equalsVariable(const InputSection<ELFT> *A, |
| 253 | const InputSection<ELFT> *B) { |
Rafael Espindola | 9f0c4bb | 2016-11-10 14:53:24 +0000 | [diff] [blame] | 254 | if (A->AreRelocsRela) |
Rui Ueyama | a05134e | 2016-11-19 20:15:55 +0000 | [diff] [blame] | 255 | return variableEq(A, A->relas(), B, B->relas()); |
| 256 | return variableEq(A, A->rels(), B, B->rels()); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 257 | } |
| 258 | |
| 259 | // The main function of ICF. |
Rui Ueyama | 4f8d21f | 2016-05-02 19:30:42 +0000 | [diff] [blame] | 260 | template <class ELFT> void ICF<ELFT>::run() { |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 261 | // Initially, we use hash values as section group IDs. Therefore, |
| 262 | // if two sections have the same ID, they are likely (but not |
| 263 | // guaranteed) to have the same static contents in terms of ICF. |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 264 | std::vector<InputSection<ELFT> *> Sections = getSections(); |
| 265 | for (InputSection<ELFT> *S : Sections) |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 266 | // Set MSB on to avoid collisions with serial group IDs |
| 267 | S->GroupId = getHash(S) | (uint64_t(1) << 63); |
| 268 | |
| 269 | // From now on, sections in V are ordered so that sections in |
| 270 | // the same group are consecutive in the vector. |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 271 | std::stable_sort(Sections.begin(), Sections.end(), |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 272 | [](InputSection<ELFT> *A, InputSection<ELFT> *B) { |
Petr Hosek | 901948a | 2016-08-22 18:53:09 +0000 | [diff] [blame] | 273 | if (A->GroupId != B->GroupId) |
| 274 | return A->GroupId < B->GroupId; |
| 275 | // Within a group, put the highest alignment |
| 276 | // requirement first, so that's the one we'll keep. |
| 277 | return B->Alignment < A->Alignment; |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 278 | }); |
| 279 | |
| 280 | // Compare static contents and assign unique IDs for each static content. |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 281 | forEachGroup(Sections, [&](MutableArrayRef<InputSection<ELFT> *> V) { |
| 282 | segregate(V, equalsConstant); |
| 283 | }); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 284 | |
| 285 | // Split groups by comparing relocations until we get a convergence. |
| 286 | int Cnt = 1; |
| 287 | for (;;) { |
| 288 | ++Cnt; |
| 289 | uint64_t Id = NextId; |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 290 | forEachGroup(Sections, [&](MutableArrayRef<InputSection<ELFT> *> V) { |
| 291 | segregate(V, equalsVariable); |
| 292 | }); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 293 | if (Id == NextId) |
| 294 | break; |
| 295 | } |
Rui Ueyama | 10bd283 | 2016-02-25 18:56:01 +0000 | [diff] [blame] | 296 | log("ICF needed " + Twine(Cnt) + " iterations."); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 297 | |
| 298 | // Merge sections in the same group. |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 299 | forEachGroup(Sections, [&](MutableArrayRef<InputSection<ELFT> *> V) { |
| 300 | InputSection<ELFT> *Head = V[0]; |
Rafael Espindola | 042a3f2 | 2016-09-08 14:06:08 +0000 | [diff] [blame] | 301 | log("selected " + Head->Name); |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 302 | for (InputSection<ELFT> *S : V.slice(1)) { |
Rafael Espindola | 042a3f2 | 2016-09-08 14:06:08 +0000 | [diff] [blame] | 303 | log(" removed " + S->Name); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 304 | Head->replace(S); |
| 305 | } |
Rui Ueyama | e2dfbc1 | 2016-11-19 23:14:23 +0000 | [diff] [blame^] | 306 | }); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 307 | } |
| 308 | |
| 309 | // ICF entry point function. |
Rui Ueyama | 4f8d21f | 2016-05-02 19:30:42 +0000 | [diff] [blame] | 310 | template <class ELFT> void elf::doIcf() { ICF<ELFT>().run(); } |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 311 | |
Rui Ueyama | 4f8d21f | 2016-05-02 19:30:42 +0000 | [diff] [blame] | 312 | template void elf::doIcf<ELF32LE>(); |
| 313 | template void elf::doIcf<ELF32BE>(); |
| 314 | template void elf::doIcf<ELF64LE>(); |
| 315 | template void elf::doIcf<ELF64BE>(); |