2016-02-26 02:43:51 +08:00
|
|
|
//===- ICF.cpp ------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Linker
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2016-12-06 02:11:35 +08:00
|
|
|
// ICF is short for Identical Code Folding. This is a size optimization to
|
2016-12-02 03:45:22 +08:00
|
|
|
// identify and merge two or more read-only sections (typically functions)
|
|
|
|
// that happened to have the same contents. It usually reduces output size
|
|
|
|
// by a few percent.
|
2016-02-26 02:43:51 +08:00
|
|
|
//
|
2016-12-02 03:45:22 +08:00
|
|
|
// In ICF, two sections are considered identical if they have the same
|
|
|
|
// section flags, section data, and relocations. Relocations are tricky,
|
|
|
|
// because two relocations are considered the same if they have the same
|
|
|
|
// relocation types, values, and if they point to the same sections *in
|
|
|
|
// terms of ICF*.
|
2016-02-26 02:43:51 +08:00
|
|
|
//
|
2016-12-02 03:45:22 +08:00
|
|
|
// Here is an example. If foo and bar defined below are compiled to the
|
|
|
|
// same machine instructions, ICF can and should merge the two, although
|
|
|
|
// their relocations point to each other.
|
2016-02-26 02:43:51 +08:00
|
|
|
//
|
2016-12-02 03:45:22 +08:00
|
|
|
// void foo() { bar(); }
|
|
|
|
// void bar() { foo(); }
|
2016-02-26 02:43:51 +08:00
|
|
|
//
|
2016-12-02 03:45:22 +08:00
|
|
|
// If you merge the two, their relocations point to the same section and
|
2016-12-06 02:11:35 +08:00
|
|
|
// thus you know they are mergeable, but how do you know they are
|
|
|
|
// mergeable in the first place? This is not an easy problem to solve.
|
2016-02-26 02:43:51 +08:00
|
|
|
//
|
2016-12-06 02:11:35 +08:00
|
|
|
// What we are doing in LLD is to partition sections into equivalence
|
|
|
|
// classes. Sections in the same equivalence class when the algorithm
|
|
|
|
// terminates are considered identical. Here are details:
|
2016-02-26 02:43:51 +08:00
|
|
|
//
|
2016-12-06 02:11:35 +08:00
|
|
|
// 1. First, we partition sections using their hash values as keys. Hash
|
|
|
|
// values contain section types, section contents and numbers of
|
|
|
|
// relocations. During this step, relocation targets are not taken into
|
|
|
|
// account. We just put sections that apparently differ into different
|
|
|
|
// equivalence classes.
|
2016-02-26 02:43:51 +08:00
|
|
|
//
|
2016-12-06 02:11:35 +08:00
|
|
|
// 2. Next, for each equivalence class, we visit sections to compare
|
|
|
|
// relocation targets. Relocation targets are considered equivalent if
|
|
|
|
// their targets are in the same equivalence class. Sections with
|
|
|
|
// different relocation targets are put into different equivalence
|
|
|
|
// clases.
|
2016-12-02 03:45:22 +08:00
|
|
|
//
|
2016-12-06 02:11:35 +08:00
|
|
|
// 3. If we split an equivalence class in step 2, two relocations
|
|
|
|
// previously target the same equivalence class may now target
|
|
|
|
// different equivalence classes. Therefore, we repeat step 2 until a
|
|
|
|
// convergence is obtained.
|
2016-12-02 03:45:22 +08:00
|
|
|
//
|
2016-12-06 02:11:35 +08:00
|
|
|
// 4. For each equivalence class C, pick an arbitrary section in C, and
|
|
|
|
// merge all the other sections in C with it.
|
2016-12-02 03:45:22 +08:00
|
|
|
//
|
|
|
|
// For small programs, this algorithm needs 3-5 iterations. For large
|
|
|
|
// programs such as Chromium, it takes more than 20 iterations.
|
2016-02-26 02:43:51 +08:00
|
|
|
//
|
2016-12-06 02:11:35 +08:00
|
|
|
// This algorithm was mentioned as an "optimistic algorithm" in [1],
|
|
|
|
// though gold implements a different algorithm than this.
|
|
|
|
//
|
2016-12-02 03:45:22 +08:00
|
|
|
// We parallelize each step so that multiple threads can work on different
|
2016-12-06 02:11:35 +08:00
|
|
|
// equivalence classes concurrently. That gave us a large performance
|
|
|
|
// boost when applying ICF on large programs. For example, MSVC link.exe
|
|
|
|
// or GNU gold takes 10-20 seconds to apply ICF on Chromium, whose output
|
|
|
|
// size is about 1.5 GB, but LLD can finish it in less than 2 seconds on a
|
|
|
|
// 2.8 GHz 40 core machine. Even without threading, LLD's ICF is still
|
|
|
|
// faster than MSVC or gold though.
|
|
|
|
//
|
|
|
|
// [1] Safe ICF: Pointer Safe and Unwinding aware Identical Code Folding
|
|
|
|
// in the Gold Linker
|
|
|
|
// http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/36912.pdf
|
2016-02-26 02:43:51 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "ICF.h"
|
|
|
|
#include "Config.h"
|
|
|
|
#include "SymbolTable.h"
|
2016-12-04 05:24:51 +08:00
|
|
|
#include "Threads.h"
|
2016-02-26 02:43:51 +08:00
|
|
|
#include "llvm/ADT/Hashing.h"
|
2017-06-07 11:48:56 +08:00
|
|
|
#include "llvm/BinaryFormat/ELF.h"
|
2016-02-26 02:43:51 +08:00
|
|
|
#include "llvm/Object/ELF.h"
|
2016-11-20 04:15:55 +08:00
|
|
|
#include <algorithm>
|
2016-12-02 13:35:46 +08:00
|
|
|
#include <atomic>
|
2016-02-26 02:43:51 +08:00
|
|
|
|
|
|
|
using namespace lld;
|
2016-02-28 08:25:54 +08:00
|
|
|
using namespace lld::elf;
|
2016-02-26 02:43:51 +08:00
|
|
|
using namespace llvm;
|
|
|
|
using namespace llvm::ELF;
|
|
|
|
using namespace llvm::object;
|
|
|
|
|
2016-11-20 10:39:59 +08:00
|
|
|
namespace {
|
2016-02-26 02:43:51 +08:00
|
|
|
template <class ELFT> class ICF {
|
|
|
|
public:
|
2016-05-03 03:30:42 +08:00
|
|
|
void run();
|
2016-02-26 02:43:51 +08:00
|
|
|
|
|
|
|
private:
|
2016-12-02 13:35:46 +08:00
|
|
|
void segregate(size_t Begin, size_t End, bool Constant);
|
2016-11-30 09:50:03 +08:00
|
|
|
|
|
|
|
template <class RelTy>
|
2017-06-12 08:05:54 +08:00
|
|
|
bool constantEq(const InputSection *A, ArrayRef<RelTy> RelsA,
|
|
|
|
const InputSection *B, ArrayRef<RelTy> RelsB);
|
2016-11-30 09:50:03 +08:00
|
|
|
|
|
|
|
template <class RelTy>
|
2017-02-24 00:49:07 +08:00
|
|
|
bool variableEq(const InputSection *A, ArrayRef<RelTy> RelsA,
|
|
|
|
const InputSection *B, ArrayRef<RelTy> RelsB);
|
2016-02-26 02:43:51 +08:00
|
|
|
|
2017-02-24 00:49:07 +08:00
|
|
|
bool equalsConstant(const InputSection *A, const InputSection *B);
|
|
|
|
bool equalsVariable(const InputSection *A, const InputSection *B);
|
2016-02-26 02:43:51 +08:00
|
|
|
|
2016-12-02 13:35:46 +08:00
|
|
|
size_t findBoundary(size_t Begin, size_t End);
|
|
|
|
|
2016-12-06 02:11:35 +08:00
|
|
|
void forEachClassRange(size_t Begin, size_t End,
|
2016-12-02 13:35:46 +08:00
|
|
|
std::function<void(size_t, size_t)> Fn);
|
2016-02-26 02:43:51 +08:00
|
|
|
|
2016-12-06 02:11:35 +08:00
|
|
|
void forEachClass(std::function<void(size_t, size_t)> Fn);
|
2016-12-02 13:35:46 +08:00
|
|
|
|
2017-02-24 00:49:07 +08:00
|
|
|
std::vector<InputSection *> Sections;
|
2016-12-05 00:33:13 +08:00
|
|
|
|
|
|
|
// We repeat the main loop while `Repeat` is true.
|
|
|
|
std::atomic<bool> Repeat;
|
|
|
|
|
|
|
|
// The main loop counter.
|
Parallelize ICF to make LLD's ICF really fast.
ICF is short for Identical Code Folding. It is a size optimization to
identify two or more functions that happened to have the same contents
to merges them. It usually reduces output size by a few percent.
ICF is slow because it is computationally intensive process. I tried
to paralellize it before but failed because I couldn't make a
parallelized version produce consistent outputs. Although it didn't
create broken executables, every invocation of the linker generated
slightly different output, and I couldn't figure out why.
I think I now understand what was going on, and also came up with a
simple algorithm to fix it. So is this patch.
The result is very exciting. Chromium for example has 780,662 input
sections in which 20,774 are reducible by ICF. LLD previously took
7.980 seconds for ICF. Now it finishes in 1.065 seconds.
As a result, LLD can now link a Chromium binary (output size 1.59 GB)
in 10.28 seconds on my machine with ICF enabled. Compared to gold
which takes 40.94 seconds to do the same thing, this is an amazing
number.
From here, I'll describe what we are doing for ICF, what was the
previous problem, and what I did in this patch.
In ICF, two sections are considered identical if they have the same
section flags, section data, and relocations. Relocations are tricky,
becuase two relocations are considered the same if they have the same
relocation type, values, and if they point to the same section _in
terms of ICF_.
Here is an example. If foo and bar defined below are compiled to the
same machine instructions, ICF can (and should) merge the two,
although their relocations point to each other.
void foo() { bar(); }
void bar() { foo(); }
This is not an easy problem to solve.
What we are doing in LLD is some sort of coloring algorithm. We color
non-identical sections using different colors repeatedly, and sections
in the same color when the algorithm terminates are considered
identical. Here is the details:
1. First, we color all sections using their hash values of section
types, section contents, and numbers of relocations. At this moment,
relocation targets are not taken into account. We just color
sections that apparently differ in different colors.
2. Next, for each color C, we visit sections having color C to see
if their relocations are the same. Relocations are considered equal
if their targets have the same color. We then recolor sections that
have different relocation targets in new colors.
3. If we recolor some section in step 2, relocations that were
previously pointing to the same color targets may now be pointing to
different colors. Therefore, repeat 2 until a convergence is
obtained.
Step 2 is a heavy operation. For Chromium, the first iteration of step
2 takes 2.882 seconds, and the second iteration takes 1.038 seconds,
and in total it needs 23 iterations.
Parallelizing step 1 is easy because we can color each section
independently. This patch does that.
Parallelizing step 2 is tricky. We could work on each color
independently, but we cannot recolor sections in place, because it
will break the invariance that two possibly-identical sections must
have the same color at any moment.
Consider sections S1, S2, S3, S4 in the same color C, where S1 and S2
are identical, S3 and S4 are identical, but S2 and S3 are not. Thread
A is about to recolor S1 and S2 in C'. After thread A recolor S1 in
C', but before recolor S2 in C', other thread B might observe S1 and
S2. Then thread B will conclude that S1 and S2 are different, and it
will split thread B's sections into smaller groups wrongly. Over-
splitting doesn't produce broken results, but it loses a chance to
merge some identical sections. That was the cause of indeterminism.
To fix the problem, I made sections have two colors, namely current
color and next color. At the beginning of each iteration, both colors
are the same. Each thread reads from current color and writes to next
color. In this way, we can avoid threads from reading partial
results. After each iteration, we flip current and next.
This is a very simple solution and is implemented in less than 50
lines of code.
I tested this patch with Chromium and confirmed that this parallelized
ICF produces the identical output as the non-parallelized one.
Differential Revision: https://reviews.llvm.org/D27247
llvm-svn: 288373
2016-12-02 01:09:04 +08:00
|
|
|
int Cnt = 0;
|
2016-12-05 00:33:13 +08:00
|
|
|
|
2016-12-06 02:11:35 +08:00
|
|
|
// We have two locations for equivalence classes. On the first iteration
|
|
|
|
// of the main loop, Class[0] has a valid value, and Class[1] contains
|
|
|
|
// garbage. We read equivalence classes from slot 0 and write to slot 1.
|
|
|
|
// So, Class[0] represents the current class, and Class[1] represents
|
|
|
|
// the next class. On each iteration, we switch their roles and use them
|
|
|
|
// alternately.
|
2016-12-05 00:33:13 +08:00
|
|
|
//
|
|
|
|
// Why are we doing this? Recall that other threads may be working on
|
2016-12-06 02:11:35 +08:00
|
|
|
// other equivalence classes in parallel. They may read sections that we
|
|
|
|
// are updating. We cannot update equivalence classes in place because
|
|
|
|
// it breaks the invariance that all possibly-identical sections must be
|
|
|
|
// in the same equivalence class at any moment. In other words, the for
|
|
|
|
// loop to update equivalence classes is not atomic, and that is
|
|
|
|
// observable from other threads. By writing new classes to other
|
|
|
|
// places, we can keep the invariance.
|
2016-12-05 00:33:13 +08:00
|
|
|
//
|
2016-12-06 02:11:35 +08:00
|
|
|
// Below, `Current` has the index of the current class, and `Next` has
|
|
|
|
// the index of the next class. If threading is enabled, they are either
|
|
|
|
// (0, 1) or (1, 0).
|
2016-12-05 00:33:13 +08:00
|
|
|
//
|
|
|
|
// Note on single-thread: if that's the case, they are always (0, 0)
|
2016-12-06 02:11:35 +08:00
|
|
|
// because we can safely read the next class without worrying about race
|
2016-12-05 00:33:13 +08:00
|
|
|
// conditions. Using the same location makes this algorithm converge
|
|
|
|
// faster because it uses results of the same iteration earlier.
|
|
|
|
int Current = 0;
|
|
|
|
int Next = 0;
|
2016-02-26 02:43:51 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns a hash value for S. Note that the information about
|
|
|
|
// relocation targets is not included in the hash value.
|
2017-02-24 00:49:07 +08:00
|
|
|
template <class ELFT> static uint32_t getHash(InputSection *S) {
|
2017-03-08 23:44:30 +08:00
|
|
|
return hash_combine(S->Flags, S->getSize(), S->NumRelocations);
|
2016-02-26 02:43:51 +08:00
|
|
|
}
|
|
|
|
|
2016-11-20 10:39:59 +08:00
|
|
|
// Returns true if section S is subject of ICF.
|
2017-02-27 10:32:08 +08:00
|
|
|
static bool isEligible(InputSection *S) {
|
2016-02-26 02:43:51 +08:00
|
|
|
// .init and .fini contains instructions that must be executed to
|
|
|
|
// initialize and finalize the process. They cannot and should not
|
|
|
|
// be merged.
|
2017-03-01 06:42:49 +08:00
|
|
|
return S->Live && (S->Flags & SHF_ALLOC) && (S->Flags & SHF_EXECINSTR) &&
|
|
|
|
!(S->Flags & SHF_WRITE) && S->Name != ".init" && S->Name != ".fini";
|
2016-02-26 02:43:51 +08:00
|
|
|
}
|
|
|
|
|
2016-12-06 02:11:35 +08:00
|
|
|
// Split an equivalence class into smaller classes.
|
2016-12-02 13:35:46 +08:00
|
|
|
template <class ELFT>
|
|
|
|
void ICF<ELFT>::segregate(size_t Begin, size_t End, bool Constant) {
|
|
|
|
// This loop rearranges sections in [Begin, End) so that all sections
|
2016-11-30 09:50:03 +08:00
|
|
|
// that are equal in terms of equals{Constant,Variable} are contiguous
|
2016-12-02 13:35:46 +08:00
|
|
|
// in [Begin, End).
|
2016-11-30 09:50:03 +08:00
|
|
|
//
|
|
|
|
// The algorithm is quadratic in the worst case, but that is not an
|
|
|
|
// issue in practice because the number of the distinct sections in
|
2016-12-02 13:35:46 +08:00
|
|
|
// each range is usually very small.
|
Parallelize ICF to make LLD's ICF really fast.
ICF is short for Identical Code Folding. It is a size optimization to
identify two or more functions that happened to have the same contents
to merges them. It usually reduces output size by a few percent.
ICF is slow because it is computationally intensive process. I tried
to paralellize it before but failed because I couldn't make a
parallelized version produce consistent outputs. Although it didn't
create broken executables, every invocation of the linker generated
slightly different output, and I couldn't figure out why.
I think I now understand what was going on, and also came up with a
simple algorithm to fix it. So is this patch.
The result is very exciting. Chromium for example has 780,662 input
sections in which 20,774 are reducible by ICF. LLD previously took
7.980 seconds for ICF. Now it finishes in 1.065 seconds.
As a result, LLD can now link a Chromium binary (output size 1.59 GB)
in 10.28 seconds on my machine with ICF enabled. Compared to gold
which takes 40.94 seconds to do the same thing, this is an amazing
number.
From here, I'll describe what we are doing for ICF, what was the
previous problem, and what I did in this patch.
In ICF, two sections are considered identical if they have the same
section flags, section data, and relocations. Relocations are tricky,
becuase two relocations are considered the same if they have the same
relocation type, values, and if they point to the same section _in
terms of ICF_.
Here is an example. If foo and bar defined below are compiled to the
same machine instructions, ICF can (and should) merge the two,
although their relocations point to each other.
void foo() { bar(); }
void bar() { foo(); }
This is not an easy problem to solve.
What we are doing in LLD is some sort of coloring algorithm. We color
non-identical sections using different colors repeatedly, and sections
in the same color when the algorithm terminates are considered
identical. Here is the details:
1. First, we color all sections using their hash values of section
types, section contents, and numbers of relocations. At this moment,
relocation targets are not taken into account. We just color
sections that apparently differ in different colors.
2. Next, for each color C, we visit sections having color C to see
if their relocations are the same. Relocations are considered equal
if their targets have the same color. We then recolor sections that
have different relocation targets in new colors.
3. If we recolor some section in step 2, relocations that were
previously pointing to the same color targets may now be pointing to
different colors. Therefore, repeat 2 until a convergence is
obtained.
Step 2 is a heavy operation. For Chromium, the first iteration of step
2 takes 2.882 seconds, and the second iteration takes 1.038 seconds,
and in total it needs 23 iterations.
Parallelizing step 1 is easy because we can color each section
independently. This patch does that.
Parallelizing step 2 is tricky. We could work on each color
independently, but we cannot recolor sections in place, because it
will break the invariance that two possibly-identical sections must
have the same color at any moment.
Consider sections S1, S2, S3, S4 in the same color C, where S1 and S2
are identical, S3 and S4 are identical, but S2 and S3 are not. Thread
A is about to recolor S1 and S2 in C'. After thread A recolor S1 in
C', but before recolor S2 in C', other thread B might observe S1 and
S2. Then thread B will conclude that S1 and S2 are different, and it
will split thread B's sections into smaller groups wrongly. Over-
splitting doesn't produce broken results, but it loses a chance to
merge some identical sections. That was the cause of indeterminism.
To fix the problem, I made sections have two colors, namely current
color and next color. At the beginning of each iteration, both colors
are the same. Each thread reads from current color and writes to next
color. In this way, we can avoid threads from reading partial
results. After each iteration, we flip current and next.
This is a very simple solution and is implemented in less than 50
lines of code.
I tested this patch with Chromium and confirmed that this parallelized
ICF produces the identical output as the non-parallelized one.
Differential Revision: https://reviews.llvm.org/D27247
llvm-svn: 288373
2016-12-02 01:09:04 +08:00
|
|
|
|
2016-12-02 13:35:46 +08:00
|
|
|
while (Begin < End) {
|
|
|
|
// Divide [Begin, End) into two. Let Mid be the start index of the
|
2016-11-30 09:50:03 +08:00
|
|
|
// second group.
|
2017-02-24 00:49:07 +08:00
|
|
|
auto Bound =
|
|
|
|
std::stable_partition(Sections.begin() + Begin + 1,
|
|
|
|
Sections.begin() + End, [&](InputSection *S) {
|
|
|
|
if (Constant)
|
|
|
|
return equalsConstant(Sections[Begin], S);
|
|
|
|
return equalsVariable(Sections[Begin], S);
|
|
|
|
});
|
2016-11-30 09:50:03 +08:00
|
|
|
size_t Mid = Bound - Sections.begin();
|
|
|
|
|
2016-12-02 13:35:46 +08:00
|
|
|
// Now we split [Begin, End) into [Begin, Mid) and [Mid, End) by
|
2017-01-15 10:34:42 +08:00
|
|
|
// updating the sections in [Begin, Mid). We use Mid as an equivalence
|
2016-12-06 02:11:35 +08:00
|
|
|
// class ID because every group ends with a unique index.
|
2016-12-02 13:35:46 +08:00
|
|
|
for (size_t I = Begin; I < Mid; ++I)
|
2016-12-06 02:11:35 +08:00
|
|
|
Sections[I]->Class[Next] = Mid;
|
2016-12-02 13:35:46 +08:00
|
|
|
|
|
|
|
// If we created a group, we need to iterate the main loop again.
|
|
|
|
if (Mid != End)
|
|
|
|
Repeat = true;
|
Parallelize ICF to make LLD's ICF really fast.
ICF is short for Identical Code Folding. It is a size optimization to
identify two or more functions that happened to have the same contents
to merges them. It usually reduces output size by a few percent.
ICF is slow because it is computationally intensive process. I tried
to paralellize it before but failed because I couldn't make a
parallelized version produce consistent outputs. Although it didn't
create broken executables, every invocation of the linker generated
slightly different output, and I couldn't figure out why.
I think I now understand what was going on, and also came up with a
simple algorithm to fix it. So is this patch.
The result is very exciting. Chromium for example has 780,662 input
sections in which 20,774 are reducible by ICF. LLD previously took
7.980 seconds for ICF. Now it finishes in 1.065 seconds.
As a result, LLD can now link a Chromium binary (output size 1.59 GB)
in 10.28 seconds on my machine with ICF enabled. Compared to gold
which takes 40.94 seconds to do the same thing, this is an amazing
number.
From here, I'll describe what we are doing for ICF, what was the
previous problem, and what I did in this patch.
In ICF, two sections are considered identical if they have the same
section flags, section data, and relocations. Relocations are tricky,
becuase two relocations are considered the same if they have the same
relocation type, values, and if they point to the same section _in
terms of ICF_.
Here is an example. If foo and bar defined below are compiled to the
same machine instructions, ICF can (and should) merge the two,
although their relocations point to each other.
void foo() { bar(); }
void bar() { foo(); }
This is not an easy problem to solve.
What we are doing in LLD is some sort of coloring algorithm. We color
non-identical sections using different colors repeatedly, and sections
in the same color when the algorithm terminates are considered
identical. Here is the details:
1. First, we color all sections using their hash values of section
types, section contents, and numbers of relocations. At this moment,
relocation targets are not taken into account. We just color
sections that apparently differ in different colors.
2. Next, for each color C, we visit sections having color C to see
if their relocations are the same. Relocations are considered equal
if their targets have the same color. We then recolor sections that
have different relocation targets in new colors.
3. If we recolor some section in step 2, relocations that were
previously pointing to the same color targets may now be pointing to
different colors. Therefore, repeat 2 until a convergence is
obtained.
Step 2 is a heavy operation. For Chromium, the first iteration of step
2 takes 2.882 seconds, and the second iteration takes 1.038 seconds,
and in total it needs 23 iterations.
Parallelizing step 1 is easy because we can color each section
independently. This patch does that.
Parallelizing step 2 is tricky. We could work on each color
independently, but we cannot recolor sections in place, because it
will break the invariance that two possibly-identical sections must
have the same color at any moment.
Consider sections S1, S2, S3, S4 in the same color C, where S1 and S2
are identical, S3 and S4 are identical, but S2 and S3 are not. Thread
A is about to recolor S1 and S2 in C'. After thread A recolor S1 in
C', but before recolor S2 in C', other thread B might observe S1 and
S2. Then thread B will conclude that S1 and S2 are different, and it
will split thread B's sections into smaller groups wrongly. Over-
splitting doesn't produce broken results, but it loses a chance to
merge some identical sections. That was the cause of indeterminism.
To fix the problem, I made sections have two colors, namely current
color and next color. At the beginning of each iteration, both colors
are the same. Each thread reads from current color and writes to next
color. In this way, we can avoid threads from reading partial
results. After each iteration, we flip current and next.
This is a very simple solution and is implemented in less than 50
lines of code.
I tested this patch with Chromium and confirmed that this parallelized
ICF produces the identical output as the non-parallelized one.
Differential Revision: https://reviews.llvm.org/D27247
llvm-svn: 288373
2016-12-02 01:09:04 +08:00
|
|
|
|
2016-12-02 13:35:46 +08:00
|
|
|
Begin = Mid;
|
2016-02-26 02:43:51 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Compare two lists of relocations.
|
2016-11-30 09:50:03 +08:00
|
|
|
template <class ELFT>
|
|
|
|
template <class RelTy>
|
2017-06-12 08:05:54 +08:00
|
|
|
bool ICF<ELFT>::constantEq(const InputSection *A, ArrayRef<RelTy> RelsA,
|
|
|
|
const InputSection *B, ArrayRef<RelTy> RelsB) {
|
|
|
|
auto Eq = [&](const RelTy &RA, const RelTy &RB) {
|
|
|
|
if (RA.r_offset != RB.r_offset ||
|
|
|
|
RA.getType(Config->IsMips64EL) != RB.getType(Config->IsMips64EL))
|
|
|
|
return false;
|
|
|
|
uint64_t AddA = getAddend<ELFT>(RA);
|
|
|
|
uint64_t AddB = getAddend<ELFT>(RB);
|
|
|
|
|
|
|
|
SymbolBody &SA = A->template getFile<ELFT>()->getRelocTargetSym(RA);
|
|
|
|
SymbolBody &SB = B->template getFile<ELFT>()->getRelocTargetSym(RB);
|
|
|
|
if (&SA == &SB)
|
|
|
|
return AddA == AddB;
|
|
|
|
|
|
|
|
auto *DA = dyn_cast<DefinedRegular>(&SA);
|
|
|
|
auto *DB = dyn_cast<DefinedRegular>(&SB);
|
|
|
|
if (!DA || !DB)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Relocations referring to absolute symbols are constant-equal if their
|
|
|
|
// values are equal.
|
|
|
|
if (!DA->Section || !DB->Section)
|
|
|
|
return !DA->Section && !DB->Section &&
|
|
|
|
DA->Value + AddA == DB->Value + AddB;
|
|
|
|
|
|
|
|
if (DA->Section->kind() != DB->Section->kind())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Relocations referring to InputSections are constant-equal if their
|
|
|
|
// section offsets are equal.
|
|
|
|
if (isa<InputSection>(DA->Section))
|
|
|
|
return DA->Value + AddA == DB->Value + AddB;
|
|
|
|
|
|
|
|
// Relocations referring to MergeInputSections are constant-equal if their
|
|
|
|
// offsets in the output section are equal.
|
|
|
|
auto *X = dyn_cast<MergeInputSection>(DA->Section);
|
|
|
|
if (!X)
|
|
|
|
return false;
|
|
|
|
auto *Y = cast<MergeInputSection>(DB->Section);
|
|
|
|
if (X->getParent() != Y->getParent())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
uint64_t OffsetA =
|
|
|
|
SA.isSection() ? X->getOffset(AddA) : X->getOffset(DA->Value) + AddA;
|
|
|
|
uint64_t OffsetB =
|
|
|
|
SB.isSection() ? Y->getOffset(AddB) : Y->getOffset(DB->Value) + AddB;
|
|
|
|
return OffsetA == OffsetB;
|
2016-11-20 04:15:55 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
return RelsA.size() == RelsB.size() &&
|
|
|
|
std::equal(RelsA.begin(), RelsA.end(), RelsB.begin(), Eq);
|
2016-02-26 02:43:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Compare "non-moving" part of two InputSections, namely everything
|
|
|
|
// except relocation targets.
|
|
|
|
template <class ELFT>
|
2017-02-24 00:49:07 +08:00
|
|
|
bool ICF<ELFT>::equalsConstant(const InputSection *A, const InputSection *B) {
|
2016-11-20 10:39:59 +08:00
|
|
|
if (A->NumRelocations != B->NumRelocations || A->Flags != B->Flags ||
|
2017-03-08 23:44:30 +08:00
|
|
|
A->getSize() != B->getSize() || A->Data != B->Data)
|
2016-02-26 02:43:51 +08:00
|
|
|
return false;
|
|
|
|
|
2016-11-20 10:39:59 +08:00
|
|
|
if (A->AreRelocsRela)
|
2017-06-12 08:05:54 +08:00
|
|
|
return constantEq(A, A->template relas<ELFT>(), B,
|
|
|
|
B->template relas<ELFT>());
|
|
|
|
return constantEq(A, A->template rels<ELFT>(), B, B->template rels<ELFT>());
|
2016-02-26 02:43:51 +08:00
|
|
|
}
|
|
|
|
|
2016-11-21 07:15:54 +08:00
|
|
|
// Compare two lists of relocations. Returns true if all pairs of
|
|
|
|
// relocations point to the same section in terms of ICF.
|
2016-11-30 09:50:03 +08:00
|
|
|
template <class ELFT>
|
|
|
|
template <class RelTy>
|
2017-02-24 00:49:07 +08:00
|
|
|
bool ICF<ELFT>::variableEq(const InputSection *A, ArrayRef<RelTy> RelsA,
|
|
|
|
const InputSection *B, ArrayRef<RelTy> RelsB) {
|
2016-11-20 04:15:55 +08:00
|
|
|
auto Eq = [&](const RelTy &RA, const RelTy &RB) {
|
2016-12-02 03:45:22 +08:00
|
|
|
// The two sections must be identical.
|
2017-02-23 10:28:28 +08:00
|
|
|
SymbolBody &SA = A->template getFile<ELFT>()->getRelocTargetSym(RA);
|
|
|
|
SymbolBody &SB = B->template getFile<ELFT>()->getRelocTargetSym(RB);
|
2016-03-11 20:06:30 +08:00
|
|
|
if (&SA == &SB)
|
2016-11-20 04:15:55 +08:00
|
|
|
return true;
|
2016-02-26 02:43:51 +08:00
|
|
|
|
2017-06-12 08:05:54 +08:00
|
|
|
auto *DA = cast<DefinedRegular>(&SA);
|
|
|
|
auto *DB = cast<DefinedRegular>(&SB);
|
2017-01-20 12:58:12 +08:00
|
|
|
|
2017-06-12 08:05:54 +08:00
|
|
|
// We already dealt with absolute and non-InputSection symbols in
|
|
|
|
// constantEq, and for InputSections we have already checked everything
|
|
|
|
// except the equivalence class.
|
|
|
|
if (!DA->Section)
|
|
|
|
return true;
|
2017-02-24 00:49:07 +08:00
|
|
|
auto *X = dyn_cast<InputSection>(DA->Section);
|
2017-06-12 08:05:54 +08:00
|
|
|
if (!X)
|
|
|
|
return true;
|
|
|
|
auto *Y = cast<InputSection>(DB->Section);
|
Parallelize ICF to make LLD's ICF really fast.
ICF is short for Identical Code Folding. It is a size optimization to
identify two or more functions that happened to have the same contents
to merges them. It usually reduces output size by a few percent.
ICF is slow because it is computationally intensive process. I tried
to paralellize it before but failed because I couldn't make a
parallelized version produce consistent outputs. Although it didn't
create broken executables, every invocation of the linker generated
slightly different output, and I couldn't figure out why.
I think I now understand what was going on, and also came up with a
simple algorithm to fix it. So is this patch.
The result is very exciting. Chromium for example has 780,662 input
sections in which 20,774 are reducible by ICF. LLD previously took
7.980 seconds for ICF. Now it finishes in 1.065 seconds.
As a result, LLD can now link a Chromium binary (output size 1.59 GB)
in 10.28 seconds on my machine with ICF enabled. Compared to gold
which takes 40.94 seconds to do the same thing, this is an amazing
number.
From here, I'll describe what we are doing for ICF, what was the
previous problem, and what I did in this patch.
In ICF, two sections are considered identical if they have the same
section flags, section data, and relocations. Relocations are tricky,
becuase two relocations are considered the same if they have the same
relocation type, values, and if they point to the same section _in
terms of ICF_.
Here is an example. If foo and bar defined below are compiled to the
same machine instructions, ICF can (and should) merge the two,
although their relocations point to each other.
void foo() { bar(); }
void bar() { foo(); }
This is not an easy problem to solve.
What we are doing in LLD is some sort of coloring algorithm. We color
non-identical sections using different colors repeatedly, and sections
in the same color when the algorithm terminates are considered
identical. Here is the details:
1. First, we color all sections using their hash values of section
types, section contents, and numbers of relocations. At this moment,
relocation targets are not taken into account. We just color
sections that apparently differ in different colors.
2. Next, for each color C, we visit sections having color C to see
if their relocations are the same. Relocations are considered equal
if their targets have the same color. We then recolor sections that
have different relocation targets in new colors.
3. If we recolor some section in step 2, relocations that were
previously pointing to the same color targets may now be pointing to
different colors. Therefore, repeat 2 until a convergence is
obtained.
Step 2 is a heavy operation. For Chromium, the first iteration of step
2 takes 2.882 seconds, and the second iteration takes 1.038 seconds,
and in total it needs 23 iterations.
Parallelizing step 1 is easy because we can color each section
independently. This patch does that.
Parallelizing step 2 is tricky. We could work on each color
independently, but we cannot recolor sections in place, because it
will break the invariance that two possibly-identical sections must
have the same color at any moment.
Consider sections S1, S2, S3, S4 in the same color C, where S1 and S2
are identical, S3 and S4 are identical, but S2 and S3 are not. Thread
A is about to recolor S1 and S2 in C'. After thread A recolor S1 in
C', but before recolor S2 in C', other thread B might observe S1 and
S2. Then thread B will conclude that S1 and S2 are different, and it
will split thread B's sections into smaller groups wrongly. Over-
splitting doesn't produce broken results, but it loses a chance to
merge some identical sections. That was the cause of indeterminism.
To fix the problem, I made sections have two colors, namely current
color and next color. At the beginning of each iteration, both colors
are the same. Each thread reads from current color and writes to next
color. In this way, we can avoid threads from reading partial
results. After each iteration, we flip current and next.
This is a very simple solution and is implemented in less than 50
lines of code.
I tested this patch with Chromium and confirmed that this parallelized
ICF produces the identical output as the non-parallelized one.
Differential Revision: https://reviews.llvm.org/D27247
llvm-svn: 288373
2016-12-02 01:09:04 +08:00
|
|
|
|
2016-12-06 02:11:35 +08:00
|
|
|
// Ineligible sections are in the special equivalence class 0.
|
|
|
|
// They can never be the same in terms of the equivalence class.
|
|
|
|
if (X->Class[Current] == 0)
|
2016-12-03 01:23:58 +08:00
|
|
|
return false;
|
2016-12-02 05:41:06 +08:00
|
|
|
|
2016-12-06 02:11:35 +08:00
|
|
|
return X->Class[Current] == Y->Class[Current];
|
2016-11-20 04:15:55 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
return std::equal(RelsA.begin(), RelsA.end(), RelsB.begin(), Eq);
|
2016-02-26 02:43:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Compare "moving" part of two InputSections, namely relocation targets.
|
|
|
|
template <class ELFT>
|
2017-02-24 00:49:07 +08:00
|
|
|
bool ICF<ELFT>::equalsVariable(const InputSection *A, const InputSection *B) {
|
2016-11-10 22:53:24 +08:00
|
|
|
if (A->AreRelocsRela)
|
2017-02-23 10:28:28 +08:00
|
|
|
return variableEq(A, A->template relas<ELFT>(), B,
|
|
|
|
B->template relas<ELFT>());
|
|
|
|
return variableEq(A, A->template rels<ELFT>(), B, B->template rels<ELFT>());
|
2016-02-26 02:43:51 +08:00
|
|
|
}
|
|
|
|
|
2016-12-02 13:35:46 +08:00
|
|
|
template <class ELFT> size_t ICF<ELFT>::findBoundary(size_t Begin, size_t End) {
|
2016-12-06 02:11:35 +08:00
|
|
|
uint32_t Class = Sections[Begin]->Class[Current];
|
2016-12-02 13:35:46 +08:00
|
|
|
for (size_t I = Begin + 1; I < End; ++I)
|
2016-12-06 02:11:35 +08:00
|
|
|
if (Class != Sections[I]->Class[Current])
|
2016-12-02 13:35:46 +08:00
|
|
|
return I;
|
|
|
|
return End;
|
|
|
|
}
|
|
|
|
|
2016-12-06 02:11:35 +08:00
|
|
|
// Sections in the same equivalence class are contiguous in Sections
|
|
|
|
// vector. Therefore, Sections vector can be considered as contiguous
|
|
|
|
// groups of sections, grouped by the class.
|
2016-12-02 13:35:46 +08:00
|
|
|
//
|
|
|
|
// This function calls Fn on every group that starts within [Begin, End).
|
2017-01-15 10:34:42 +08:00
|
|
|
// Note that a group must start in that range but doesn't necessarily
|
2016-12-02 13:35:46 +08:00
|
|
|
// have to end before End.
|
|
|
|
template <class ELFT>
|
2016-12-06 02:11:35 +08:00
|
|
|
void ICF<ELFT>::forEachClassRange(size_t Begin, size_t End,
|
2016-12-02 13:35:46 +08:00
|
|
|
std::function<void(size_t, size_t)> Fn) {
|
|
|
|
if (Begin > 0)
|
|
|
|
Begin = findBoundary(Begin - 1, End);
|
|
|
|
|
|
|
|
while (Begin < End) {
|
|
|
|
size_t Mid = findBoundary(Begin, Sections.size());
|
|
|
|
Fn(Begin, Mid);
|
|
|
|
Begin = Mid;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-06 02:11:35 +08:00
|
|
|
// Call Fn on each equivalence class.
|
2016-12-02 13:35:46 +08:00
|
|
|
template <class ELFT>
|
2016-12-06 02:11:35 +08:00
|
|
|
void ICF<ELFT>::forEachClass(std::function<void(size_t, size_t)> Fn) {
|
2016-12-02 13:35:46 +08:00
|
|
|
// If threading is disabled or the number of sections are
|
|
|
|
// too small to use threading, call Fn sequentially.
|
|
|
|
if (!Config->Threads || Sections.size() < 1024) {
|
2016-12-06 02:11:35 +08:00
|
|
|
forEachClassRange(0, Sections.size(), Fn);
|
2016-12-05 00:33:13 +08:00
|
|
|
++Cnt;
|
2016-12-02 13:35:46 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-12-05 00:33:13 +08:00
|
|
|
Current = Cnt % 2;
|
|
|
|
Next = (Cnt + 1) % 2;
|
|
|
|
|
2016-12-02 13:35:46 +08:00
|
|
|
// Split sections into 256 shards and call Fn in parallel.
|
|
|
|
size_t NumShards = 256;
|
|
|
|
size_t Step = Sections.size() / NumShards;
|
2017-05-11 04:02:19 +08:00
|
|
|
parallelForEachN(0, NumShards, [&](size_t I) {
|
2017-05-25 03:22:34 +08:00
|
|
|
size_t End = (I == NumShards - 1) ? Sections.size() : (I + 1) * Step;
|
|
|
|
forEachClassRange(I * Step, End, Fn);
|
2017-03-23 07:03:35 +08:00
|
|
|
});
|
2016-12-05 00:33:13 +08:00
|
|
|
++Cnt;
|
Parallelize ICF to make LLD's ICF really fast.
ICF is short for Identical Code Folding. It is a size optimization to
identify two or more functions that happened to have the same contents
to merges them. It usually reduces output size by a few percent.
ICF is slow because it is computationally intensive process. I tried
to paralellize it before but failed because I couldn't make a
parallelized version produce consistent outputs. Although it didn't
create broken executables, every invocation of the linker generated
slightly different output, and I couldn't figure out why.
I think I now understand what was going on, and also came up with a
simple algorithm to fix it. So is this patch.
The result is very exciting. Chromium for example has 780,662 input
sections in which 20,774 are reducible by ICF. LLD previously took
7.980 seconds for ICF. Now it finishes in 1.065 seconds.
As a result, LLD can now link a Chromium binary (output size 1.59 GB)
in 10.28 seconds on my machine with ICF enabled. Compared to gold
which takes 40.94 seconds to do the same thing, this is an amazing
number.
From here, I'll describe what we are doing for ICF, what was the
previous problem, and what I did in this patch.
In ICF, two sections are considered identical if they have the same
section flags, section data, and relocations. Relocations are tricky,
becuase two relocations are considered the same if they have the same
relocation type, values, and if they point to the same section _in
terms of ICF_.
Here is an example. If foo and bar defined below are compiled to the
same machine instructions, ICF can (and should) merge the two,
although their relocations point to each other.
void foo() { bar(); }
void bar() { foo(); }
This is not an easy problem to solve.
What we are doing in LLD is some sort of coloring algorithm. We color
non-identical sections using different colors repeatedly, and sections
in the same color when the algorithm terminates are considered
identical. Here is the details:
1. First, we color all sections using their hash values of section
types, section contents, and numbers of relocations. At this moment,
relocation targets are not taken into account. We just color
sections that apparently differ in different colors.
2. Next, for each color C, we visit sections having color C to see
if their relocations are the same. Relocations are considered equal
if their targets have the same color. We then recolor sections that
have different relocation targets in new colors.
3. If we recolor some section in step 2, relocations that were
previously pointing to the same color targets may now be pointing to
different colors. Therefore, repeat 2 until a convergence is
obtained.
Step 2 is a heavy operation. For Chromium, the first iteration of step
2 takes 2.882 seconds, and the second iteration takes 1.038 seconds,
and in total it needs 23 iterations.
Parallelizing step 1 is easy because we can color each section
independently. This patch does that.
Parallelizing step 2 is tricky. We could work on each color
independently, but we cannot recolor sections in place, because it
will break the invariance that two possibly-identical sections must
have the same color at any moment.
Consider sections S1, S2, S3, S4 in the same color C, where S1 and S2
are identical, S3 and S4 are identical, but S2 and S3 are not. Thread
A is about to recolor S1 and S2 in C'. After thread A recolor S1 in
C', but before recolor S2 in C', other thread B might observe S1 and
S2. Then thread B will conclude that S1 and S2 are different, and it
will split thread B's sections into smaller groups wrongly. Over-
splitting doesn't produce broken results, but it loses a chance to
merge some identical sections. That was the cause of indeterminism.
To fix the problem, I made sections have two colors, namely current
color and next color. At the beginning of each iteration, both colors
are the same. Each thread reads from current color and writes to next
color. In this way, we can avoid threads from reading partial
results. After each iteration, we flip current and next.
This is a very simple solution and is implemented in less than 50
lines of code.
I tested this patch with Chromium and confirmed that this parallelized
ICF produces the identical output as the non-parallelized one.
Differential Revision: https://reviews.llvm.org/D27247
llvm-svn: 288373
2016-12-02 01:09:04 +08:00
|
|
|
}
|
|
|
|
|
2016-02-26 02:43:51 +08:00
|
|
|
// The main function of ICF.
|
2016-05-03 03:30:42 +08:00
|
|
|
template <class ELFT> void ICF<ELFT>::run() {
|
2016-11-30 09:50:03 +08:00
|
|
|
// Collect sections to merge.
|
2017-02-27 10:32:08 +08:00
|
|
|
for (InputSectionBase *Sec : InputSections)
|
2017-02-24 00:49:07 +08:00
|
|
|
if (auto *S = dyn_cast<InputSection>(Sec))
|
2017-02-27 10:32:08 +08:00
|
|
|
if (isEligible(S))
|
2016-11-30 09:50:03 +08:00
|
|
|
Sections.push_back(S);
|
|
|
|
|
2016-12-06 02:11:35 +08:00
|
|
|
// Initially, we use hash values to partition sections.
|
2017-02-24 00:49:07 +08:00
|
|
|
for (InputSection *S : Sections)
|
2016-12-06 02:11:35 +08:00
|
|
|
// Set MSB to 1 to avoid collisions with non-hash IDs.
|
2017-02-24 00:49:07 +08:00
|
|
|
S->Class[0] = getHash<ELFT>(S) | (1 << 31);
|
2016-02-26 02:43:51 +08:00
|
|
|
|
2016-12-06 02:11:35 +08:00
|
|
|
// From now on, sections in Sections vector are ordered so that sections
|
|
|
|
// in the same equivalence class are consecutive in the vector.
|
2016-11-20 07:14:23 +08:00
|
|
|
std::stable_sort(Sections.begin(), Sections.end(),
|
2017-02-24 00:49:07 +08:00
|
|
|
[](InputSection *A, InputSection *B) {
|
2016-12-06 02:11:35 +08:00
|
|
|
return A->Class[0] < B->Class[0];
|
2016-02-26 02:43:51 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
// Compare static contents and assign unique IDs for each static content.
|
2016-12-06 02:11:35 +08:00
|
|
|
forEachClass([&](size_t Begin, size_t End) { segregate(Begin, End, true); });
|
2016-02-26 02:43:51 +08:00
|
|
|
|
2016-12-02 13:35:46 +08:00
|
|
|
// Split groups by comparing relocations until convergence is obtained.
|
|
|
|
do {
|
|
|
|
Repeat = false;
|
2016-12-06 02:11:35 +08:00
|
|
|
forEachClass(
|
2016-12-02 13:35:46 +08:00
|
|
|
[&](size_t Begin, size_t End) { segregate(Begin, End, false); });
|
|
|
|
} while (Repeat);
|
2016-11-30 09:50:03 +08:00
|
|
|
|
|
|
|
log("ICF needed " + Twine(Cnt) + " iterations");
|
2016-02-26 02:43:51 +08:00
|
|
|
|
2016-12-06 02:11:35 +08:00
|
|
|
// Merge sections by the equivalence class.
|
|
|
|
forEachClass([&](size_t Begin, size_t End) {
|
2016-12-02 13:35:46 +08:00
|
|
|
if (End - Begin == 1)
|
|
|
|
return;
|
2016-11-30 09:50:03 +08:00
|
|
|
|
2016-12-02 13:35:46 +08:00
|
|
|
log("selected " + Sections[Begin]->Name);
|
|
|
|
for (size_t I = Begin + 1; I < End; ++I) {
|
2016-11-30 09:50:03 +08:00
|
|
|
log(" removed " + Sections[I]->Name);
|
2016-12-02 13:35:46 +08:00
|
|
|
Sections[Begin]->replace(Sections[I]);
|
2016-02-26 02:43:51 +08:00
|
|
|
}
|
2016-12-02 13:35:46 +08:00
|
|
|
});
|
2017-04-13 16:52:58 +08:00
|
|
|
|
|
|
|
// Mark ARM Exception Index table sections that refer to folded code
|
|
|
|
// sections as not live. These sections have an implict dependency
|
|
|
|
// via the link order dependency.
|
|
|
|
if (Config->EMachine == EM_ARM)
|
|
|
|
for (InputSectionBase *Sec : InputSections)
|
|
|
|
if (auto *S = dyn_cast<InputSection>(Sec))
|
|
|
|
if (S->Flags & SHF_LINK_ORDER)
|
|
|
|
S->Live = S->getLinkOrderDep()->Live;
|
2016-02-26 02:43:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ICF entry point function.
|
2016-05-03 03:30:42 +08:00
|
|
|
template <class ELFT> void elf::doIcf() { ICF<ELFT>().run(); }
|
2016-02-26 02:43:51 +08:00
|
|
|
|
2016-05-03 03:30:42 +08:00
|
|
|
template void elf::doIcf<ELF32LE>();
|
|
|
|
template void elf::doIcf<ELF32BE>();
|
|
|
|
template void elf::doIcf<ELF64LE>();
|
|
|
|
template void elf::doIcf<ELF64BE>();
|