PATCH COMMITTED: Let -frepo look for symbol name in single quotes

Ian Lance Taylor iant@google.com
Mon Mar 31 21:45:00 GMT 2008


"Joseph S. Myers" <joseph@codesourcery.com> writes:

> On Mon, 31 Mar 2008, Ian Lance Taylor wrote:
>
>> gold outputs undefined symbol names in single quotes:
>> 
>> ld: hello.o: in function main:hello.c:5: undefined reference to 'puts'
>> 
>> This differs from GNU ld, which use mismatched quotes:
>> 
>> hello.c:5: undefined reference to `puts'
>> 
>> Currently collect2 when using -frepo looks at linker error messages
>> for mismatched quotes, and looks for double quotes, but does not look
>> for single quotes.  I think single quotes are an appropriate choice,
>> especially since that is what gcc itself uses.
>
> Does collect2 make sure the run the linker in the C locale if it's going 
> to look for these messages?

Not that I can see.

> If not, any sort of check for particular 
> quotation styles is broken.

Yes.

> (I don't know if the same linker run will be producing both messages going 
> to the user and messages parsed by collect2 like this.  If it will, a 
> better protocol for communication between them is needed, so the user can 
> see messages with locale-appropriate quotes and collect2 can still get the 
> information it needs.)

I think that collect2 runs the linker once.  If it suceeeds, it sends
the output to the user.  If it fails, it analyzes the error messages,
rebuilds some stuff, and runs the linker again.

So, yes, a better protocol is needed.  We can write one for GNU ld and
gold.  -frepo is designed to work with other linkers too, which is why
it looks for various different styles of error messages.

I don't personally put a very high priority on this, as I believe that
-frepo is rarely used.  But perhaps there is a user population out
there of which I am unaware.

Ian



More information about the Gcc-patches mailing list