<div dir="ltr"><div class="gmail_extra">I'd think my question is whether or not we want to have some sophisticated approach for the situation that a user accidentally give a wrong object file to LLD. If that really happens frequently, and if we really don't want users to wait for the parser to parse all files, we need some solution that works progressively as we read files.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">I think, in such situation, the most important thing is to correctly raise an error. Response time to raise an error is not that important.</div><div class="gmail_extra">

<div class="gmail_quote"><br></div><div class="gmail_quote">On Tue, Apr 1, 2014 at 10:16 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><div class="">
    <div>On 4/2/2014 12:06 AM, Rui Ueyama wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>So is for PE32 and PE32+. They cannot be mixed because they are for x86 and
x86-64, respectively.

I'd think we can simply wait for all files to be parsed and pass them to a
LinkingContext to ask whether or not the input file set seems OK.
</pre>
    </blockquote></div>
    There are pros and cons to your approach :-<br>
    <br>
    <u><b>pros</b></u><br>
    a) easier to implement<br>
    b) lot of usecases that the linker usually deals with, are users
    specifying the right architecture<br>
    <br>
    <u><b>cons</b></u><br>
    a) the input files will need to be looked at again, either the elf
    header has to be re-read or stored in LinkingContext (increase in
    memory footprint).<br>
    b) there might be an issue with just one input file, and the user
    has to wait till all files have been parsed to get the actual error.<br>
    c) users use a huge command line linking few
    applications(example:building clang), and the cost of revisiting all
    the input files may be huge.<br></div></blockquote><div><br></div><div>I don't get (a). Why do you have to scan a file again?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div text="#000000" bgcolor="#FFFFFF">
    I would prefer the architecture be read/verified at the time of
    reading, and stop reading the rest of the files as soon as we see a
    discrepancy.<br>
    <br>
    If I misunderstood your suggestion, please let me know.<div class=""><br>
    <br>
    Thanks<br>
    <br>
    Shankar Easwaran<br>
    <pre cols="72">-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation</pre>
  </div></div>

</blockquote></div><br></div></div>