|
@@ -519,10 +519,12 @@ struct section *elf_create_section(struct elf *elf, const char *name,
|
|
|
sec->sh.sh_flags = SHF_ALLOC;
|
|
|
|
|
|
|
|
|
- /* Add section name to .shstrtab */
|
|
|
+ /* Add section name to .shstrtab (or .strtab for Clang) */
|
|
|
shstrtab = find_section_by_name(elf, ".shstrtab");
|
|
|
+ if (!shstrtab)
|
|
|
+ shstrtab = find_section_by_name(elf, ".strtab");
|
|
|
if (!shstrtab) {
|
|
|
- WARN("can't find .shstrtab section");
|
|
|
+ WARN("can't find .shstrtab or .strtab section");
|
|
|
return NULL;
|
|
|
}
|
|
|
|