On Tue, 2015-11-10 at 17:26 +0100, Bernd Schmidt wrote:
> On 11/10/2015 05:35 PM, David Malcolm wrote:
> > +  /* Nasty workaround to convince the linker to add
> > +      rich_location::add_fixit_insert
> > +      rich_location::add_fixit_remove
> > +      rich_location::add_fixit_replace
> > +     to cc1 for use by diagnostic_plugin_test_show_locus,
> > +     before anything in cc1 is using them.
> > +
> > +     This conditional should never hold, but hopefully the compiler can't
> > +     figure that out.  */
> 
> Does attribute((used)) help with this problem?

For some reason, I'm no longer seeing the problem; I tried simply taking
out the kludge, and it now works (this is *without* the in-cc1 usage in
patch 2); looking at cc1 shows that the above 3 symbols are indeed being
added:

$ eu-readelf -s ./cc1 |grep add_fixit
 2510: 00000000012a5280     94 FUNC    GLOBAL DEFAULT       13 
_ZN13rich_location16add_fixit_insertEjPKc
 2905: 00000000012a5300     76 FUNC    GLOBAL DEFAULT       13 
_ZN13rich_location16add_fixit_removeE12source_range
 9262: 00000000012a5390     94 FUNC    GLOBAL DEFAULT       13 
_ZN13rich_location17add_fixit_replaceE12source_rangePKc
37430: 00000000012a5300     76 FUNC    GLOBAL DEFAULT       13 
_ZN13rich_location16add_fixit_removeE12source_range
46935: 00000000012a5390     94 FUNC    GLOBAL DEFAULT       13 
_ZN13rich_location17add_fixit_replaceE12source_rangePKc
47508: 00000000012a5280     94 FUNC    GLOBAL DEFAULT       13 
_ZN13rich_location16add_fixit_insertEjPKc

I've tried poking at it, but I'm not sure what changed since I first
added the kludge (an earlier version of this, sent as:
https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00732.html
); sorry.

Dave

Reply via email to