RFC: -Bsymbolic, hidden and protected

H. J. Lu hjl@lucon.org
Fri Mar 4 01:37:00 GMT 2005


On Fri, Mar 04, 2005 at 08:24:44AM +1030, Alan Modra wrote:
> On Thu, Mar 03, 2005 at 08:55:10AM -0800, H. J. Lu wrote:
> > On Thu, Mar 03, 2005 at 07:55:04AM -0800, H. J. Lu wrote:
> > > On Thu, Mar 03, 2005 at 11:19:13PM +1030, Alan Modra wrote:
> > > > On Wed, Mar 02, 2005 at 08:14:59PM -0800, H. J. Lu wrote:
> > > > > Protected visibility has almost everything, but requires
> > > > > special handling at run-time.
> > > > > 
> > > > > I was wondering if we could allow version script to overwrite
> > > > > hidden symbols. That is if a symbol is global in version script, we
> > > > > export it even if it is marked hidden. It may improve run-time
> > > > > performance.
> > > > 
> > > > How is this going to be different from using protected symbols?
> > > 
> > > No run-time special handling accociated with protected symbols, which
> > > may take extra lookup.
> > 
> > Also compiler/linker can't optimize protected function pointers.
> 
> Which means that if you export hidden function symbols from shared
> libraries by means of a version script, you will break function pointer
> comparisons.

Yes. If you don't do any function pointer comparisons on exported
functions in DSO, you should be OK.


H.J.



More information about the Binutils mailing list