<div dir="ltr"><div class="gmail_extra"><div>On Fri, Oct 4, 2013 at 8:50 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br></div>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
It is needed that lld verifies the input to the linker.<br>
<br>
For example : a x86 ELF file can be given to lld when the target is x86_64. Similiarly with other flavors.<br>
<br>
I was thinking to have a varargs function in the LinkingContext that would be overridden by each of the LinkingContexts to verify files after being read.<br>
<br>
The reader would call the varargs function in the LinkingContext and raise an error if the input is not suitable with the current link mode.<br>
<br>
Thanks<span class=""><font color="#888888"><br>
<br>
Shankar Easwaran<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation<br>
<br>
</font></span></blockquote></div><br></div><div class="gmail_extra">Why would it need to be varargs? Also, parse can just return an error that specifies the format is wrong.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
Specifically this would be a good place to use the user data part of ErrorOr to specify what was expected and what was received.</div><div class="gmail_extra"><br></div><div class="gmail_extra">- Michael Spencer<br></div>
<div class="gmail_extra"><br></div></div>