Merge "Fix linker compilation when STATS is set"

This commit is contained in:
Treehugger Robot 2019-07-25 21:37:42 +00:00 committed by Gerrit Code Review
commit 6ae3a1324b
3 changed files with 11 additions and 5 deletions

View file

@ -282,6 +282,14 @@ static linker_stats_t linker_stats;
void count_relocation(RelocationKind kind) {
++linker_stats.count[kind];
}
void print_linker_stats() {
PRINT("RELO STATS: %s: %d abs, %d rel, %d copy, %d symbol", g_argv[0],
linker_stats.count[kRelocAbsolute],
linker_stats.count[kRelocRelative],
linker_stats.count[kRelocCopy],
linker_stats.count[kRelocSymbol]);
}
#else
void count_relocation(RelocationKind) {
}

View file

@ -99,6 +99,8 @@ enum RelocationKind {
void count_relocation(RelocationKind kind);
void print_linker_stats();
soinfo* get_libdl_info(const soinfo& linker_si);
soinfo* find_containing_library(const void* p);

View file

@ -490,11 +490,7 @@ static ElfW(Addr) linker_main(KernelArgumentBlock& args, const char* exe_to_load
static_cast<long long>(t0.tv_usec))));
#endif
#if STATS
PRINT("RELO STATS: %s: %d abs, %d rel, %d copy, %d symbol", g_argv[0],
linker_stats.count[kRelocAbsolute],
linker_stats.count[kRelocRelative],
linker_stats.count[kRelocCopy],
linker_stats.count[kRelocSymbol]);
print_linker_stats();
#endif
#if COUNT_PAGES
{