1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-26 18:02:30 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-04 18:54:31 +09:00
parent 93d1bd6ea8
commit 2a38a89105
3 changed files with 5 additions and 10 deletions

View File

@ -61,9 +61,7 @@ void InputSection::scan_relocations() {
std::lock_guard lock(sym->mu);
if (!sym->needs_plt) {
assert(!sym->needs_gotplt);
sym->needs_plt = true;
sym->needs_gotplt = true;
file->num_plt++;
file->num_gotplt++;
file->num_relplt++;

View File

@ -278,14 +278,13 @@ static void assign_got_offsets(ArrayRef<ObjectFile *> files) {
got_offset += 8;
}
if (sym->needs_gotplt) {
assert(sym->type == STT_GNU_IFUNC);
if (sym->needs_plt) {
// Reserve a .got.plt entry
out::gotplt->symbols.push_back({GotSection::IREL, sym});
sym->gotplt_offset = gotplt_offset;
gotplt_offset += 8;
}
if (sym->needs_plt) {
// Reserve a .plt entry
out::plt->symbols.push_back(sym);
sym->plt_offset = plt_offset;
plt_offset += 16;

6
mold.h
View File

@ -147,9 +147,8 @@ private:
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_dso(false), is_weak(false),
is_undef_weak(false) {}
: name(name), file(file), needs_got(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) {}
@ -173,7 +172,6 @@ public:
tbb::spin_mutex mu;
u8 needs_got : 1;
u8 needs_gotplt : 1;
u8 needs_gottp : 1;
u8 needs_plt : 1;
u8 is_dso : 1;