------- Comment #35 from hjl at lucon dot org  2006-12-06 06:55 -------
(In reply to comment #34)
> Subject: Re:  Can't use __attribute__ ((visibility ("hidden")))
>  to hide a symbol
> 
> hjl at lucon dot org wrote:
> > ------- Comment #33 from hjl at lucon dot org  2006-12-05 23:58 -------
> > The updated patch is posted at
> > 
> > http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00361.html
> 
> I don't see anything in your patch to replace the call to
> process_pending_assemble_externals that you removed on platforms other
> than the ones you changed.

I guess I should only remove it for ELF. Can I use

#ifndef OBJECT_FORMAT_ELF
  process_pending_assemble_externals ();
#endif

instead of deleting it?

> 
> Why can't you just let that function do its job, and emit the visibility
> markers at that point?
> 

The problem is we don't know if a symbol is referenced or not at that time.
We don't want to generate

          .hidden foo

just because there is

extern int foo __attribute__ ((visibility ("hidden")));

We should mark it hidden only if it is referenced.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20218

Reply via email to