public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Symbol visibility and bypassing PLT for intra-DSO calls
@ 2012-11-12  8:39 Florian Weimer
  2012-11-12  9:01 ` Alexander Monakov
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2012-11-12  8:39 UTC (permalink / raw)
  To: gcc-help

Is there a way to use symbol visibility to bypass the PLT for intra-DSO 
calls, while still keeping the symbol public?  I don't need to support 
overriding the symbols from the outside, so the PLT indirection isn't 
needed.

-- 
Florian Weimer / Red Hat Product Security Team

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Symbol visibility and bypassing PLT for intra-DSO calls
  2012-11-12  8:39 Symbol visibility and bypassing PLT for intra-DSO calls Florian Weimer
@ 2012-11-12  9:01 ` Alexander Monakov
  2012-11-12  9:13   ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Monakov @ 2012-11-12  9:01 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc-help

On Mon, 12 Nov 2012, Florian Weimer wrote:

> Is there a way to use symbol visibility to bypass the PLT for intra-DSO calls,
> while still keeping the symbol public?  I don't need to support overriding the
> symbols from the outside, so the PLT indirection isn't needed.

Why do you need to use the visibility mechanism specifically?  From my
understanding, it sounds like you can use -Bsymbolic.

Alexander

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Symbol visibility and bypassing PLT for intra-DSO calls
  2012-11-12  9:01 ` Alexander Monakov
@ 2012-11-12  9:13   ` Florian Weimer
  2012-11-12 10:22     ` Alexander Monakov
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2012-11-12  9:13 UTC (permalink / raw)
  To: Alexander Monakov; +Cc: gcc-help

On 11/12/2012 10:01 AM, Alexander Monakov wrote:
> On Mon, 12 Nov 2012, Florian Weimer wrote:
>
>> Is there a way to use symbol visibility to bypass the PLT for intra-DSO calls,
>> while still keeping the symbol public?  I don't need to support overriding the
>> symbols from the outside, so the PLT indirection isn't needed.
>
> Why do you need to use the visibility mechanism specifically?  From my
> understanding, it sounds like you can use -Bsymbolic.

It would be sort-of nice to do this at the compiler level, so that the 
programmer doesn't have to specify a linker option.  And a finer 
granularity to control this feature might make sense in some cases.

-- 
Florian Weimer / Red Hat Product Security Team

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Symbol visibility and bypassing PLT for intra-DSO calls
  2012-11-12  9:13   ` Florian Weimer
@ 2012-11-12 10:22     ` Alexander Monakov
  2012-11-12 15:31       ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Monakov @ 2012-11-12 10:22 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc-help



On Mon, 12 Nov 2012, Florian Weimer wrote:

> On 11/12/2012 10:01 AM, Alexander Monakov wrote:
> > On Mon, 12 Nov 2012, Florian Weimer wrote:
> >
> > > Is there a way to use symbol visibility to bypass the PLT for intra-DSO
> > > calls,
> > > while still keeping the symbol public?  I don't need to support overriding
> > > the
> > > symbols from the outside, so the PLT indirection isn't needed.
> >
> > Why do you need to use the visibility mechanism specifically?  From my
> > understanding, it sounds like you can use -Bsymbolic.
> 
> It would be sort-of nice to do this at the compiler level, so that the
> programmer doesn't have to specify a linker option.  And a finer granularity
> to control this feature might make sense in some cases.

Is "protected" visibility what you need?  From the manual:

    Protected visibility is like default visibility except that it indicates
    that references within the defining module bind to the definition in that
    module. That is, the declared entity cannot be overridden by another module.

Alexander

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Symbol visibility and bypassing PLT for intra-DSO calls
  2012-11-12 10:22     ` Alexander Monakov
@ 2012-11-12 15:31       ` Florian Weimer
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Weimer @ 2012-11-12 15:31 UTC (permalink / raw)
  To: Alexander Monakov; +Cc: gcc-help

On 11/12/2012 11:22 AM, Alexander Monakov wrote:

>> It would be sort-of nice to do this at the compiler level, so that the
>> programmer doesn't have to specify a linker option.  And a finer granularity
>> to control this feature might make sense in some cases.
>
> Is "protected" visibility what you need?  From the manual:
>
>      Protected visibility is like default visibility except that it indicates
>      that references within the defining module bind to the definition in that
>      module. That is, the declared entity cannot be overridden by another module.

Yes, this should do it, thanks.  I was confused by the 
-fvisibility=protected documentation.

-- 
Florian Weimer / Red Hat Product Security Team

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-12 15:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-12  8:39 Symbol visibility and bypassing PLT for intra-DSO calls Florian Weimer
2012-11-12  9:01 ` Alexander Monakov
2012-11-12  9:13   ` Florian Weimer
2012-11-12 10:22     ` Alexander Monakov
2012-11-12 15:31       ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).