<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 12, 2016 at 11:42 AM, Andrew Kelley <span dir="ltr"><<a href="mailto:superjoe30@gmail.com" target="_blank">superjoe30@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Mon, Dec 12, 2016 at 11:13 AM, Rafael Avila de Espindola via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>David Chisnall via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> writes:<br>
<br>
> On 12 Dec 2016, at 03:39, Rui Ueyama via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> LLD's driver currently takes only a command line argument strings, so you need to write ELF files to a filesystem and read them back at the moment.<br>
>><br>
>> Theoretically, we could accept a list of command line strings and MemoryBuffer objects (instead of filenames) so that we can link in-memory ELF object files. Adding that feature shouldn't be hard.<br>
><br>
> It would be nice to have a similar interface to the one in libclang, where the driver is given a map that substitutes in-memory objects for specific files, so that the same command line can be used whether the inputs are on disk or in memory.<br>
<br>
</span>I would strongly object to expanding our "library" interface at the<br>
moment.<br>
<br>
Even what we currently have I think is a bad idea and a distraction from<br>
the current objective: writing an excellent stand alone linker. We<br>
benefit massively from simple error and memory management.<br>
<br>
Once the linker is "done", we can discuss other possible uses and their<br>
costs. By "done" I mean at least having all the features we want and<br>
having replaced bfd ld in at least two freebsd architectures.<br></blockquote><div><br></div></span><div>It seems reasonable to me to focus on this first, but do you agree that once lld gets to this milestone, the library API is a worthy time investment? </div></div></div></div>
</blockquote></div><br></div><div class="gmail_extra">I'm fine as long as our API is the same as the command line. In that sense, passing a map from filename to MemoryBuffer objects in addition to command line arguments is fine to me.</div></div>