1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-22 10:27:48 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-04 16:54:53 +09:00
parent 0e2e52f825
commit 008783851a
3 changed files with 9 additions and 3 deletions

3
mold.h
View File

@ -147,7 +147,7 @@ class Symbol {
public:
Symbol(StringRef name, ObjectFile *file = nullptr)
: name(name), file(file), needs_got(false), needs_gotplt(false),
needs_gottp(false), needs_plt(false), is_weak(false),
needs_gottp(false), needs_plt(false), is_dso(false), is_weak(false),
is_undef_weak(false) {}
Symbol(const Symbol &other) : Symbol(other.name, other.file) {}
@ -175,6 +175,7 @@ public:
u8 needs_gotplt : 1;
u8 needs_gottp : 1;
u8 needs_plt : 1;
u8 is_dso : 1;
u8 is_weak : 1;
u8 is_undef_weak : 1;

View File

@ -197,7 +197,11 @@ void ObjectFile::parse() {
}
initialize_sections();
if (is_dso)
sections.resize(elf_sections.size());
else
initialize_sections();
if (symtab_sec)
initialize_symbols();
}
@ -231,6 +235,7 @@ void ObjectFile::register_defined_symbols() {
sym.type = esym.getType();
sym.visibility = esym.getVisibility();
sym.is_weak = is_weak;
sym.is_dso = is_dso;
}
}
}

View File

@ -1,5 +1,5 @@
// RUN: cc -o %t.o -c %s
// RUN: mold -o %t.exe /usr/lib/x86_64-linux-gnu/crt1.o \
// RUN: mold -static -o %t.exe /usr/lib/x86_64-linux-gnu/crt1.o \
// RUN: /usr/lib/x86_64-linux-gnu/crti.o \
// RUN: /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginT.o \
// RUN: %t.o \