================
@@ -1477,32 +1506,32 @@ size_t
ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers,
}
if (idx < section_headers.size())
section_headers.resize(idx);
+ // Sometimes we are able to read the section header memory from an in memory
----------------
labath wrote:
Having a flag for this would probably be the best solution (I was considering
that myself). It basically tells the object file how the file was mapped, and
that's something that's better done from the outside. The dynamic loader knows
that it is loading a VDSO file, so it could easily set this flag when it is
loading it.
I'm not particularly keen on the size argument, as it isn't very well defined.
It's not uncommon to have holes in the memory image of an elf file (e.g. to
have one chunk mapped from 0x10000->0x15000 and then another in
0x20000->25000). In theory, I think you could even end up mapping a different
elf file into a hole in one of the previously mapped files.
That said, I'm not sure if the flag is completely necessary for this. I have a
feeling it should still be possible to by looking at the segment data. In both
of our examples, the section header offset pointed directly into a PT_LOAD
segment. I think that shouldn't be the case for these GPU files (as otherwise,
the section headers could be overwritten by some data in the binary). If that's
true, then we could condition the reading of the section headers on this. The
flag thing would likely still be better though, but I don't know how involved
that change would be.
https://github.com/llvm/llvm-project/pull/129166
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits