1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-29 11:24:36 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-01 18:05:16 +09:00
parent a2edda694a
commit 055c37da74
3 changed files with 10 additions and 0 deletions

View File

@ -139,6 +139,8 @@ static ObjectFile *create_internal_file() {
out::__bss_start = create("__bss_start"); out::__bss_start = create("__bss_start");
out::__ehdr_start = create("__ehdr_start"); out::__ehdr_start = create("__ehdr_start");
out::__rela_iplt_start = create("__rela_iplt_start");
out::__rela_iplt_end = create("__rela_iplt_end");
obj->elf_syms = *elf_syms; obj->elf_syms = *elf_syms;
return obj; return obj;
} }
@ -683,6 +685,10 @@ int main(int argc, char **argv) {
break; break;
} }
} }
// __rela_iplt_start and __rela_iplt_end
out::__rela_iplt_start->addr = out::plt->shdr.sh_addr;
out::__rela_iplt_end->addr = out::plt->shdr.sh_addr + out::plt->shdr.sh_size;
} }
// Fix symbol addresses. // Fix symbol addresses.

2
mold.h
View File

@ -493,6 +493,8 @@ extern u64 tls_end;
extern Symbol *__bss_start; extern Symbol *__bss_start;
extern Symbol *__ehdr_start; extern Symbol *__ehdr_start;
extern Symbol *__rela_iplt_start;
extern Symbol *__rela_iplt_end;
extern Symbol *end; extern Symbol *end;
extern Symbol *_end; extern Symbol *_end;
extern Symbol *etext; extern Symbol *etext;

View File

@ -18,6 +18,8 @@ u64 out::tls_end;
Symbol *out::__bss_start; Symbol *out::__bss_start;
Symbol *out::__ehdr_start; Symbol *out::__ehdr_start;
Symbol *out::__rela_iplt_start;
Symbol *out::__rela_iplt_end;
Symbol *out::end; Symbol *out::end;
Symbol *out::_end; Symbol *out::_end;
Symbol *out::etext; Symbol *out::etext;