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

Rui Ueyama ruiu at google.com
Wed Apr 2 20:58:41 PDT 2014


On Wed, Apr 2, 2014 at 6:36 PM, Nick Kledzik <kledzik at apple.com> 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.
>

That's true. Does the linker on Mac knows which architecture that is trying
to link prior to handling input files (by a command line flag, environment
variable, etc), or does it have to make a decision by reading a few files?
(e.g. set the target architecture with the same one as the first file's
magic.)


> On Apr 1, 2014, at 10:06 PM, Rui Ueyama <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”.
>
> 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.
>
> -Nick
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140402/620d0e20/attachment.html>


More information about the llvm-dev mailing list