This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/20218] Can't use __attribute__ ((visibility ("hidden"))) to hide a symbol
- From: "mark at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Dec 2006 06:35:19 -0000
- Subject: [Bug middle-end/20218] Can't use __attribute__ ((visibility ("hidden"))) to hide a symbol
- References: <bug-20218-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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