Skip to content

Commit 88ce67c

Browse files
committed
write/elf: don't write an empty strtab
Always write a strtab for relocatable object files. Previously we were writing a strtab that had 0 bytes of data. This gives a linker error: SHT_STRTAB string table section [index 4] is empty Also, there must be a strtab, otherwise the error is: invalid sh_type for string table section [index 0]: expected SHT_STRTAB, but got SHT_NULL
1 parent fd84037 commit 88ce67c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/write/elf/object.rs

+1
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ impl<'a> Object<'a> {
600600
writer.reserve_symtab_shndx_section_index();
601601
}
602602
writer.reserve_symtab_shndx();
603+
writer.require_strtab();
603604
writer.reserve_strtab_section_index();
604605
writer.reserve_strtab();
605606

0 commit comments

Comments
 (0)