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

temporary

This commit is contained in:
Rui Ueyama 2020-11-02 14:43:36 +09:00
parent 8f27c88db3
commit a3ccd267db
2 changed files with 4 additions and 3 deletions

View File

@ -338,7 +338,7 @@ static u64 set_osec_offsets(ArrayRef<OutputChunk *> output_chunks) {
if (!chunk->is_bss())
fileoff += chunk->get_size();
#if 0
#if 1
bool is_tbss = chunk->is_bss() && (chunk->shdr.sh_flags & SHF_TLS);
if (!is_tbss)
vaddr += chunk->get_size();

View File

@ -131,8 +131,9 @@ void OutputPhdr::copy_to(u8 *buf) {
OutputChunk *back = ent.members.back();
ent.phdr.p_offset = front->shdr.sh_offset;
ent.phdr.p_filesz =
back->shdr.sh_offset + back->get_size() - front->shdr.sh_offset;
ent.phdr.p_filesz = back->is_bss()
? back->shdr.sh_offset - front->shdr.sh_offset
: back->shdr.sh_offset - front->shdr.sh_offset + back->get_size();
ent.phdr.p_vaddr = front->shdr.sh_addr;
ent.phdr.p_memsz =
back->shdr.sh_addr + back->get_size() - front->shdr.sh_addr;