[PATCH] D59033: [llvm-objcopy] Make .build-id linking atomic

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 15:12:55 PDT 2019


jakehehrlich added inline comments.


================
Comment at: llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp:199-200
+    Path.push_back('\0');
+    return createStringError(EC, "cannot link %s to %s", ToLink.data(),
+                             Path.data());
+  }
----------------
jhenderson wrote:
> It may depend on the reporting site, but I believe that this will throw away the potentially useful information in `EC`. I think you need to add EC's message to the string error to avoid this.
I looked at the implementation of createStringError. It just calls make_error which in turn calls the StringError constructor which does not include the error code unfortunately so your concern was correct. I added a function here to resolve this issue.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59033





More information about the llvm-commits mailing list