mirror of
https://github.com/rui314/mold.git
synced 2024-12-27 10:23:41 +03:00
temporary
This commit is contained in:
parent
93d1bd6ea8
commit
2a38a89105
@ -61,9 +61,7 @@ void InputSection::scan_relocations() {
|
|||||||
|
|
||||||
std::lock_guard lock(sym->mu);
|
std::lock_guard lock(sym->mu);
|
||||||
if (!sym->needs_plt) {
|
if (!sym->needs_plt) {
|
||||||
assert(!sym->needs_gotplt);
|
|
||||||
sym->needs_plt = true;
|
sym->needs_plt = true;
|
||||||
sym->needs_gotplt = true;
|
|
||||||
file->num_plt++;
|
file->num_plt++;
|
||||||
file->num_gotplt++;
|
file->num_gotplt++;
|
||||||
file->num_relplt++;
|
file->num_relplt++;
|
||||||
|
7
main.cc
7
main.cc
@ -278,14 +278,13 @@ static void assign_got_offsets(ArrayRef<ObjectFile *> files) {
|
|||||||
got_offset += 8;
|
got_offset += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sym->needs_gotplt) {
|
if (sym->needs_plt) {
|
||||||
assert(sym->type == STT_GNU_IFUNC);
|
// Reserve a .got.plt entry
|
||||||
out::gotplt->symbols.push_back({GotSection::IREL, sym});
|
out::gotplt->symbols.push_back({GotSection::IREL, sym});
|
||||||
sym->gotplt_offset = gotplt_offset;
|
sym->gotplt_offset = gotplt_offset;
|
||||||
gotplt_offset += 8;
|
gotplt_offset += 8;
|
||||||
}
|
|
||||||
|
|
||||||
if (sym->needs_plt) {
|
// Reserve a .plt entry
|
||||||
out::plt->symbols.push_back(sym);
|
out::plt->symbols.push_back(sym);
|
||||||
sym->plt_offset = plt_offset;
|
sym->plt_offset = plt_offset;
|
||||||
plt_offset += 16;
|
plt_offset += 16;
|
||||||
|
6
mold.h
6
mold.h
@ -147,9 +147,8 @@ private:
|
|||||||
class Symbol {
|
class Symbol {
|
||||||
public:
|
public:
|
||||||
Symbol(StringRef name, ObjectFile *file = nullptr)
|
Symbol(StringRef name, ObjectFile *file = nullptr)
|
||||||
: name(name), file(file), needs_got(false), needs_gotplt(false),
|
: name(name), file(file), needs_got(false), needs_gottp(false),
|
||||||
needs_gottp(false), needs_plt(false), is_dso(false), is_weak(false),
|
needs_plt(false), is_dso(false), is_weak(false), is_undef_weak(false) {}
|
||||||
is_undef_weak(false) {}
|
|
||||||
|
|
||||||
Symbol(const Symbol &other) : Symbol(other.name, other.file) {}
|
Symbol(const Symbol &other) : Symbol(other.name, other.file) {}
|
||||||
|
|
||||||
@ -173,7 +172,6 @@ public:
|
|||||||
tbb::spin_mutex mu;
|
tbb::spin_mutex mu;
|
||||||
|
|
||||||
u8 needs_got : 1;
|
u8 needs_got : 1;
|
||||||
u8 needs_gotplt : 1;
|
|
||||||
u8 needs_gottp : 1;
|
u8 needs_gottp : 1;
|
||||||
u8 needs_plt : 1;
|
u8 needs_plt : 1;
|
||||||
u8 is_dso : 1;
|
u8 is_dso : 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user