[PATCH] [lld] ELF: Support detection of relocation errors during processing

Benoit Belley Benoit.Belley at autodesk.com
Thu Jan 15 05:05:48 PST 2015


Hi Everyone,

My understanding is that the ELF writer is also used by the MCJIT engine
when filling an object buffer with jitted code. In that context, I am
wondering if the call to llvm::report_fatal_error() is the appropriate way
to report the error. Its effect will be to kill the entire host
application simply because one LLVM module couldn¹t be jitted.

Of course, fatal errors and assertions should never occur! ;-) And, if
they never occur, then there isn¹t any issue. On the other hand,
report_fatal_error() has the unfortunate consequence of killing our
application before our users have any chance of saving their work.

Is that a legitimate concern ? Comments ?

Cheers,
Benoit

Benoit Belley
Sr Principal Developer
M&E-Product Development Group
Autodesk, Inc.
www.autodesk.com <http://www.autodesk.com/>



On 2015-01-14 17:58, "Rui Ueyama" <ruiu at google.com> wrote:

>LGTM with these fixes.
>
>
>REPOSITORY
>  rL LLVM
>
>================
>Comment at: lib/ReaderWriter/ELF/SectionChunks.h:424
>@@ +423,3 @@
>+    for (const auto ref : *definedAtom) {
>+      if (std::error_code EC = relHandler.applyRelocation(*writer,
>buffer,
>+                                                          *ai, *ref)) {
>----------------
>s/EC/ec/
>
>================
>Comment at: lib/ReaderWriter/ELF/SectionChunks.h:431
>@@ -398,1 +430,3 @@
>   });
>+  if (success == false)
>+    llvm::report_fatal_error("relocating output");
>----------------
>if (!success)
>
>http://reviews.llvm.org/D6827
>
>EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
>_______________________________________________
>llvm-commits mailing list
>llvm-commits at cs.uiuc.edu
>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list