[lld] r227341 - Add a unit test for LinkerScript.

Simon Atanasyan simon at atanasyan.com
Thu Jan 29 23:51:30 PST 2015


Hi Rui,

On Wed, Jan 28, 2015 at 9:38 PM, Rui Ueyama <ruiu at google.com> wrote:
> Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=227341&r1=227340&r2=227341&view=diff
> ==============================================================================
> --- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
> +++ lld/trunk/lib/Driver/GnuLdDriver.cpp Wed Jan 28 12:38:50 2015

[...]

> @@ -623,7 +623,15 @@ bool GnuLdDriver::parse(int argc, const
>        if (isScript) {
>          if (ctx->logInputFiles())
>            diagnostics << path << "\n";
> -        std::error_code ec = evaluateLinkerScript(*ctx, realpath, diagnostics);
> +        ErrorOr<std::unique_ptr<MemoryBuffer>> mb =
> +          MemoryBuffer::getFileOrSTDIN(path);

You need to pass the `realpath` to the `getFileOrSTDIN` call.

> +        if (std::error_code ec = mb.getError()) {
> +          diagnostics << "Cannot open " << path << ": "
> +                      << ec.message() << "\n";
> +          return false;
> +        }

-- 
Simon Atanasyan



More information about the llvm-commits mailing list