[PATCH] Preliminary support for dynamically loadable coff objects

Andy Kaylor andrew.kaylor at intel.com
Thu Feb 26 10:39:30 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.cpp:94
@@ +93,3 @@
+  SectionEntry &Section = Sections[SectionID];
+  uint8_t *Target = Section.Address + Offset;
+  switch (RelType) {
----------------
Shouldn't you be using Section.ObjAddress here?

================
Comment at: lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.cpp:132
@@ +131,3 @@
+      if (SecI == Obj.section_end())
+        llvm_unreachable("Symbol section not found, bad object file");
+      bool IsCode = SecI->isText();
----------------
majnemer wrote:
> Would `report_fatal_error` be more reasonable here?
I know we're doing this all over the existing code, but RuntimeDyld should really avoid fatal errors, including llvm_unreachable, as much as possible.  With a static compiler it is kind of reasonable to bring down the program if a catastrophic error occurs, but RuntimeDyld really shouldn't do that.

I'm not suggesting that this problem needs to be addressed in this change set.  I'm just bringing it up as a general concern that needs to be dealt with sooner or later.

http://reviews.llvm.org/D7793

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list