[PATCH] D28560: [Object/ELF] - Allow to parse files with e_shstrndx set to SHN_UNDEF

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 07:14:33 PST 2017


George Rimar <grimar at accesssoftek.com> writes:

>>We already have
>>
>>  uint32_t Offset = Section->sh_name;
>>  if (Offset == 0)
>>    return StringRef();
>>
>>It seems broken to not have a string table and yet have non zero
>>sh_name. Where did you find this file?
>>
>>Cheers,
>>Rafael
>
> It is part of sections.s from D28561, so generated by LLD now.
> Do you think we should upgrade D28561 to have sh_name be 0 instead for case when .shstrtab is discarded ?

Very likely. I will take a look at D28561.

> (gnu readelf is able to parse it even with sh_name != 0 currently, so I guess we might want to follow this behavior)

If we are the only ones creating such files we should probably just fix
lld and keep rejecting them.

> George.


More information about the llvm-commits mailing list