1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-28 02:44:48 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-11 16:46:14 +09:00
parent ea06f176e6
commit 96ad9496da

10
main.cc
View File

@ -339,6 +339,8 @@ static void scan_rels(ArrayRef<ObjectFile *> files) {
u32 gotplt_offset = 0;
u32 plt_offset = 0;
u32 relplt_offset = 0;
u32 dynsym_offset = 0;
u32 dynstr_offset = 0;
for (ObjectFile *file : files) {
file->got_offset = got_offset;
@ -352,12 +354,20 @@ static void scan_rels(ArrayRef<ObjectFile *> files) {
file->relplt_offset = relplt_offset;
relplt_offset += file->num_relplt * sizeof(ELF64LE::Rela);
file->dynsym_offset = dynsym_offset;
dynsym_offset += file->num_dynsym * sizeof(ELF64LE::Sym);
file->dynstr_offset = dynstr_offset;
dynstr_offset += file->dynstr_size;
}
out::got.shdr.sh_size = got_offset;
out::gotplt.shdr.sh_size = gotplt_offset;
out::plt.shdr.sh_size = plt_offset;
out::relplt.shdr.sh_size = relplt_offset;
out::dynsym.shdr.sh_size = dynsym_offset;
out::dynstr.shdr.sh_size = dynstr_offset;
}
static void assign_got_offsets(ArrayRef<ObjectFile *> files) {