------- Comment #40 from mark at codesourcery dot com 2006-12-07 06:35 ------- Subject: Re: Can't use __attribute__ ((visibility ("hidden"))) to hide a symbol
hjl at lucon dot org wrote: > http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00397.html I'm still not happy with the cgraph_optimize change. There's no reason for ELF to be special in this regard. The problem is that I don't think you can move process_pending_assemble_externals to the end of the compilation; on some systems the external declaration needs to appear before any reference to them. You could try just removing the call to process_pending_assemble_externals in cgraph_optimize, since there is another call at the end of compile_file -- but I'm afraid you'll break AIX and HP-UX. You would have to ask people to test on those platforms. Anyhow, with -fno-unit-at-a-time, we still call ASM_OUTPUT_EXTERNAL as we process declarations. I think we should just give up and not worry about whether or not the functions are referenced. All that will happen is that we'll get bigger .o files; the linker will rip all unreferenced functions out anyhow. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20218