tilegx: Set this_hdr.sh_entsize only if section size > 0
This fixes: /export/build/gnu/binutils-cross/build-tilegx-linux/ld/ld-new -o tmpdir/comm-data -z norelro -L/export/gnu/import/git/sources/binutils-gdb/ld/testsuite/ld-elf -T comm-data2.ld -Ltmpdir -lcomm-data tmpdir/comm-data2.o sh: line 1: 9208 Segmentation fault (core dumped) /export/build/gnu/binutils-cross/build-tilegx-linux/ld/ld-new -o tmpdir/comm-data -z norelro -L/export/gnu/import/git/sources/binutils-gdb/ld/testsuite/ld-elf -T comm-data2.ld -Ltmpdir -lcomm-data tmpdir/comm-data2.o 2>&1 FAIL: Common symbol override test * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set this_hdr.sh_entsize only if section size > 0.
This commit is contained in:
parent
70090aa5f6
commit
4c7236d3cb
|
@ -1,3 +1,8 @@
|
||||||
|
2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
|
||||||
|
this_hdr.sh_entsize only if section size > 0.
|
||||||
|
|
||||||
2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
|
2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
|
* elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
|
||||||
|
|
|
@ -4313,10 +4313,10 @@ tilegx_elf_finish_dynamic_sections (bfd *output_bfd,
|
||||||
entry size. */
|
entry size. */
|
||||||
pad_size = PLT_ENTRY_SIZE - PLT_HEADER_SIZE - PLT_TAIL_SIZE;
|
pad_size = PLT_ENTRY_SIZE - PLT_HEADER_SIZE - PLT_TAIL_SIZE;
|
||||||
memset (splt->contents + splt->size - pad_size, 0, pad_size);
|
memset (splt->contents + splt->size - pad_size, 0, pad_size);
|
||||||
}
|
|
||||||
|
|
||||||
elf_section_data (splt->output_section)->this_hdr.sh_entsize
|
elf_section_data (splt->output_section)->this_hdr.sh_entsize
|
||||||
= PLT_ENTRY_SIZE;
|
= PLT_ENTRY_SIZE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (htab->elf.sgotplt)
|
if (htab->elf.sgotplt)
|
||||||
|
@ -4337,10 +4337,10 @@ tilegx_elf_finish_dynamic_sections (bfd *output_bfd,
|
||||||
TILEGX_ELF_PUT_WORD (htab, output_bfd, (bfd_vma) 0,
|
TILEGX_ELF_PUT_WORD (htab, output_bfd, (bfd_vma) 0,
|
||||||
htab->elf.sgotplt->contents
|
htab->elf.sgotplt->contents
|
||||||
+ GOT_ENTRY_SIZE (htab));
|
+ GOT_ENTRY_SIZE (htab));
|
||||||
}
|
|
||||||
|
|
||||||
elf_section_data (htab->elf.sgotplt->output_section)->this_hdr.sh_entsize =
|
elf_section_data (htab->elf.sgotplt->output_section)->this_hdr.sh_entsize =
|
||||||
GOT_ENTRY_SIZE (htab);
|
GOT_ENTRY_SIZE (htab);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (htab->elf.sgot)
|
if (htab->elf.sgot)
|
||||||
|
@ -4354,10 +4354,10 @@ tilegx_elf_finish_dynamic_sections (bfd *output_bfd,
|
||||||
0);
|
0);
|
||||||
TILEGX_ELF_PUT_WORD (htab, output_bfd, val,
|
TILEGX_ELF_PUT_WORD (htab, output_bfd, val,
|
||||||
htab->elf.sgot->contents);
|
htab->elf.sgot->contents);
|
||||||
}
|
|
||||||
|
|
||||||
elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize =
|
elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize =
|
||||||
GOT_ENTRY_SIZE (htab);
|
GOT_ENTRY_SIZE (htab);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in New Issue