[PATCH] D70378: [LLD][COFF] Cover usage of LLD as a library

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 15:53:05 PDT 2020


MaskRay added inline comments.


================
Comment at: lld/tools/lld/lld.cpp:228
+  // usages of `not --crash`.
+  if (*mainRet >= 128)
+    raise(*mainRet - 128);
----------------
Signals are numbered from 1 (0 is used as an existence and permission check). Use `> 128`


================
Comment at: llvm/lib/Support/CrashRecoveryContext.cpp:381
+  // Return the same error code as if the program crashed, as mentioned here:
+  // https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html
+  int RetCode = 128 + Signal;
----------------
Using 128+n looks good. We can probably replace the bash link with the more standard
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html

> Historically, shells have returned an exit status of 128+ n, where n represents the signal number....


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70378



More information about the llvm-commits mailing list