mirror of
https://github.com/rui314/mold.git
synced 2024-09-22 18:40:59 +03:00
temporary
This commit is contained in:
parent
ab517ea1ee
commit
b40add6092
5
mold.h
5
mold.h
@ -151,8 +151,8 @@ class Symbol {
|
|||||||
public:
|
public:
|
||||||
Symbol(StringRef name, ObjectFile *file = nullptr)
|
Symbol(StringRef name, ObjectFile *file = nullptr)
|
||||||
: name(name), file(file), needs_got(false), needs_gottp(false),
|
: name(name), file(file), needs_got(false), needs_gottp(false),
|
||||||
needs_plt(false), is_dso(false), is_weak(false), is_undef_weak(false),
|
needs_plt(false), is_placeholder(false), is_dso(false), is_weak(false),
|
||||||
traced(false) {}
|
is_undef_weak(false), traced(false) {}
|
||||||
|
|
||||||
Symbol(const Symbol &other) : Symbol(other.name, other.file) {}
|
Symbol(const Symbol &other) : Symbol(other.name, other.file) {}
|
||||||
|
|
||||||
@ -178,6 +178,7 @@ public:
|
|||||||
u8 needs_got : 1;
|
u8 needs_got : 1;
|
||||||
u8 needs_gottp : 1;
|
u8 needs_gottp : 1;
|
||||||
u8 needs_plt : 1;
|
u8 needs_plt : 1;
|
||||||
|
u8 is_placeholder : 1;
|
||||||
u8 is_dso : 1;
|
u8 is_dso : 1;
|
||||||
u8 is_weak : 1;
|
u8 is_weak : 1;
|
||||||
u8 is_undef_weak : 1;
|
u8 is_undef_weak : 1;
|
||||||
|
@ -205,6 +205,18 @@ void ObjectFile::parse() {
|
|||||||
|
|
||||||
if (symtab_sec)
|
if (symtab_sec)
|
||||||
initialize_symbols();
|
initialize_symbols();
|
||||||
|
|
||||||
|
if (Counter::enabled) {
|
||||||
|
static Counter defined("defined_syms");
|
||||||
|
static Counter undefined("undefined_syms");
|
||||||
|
|
||||||
|
for (const ELF64LE::Sym &esym : elf_syms) {
|
||||||
|
if (esym.isDefined())
|
||||||
|
defined.inc();
|
||||||
|
else
|
||||||
|
undefined.inc();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFile::resolve_symbols() {
|
void ObjectFile::resolve_symbols() {
|
||||||
@ -215,9 +227,6 @@ void ObjectFile::resolve_symbols() {
|
|||||||
|
|
||||||
Symbol &sym = *symbols[i];
|
Symbol &sym = *symbols[i];
|
||||||
|
|
||||||
static Counter counter("defined_syms");
|
|
||||||
counter.inc();
|
|
||||||
|
|
||||||
InputSection *isec = nullptr;
|
InputSection *isec = nullptr;
|
||||||
if (!esym.isAbsolute() && !esym.isCommon())
|
if (!esym.isAbsolute() && !esym.isCommon())
|
||||||
isec = sections[esym.st_shndx];
|
isec = sections[esym.st_shndx];
|
||||||
@ -268,9 +277,6 @@ ObjectFile::mark_live_archive_members(tbb::parallel_do_feeder<ObjectFile *> &fee
|
|||||||
sym.file->is_in_archive && !sym.file->is_alive) {
|
sym.file->is_in_archive && !sym.file->is_alive) {
|
||||||
feeder.add(sym.file);
|
feeder.add(sym.file);
|
||||||
|
|
||||||
static Counter counter("undefined_syms");
|
|
||||||
counter.inc();
|
|
||||||
|
|
||||||
if (UNLIKELY(sym.traced))
|
if (UNLIKELY(sym.traced))
|
||||||
llvm::outs() << "trace: " << toString(this) << " keeps "
|
llvm::outs() << "trace: " << toString(this) << " keeps "
|
||||||
<< toString(sym.file) << " for " << sym.name << "\n";
|
<< toString(sym.file) << " for " << sym.name << "\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user