[Lldb-commits] [PATCH] D55998: ELF: create "container" sections from PT_LOAD segments

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 27 01:18:21 PST 2018


labath added a comment.

In D55998#1340711 <https://reviews.llvm.org/D55998#1340711>, @joerg wrote:

> In D55998#1340448 <https://reviews.llvm.org/D55998#1340448>, @jankratochvil wrote:
>
> > ELF standard <http://refspecs.linuxbase.org/elf/elf.pdf>: "//An object file segment contains one or more sections.//", "//An object file segment comprises one or more sections//"
>
>
> I wouldn't rule out smart tools splitting a section into a read-only and read-write part on linking. So no, I certainly wouldn't assume any direct correspondance between segments and sections.


That's interesting. Do you know of any such tool doing that? I am asking because that might give us a clue on how to handle that situation. In your example, it might be cleanest to split the offending section in two, and place the parts in appropriate segments (with the right permissions). However, I don't want to add code doing that if there is no known tool producing such files. If there aren't any (and I hope that there aren't, since it does appear to violate the spec), then I think we should just do the minimal amount of work necessary to process these (corrupt?) files without doing something completely bogus (like crashing). I think the current implementation would fit that bill.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55998/new/

https://reviews.llvm.org/D55998





More information about the lldb-commits mailing list