diff --git a/main.cc b/main.cc index 47b223d0..b3b96d91 100644 --- a/main.cc +++ b/main.cc @@ -299,10 +299,6 @@ static void assign_got_offsets(u8 *buf, ArrayRef files) { rel->setType(R_X86_64_IRELATIVE, false); rel->r_addend = sym->addr; relplt_offset += sizeof(ELF64LE::Rela); - - llvm::outs() << "sym=" << sym->name - << " gotplt=" << sym->gotplt_offset - << "\n"; } } } @@ -506,8 +502,8 @@ static void fix_synthetic_symbols(ArrayRef output_chunks) { } // __rela_iplt_start and __rela_iplt_end - // start(out::relplt, out::__rela_iplt_start); - // stop(out::relplt, out::__rela_iplt_end); + start(out::relplt, out::__rela_iplt_start); + stop(out::relplt, out::__rela_iplt_end); // __{init,fini}_array_{start,end} for (OutputChunk *chunk : output_chunks) { @@ -836,9 +832,11 @@ int main(int argc, char **argv) { MyTimer t("sym_addr"); for_each(files, [](ObjectFile *file) { file->fix_sym_addrs(); }); - for (OutputChunk *chunk : output_chunks) - if (chunk->shdr.sh_flags & SHF_TLS) - out::tls_end = chunk->shdr.sh_addr + chunk->shdr.sh_size; + for (OutputChunk *chunk : output_chunks) { + ELF64LE::Shdr &shdr = chunk->shdr; + if (shdr.sh_flags & SHF_TLS) + out::tls_end = align_to(shdr.sh_addr + shdr.sh_size, shdr.sh_addralign); + } } tbb::task_group tg_unlink;