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

Michael Spencer bigcheesegs at gmail.com
Fri Oct 4 21:16:00 PDT 2013


On Fri, Oct 4, 2013 at 8:50 PM, Shankar Easwaran <shankare at codeaurora.org>wrote:

> Hi,
>
> It is needed that lld verifies the input to the linker.
>
> For example : a x86 ELF file can be given to lld when the target is
> x86_64. Similiarly with other flavors.
>
> 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.
>
> 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.
>
> Thanks
>
> Shankar Easwaran
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
> by the Linux Foundation
>
>
Why would it need to be varargs? Also, parse can just return an error that
specifies the format is wrong.

Specifically this would be a good place to use the user data part of
ErrorOr to specify what was expected and what was received.

- Michael Spencer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131004/bcef6970/attachment.html>


More information about the llvm-dev mailing list