[LLVMdev] [lld] Verifying the Architecture of files read

Shankar Easwaran shankare at codeaurora.org
Thu Apr 3 13:00:58 PDT 2014


On 4/2/2014 8:36 PM, Nick Kledzik wrote:
> It is more than “verify” . Mach-o has “fat” (aka “universal”) files 
> which contain multiple “slices”.  Each slice is for a different arch. 
>  The Reader needs to know the intended arch up front to pick the right 
> slice.
>
Currently the GnuLdDriver creates a LinkingContext(X86_64, X86, ....)  
from the -target option in the Gnu flavor.

So here, the driver has to sniff the first file if the -target option is 
not mentioned in the command-line I think.

This would create more problems if the first input file is just a linker 
script.

>
> On Apr 1, 2014, at 10:06 PM, Rui Ueyama <ruiu at google.com 
> <mailto:ruiu at google.com>> wrote:
>> 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.
>
> Except there is no method on lld::File that returns its “architecture”.
Are you thinking of lld::File returning a llvm::Triple as in :-

llvm::Triple triple() const = 0;
>
> We’ve been side stepping the issue of how to model architectures (e.g. 
> triples) in lld.  We do need to eventually nail this down because we 
> need to record that info in yaml and native files.
>
Agree.

Thanks

Shankar Easwaran

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140403/01f9ccce/attachment.html>


More information about the llvm-dev mailing list