OSDN Git Service

[RuntimeDyld] load all sections with ProcessAllSections
authorYonghong Song <yhs@fb.com>
Mon, 28 Jan 2019 21:35:23 +0000 (21:35 +0000)
committerYonghong Song <yhs@fb.com>
Mon, 28 Jan 2019 21:35:23 +0000 (21:35 +0000)
commitb16d167fd3257d330962b9c279215764f4a4d263
tree4fa70bf298e70c4c6d9fb75329a31255c137c0c7
parent2f8d69acb03e73ba19356d247003e1975cdfccb5
[RuntimeDyld] load all sections with ProcessAllSections

This patch tried to address the following use case.
  . bcc (https://github.com/iovisor/bcc) utilizes llvm JIT to
    compile for BTF target.
  . with -g, .BTF and .BTF.ext sections (BPF debug info)
    will be generated by LLVM.
  . .BTF does not have relocations and .BTF.ext has some
    relocations.
  . With ProcessAllSections, .BTF.ext is loaded by JIT dynamic linker
    and is available to application. But .BTF is not loaded.

The bcc application needs both .BTF.ext and .BTF for debugging
purpose, and .BTF is not loaded. This patch addressed this issue
by iterating over all sections and loading any missing
sections, after symbol/relocation processing in loadObjectImpl().

Signed-off-by: Yonghong Song <yhs@fb.com>
Differential Revision: https://reviews.llvm.org/D55943

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352432 91177308-0d34-0410-b5e6-96231b3b80d8
lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp