<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<div style="color: rgb(33, 33, 33);">
<div>
<div dir="ltr">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
</blockquote>
<span style="font-size: 12pt;">>>-  DWARFContextInMemory Dwarf(*Obj.get());</span></div>
<div class="gmail_quote"><span style="font-size: 12pt;"></span><span style="font-size: 12pt;">>>+  DWARFContextInMemory Dwarf(*Obj.get(), nullptr, [&](Error E) {</span></div>
<div class="gmail_quote"><span style="font-size: 12pt;"></span><span style="font-size: 12pt;">>>+    error(toString(Sec->File) + ": error parsing DWARF data:\n>>> " +</span></div>
<div class="gmail_quote"><span style="font-size: 12pt;"></span><span style="font-size: 12pt;">>>+          toString(std::move(E)));</span></div>
<div class="gmail_quote"><span style="font-size: 12pt;"></span><span style="font-size: 12pt;">>>+    return ErrorPolicy::Continue;</span>
<div>><br>
>Is 'error(...)' a noreturn function (does it cause the linker to stop immediately?)? If so, remove the 'return' after it, since that'll be unreachable code.<br>
 <br>
</div>
<div>No, we have fatal(...) which is noreturn, error(...) is just a regular reporting helper,<br>
</div>
<div>that continues execution and increases <span style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">ErrorCount counter</span>.<br>
</div>
<div>So this code intention is to report all errors from parser and LLD will fail the link later.<br>
</div>
<div><br>
</div>
<div>At the same time error reporting subsystem has error limit. I was wondering when wrote this patch<br>
</div>
<div>if I should do something like:<br>
</div>
<div><br>
</div>
<div>if (ErrorCount  >= Config->ErrorLimit)<br>
</div>
<div>  <span style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">return ErrorPolicy::Halt;</span><br>
</div>
<div>
<div class="gmail_quote" style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">
<span style="font-size: 12pt;">error(toString(Sec->File) + ": error parsing DWARF data:\n>>> " +</span></div>
<div class="gmail_quote" style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">
<span style="font-size: 12pt;"></span><span style="font-size: 12pt;">    toString(std::move(E)));</span></div>
<div class="gmail_quote" style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">
<span style="font-size: 12pt;"></span><span style="font-size: 12pt;">return ErrorPolicy::Continue;</span></div>
<div class="gmail_quote" style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">
<span style="font-size: 12pt;"><br>
</span></div>
<div class="gmail_quote" style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">
<span style="font-size: 12pt;">George.</span></div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>