[RuntimeDyld][COFF] Skip non-loaded sections when calculating ImageBase.

Non-loaded sections (whose unused load-address defaults to zero) should not
be taken into account when calculating ImageBase, or ImageBase will be
incorrectly set to 0.

Patch by Andrew Scheidecker. Thanks Andrew!

https://reviews.llvm.org/D51343

+        // The Sections list may contain sections that weren't loaded for
+        // whatever reason: they may be debug sections, and ProcessAllSections
+        // is false, or they may be sections that contain 0 bytes. If the
+        // section isn't loaded, the load address will be 0, and it should not
+        // be included in the ImageBase calculation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344995 91177308-0d34-0410-b5e6-96231b3b80d8
3 files changed