mirror of
https://github.com/rui314/mold.git
synced 2024-09-22 02:20:51 +03:00
temporary
This commit is contained in:
parent
2ecbc35520
commit
aaf6763a5d
@ -30,12 +30,10 @@ void InputSection::scan_relocations() {
|
||||
return;
|
||||
|
||||
for (const ELF64LE::Rela &rel : rels) {
|
||||
int idx = rel.getSymbol(false);
|
||||
if (idx < file->first_global)
|
||||
Symbol *sym = file->get_symbol(rel.getSymbol(false));
|
||||
if (!sym)
|
||||
continue;
|
||||
|
||||
Symbol *sym = file->symbols[idx - file->first_global];
|
||||
|
||||
switch (rel.getType(false)) {
|
||||
case R_X86_64_GOTPCREL:
|
||||
case R_X86_64_TLSGD:
|
||||
|
1
main.cc
1
main.cc
@ -394,6 +394,7 @@ int main(int argc, char **argv) {
|
||||
{
|
||||
MyTimer t("sym_addr");
|
||||
for_each(files, [](ObjectFile *file) {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
10
mold.h
10
mold.h
@ -400,8 +400,11 @@ public:
|
||||
StringRef get_filename();
|
||||
bool is_in_archive();
|
||||
|
||||
std::vector<Symbol *> symbols;
|
||||
int first_global = 0;
|
||||
Symbol *get_symbol(uint32_t idx) {
|
||||
if (idx < first_global)
|
||||
return nullptr;
|
||||
return symbols[first_global - idx];
|
||||
}
|
||||
|
||||
std::vector<InputSection *> sections;
|
||||
StringRef archive_name;
|
||||
@ -420,6 +423,9 @@ private:
|
||||
std::vector<StringPiece *> merged_strings_alloc;
|
||||
std::vector<StringPiece *> merged_strings_noalloc;
|
||||
|
||||
std::vector<Symbol *> symbols;
|
||||
int first_global = 0;
|
||||
|
||||
ArrayRef<ELF64LE::Shdr> elf_sections;
|
||||
ArrayRef<ELF64LE::Sym> elf_syms;
|
||||
StringRef string_table;
|
||||
|
Loading…
Reference in New Issue
Block a user