This is written for tha YAML testcase of D42914. Its unstripped.yaml contains:
Start of section headers: 64 (bytes into file) Number of program headers: 0 Section header string table index: 5 Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [ 1] .note.gnu.build-id NOTE 0000000000400274 0001c0 000024 00 A 0 0 4 [ 5] .shstrtab STRTAB 0000000000000000 000226 000034 00 0 0 1
while there is:
ObjectFile::GetModuleSpecifications: DataBufferSP data_sp = DataBufferLLVM::CreateSliceFromPath(file.GetPath(), 512, file_offset);
and so ObjectFileELF::GetSectionHeaderInfo has only 0x200 bytes available to find UUID (=build-id). It could find it if there were either program headers present (obj2yaml does not preserve them) or if .shstrtab was present in the first 512 bytes (which it is not).
But then we do not need .shstrtab as we can identify the note section by its SHT_NOTE, we do not need its name. That's this patch.
It does not have a testcase but D42914 does FAIL for me without this patch on Fedora 27 x86_64.