<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 8, 2016 at 6:54 AM, Kevin P. Neal <span dir="ltr"><<a href="mailto:kpn@neutralgood.org" target="_blank">kpn@neutralgood.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Sep 07, 2016 at 10:18:41PM +0000, Rui Ueyama via llvm-commits wrote:<br>
> ruiu added a comment.<br>
><br>
> If you think of this, that grammar looks very weird because it lacks a way to write a glob pattern containing a whitespace character. For example, if you want to write a pattern that matches strings starting with "foo " followed by any characters, you need this glob pattern: "foo *". However, if you write that in a linker script, it means the literal string "foo *" instead of a glob pattern, because the token is quoted. That means there's no way to express that in the linker script.<br>
><br>
> Being said that, this is what GNU does, and linker scripts are written that way, so unfortunately there's no way other than implementing the same thing.<br>
<br>
</span>It makes perfect sense. The shell normally handles globbing. That's the<br>
context in which it is normally done. And the shell doesn't do globbing<br>
of strings that are single or double quoted. So having globbing work<br>
differently than it does under the shell would be a POLA violation.<br></blockquote><div><br></div><div>I agree that there's some similarity between this and how shell handles wildcards, but I think the similarity is superficial. Shell has multi-stage command line expansion. Wildcards are expanded and then a resulting string is tokenized. Once it is tokenized, you don't need to (and can't) tell whether a token was quoted or not. On the other hand, in linker scripts, wildcards are expanded in a very late stage of the process, and whether it was quoted or not matters. That's pretty different from the shell's semantics.</div><div><br></div><div>By the way, what is POLA?<br></div></div></div></div>