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

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 00:03:26 PST 2017


>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 ?
(gnu readelf is able to parse it even with sh_name != 0 currently, so I guess we might want to follow this behavior)

George.


More information about the llvm-commits mailing list