[PATCH] D29640: [ELF] - Linkerscript - fix handling of OUTPUT_ARCH command.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 7 08:19:52 PST 2017
ruiu added inline comments.
================
Comment at: ELF/LinkerScript.cpp:1252-1255
+ // Handle cases like i386:x86-64.
+ if (consume(":"))
+ skip();
expect(")");
----------------
grimar wrote:
> ruiu wrote:
> > This is too specific to your test case. In general, you want to skip until a matching closing parenthesis.
> >
> > expect("(");
> > while (!Error && !consume(")")
> > skip();
> That would conflict with testcase we have I think:
>
> ```
> # RUN: echo "OUTPUT_ARCH(x, y)" > %t.script
> # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-freebsd %s -o %t1
> # RUN: not ld.lld -shared -o %t2 %t1 %t.script
> # RUN: llvm-readobj %t2 > /dev/null
> ```
>
> Isn't that too permissive ?
No, since we do not really parse it, tweaking this too hard to adopt existing test cases doesn't make much sense.
https://reviews.llvm.org/D29640
More information about the llvm-commits
mailing list