This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Avoid PLT when calling __sched_getaffinity_new


On Wed, 14 Oct 2015, H.J. Lu wrote:

> I don't have a testcase yet.  After removing all unnecessary PLT relocations
> on i386 and x86-64, we can do something similar to scripts/localplt.awk
> to check libc_pic.a.  Each arch can provide its own list, similar to
> localplt.data.

Note that this applies to all .so files installed by glibc (if a symbol 
should always be resolved within the same shared library, then this should 
be visible to the compiler by it being marked hidden at compilation time), 
not just libc.so.

I wonder about a non-architecture-specific approach along the lines of: if 
an object (in *_pic.a) has a relocation against a symbol (not local to 
that object file) not exported from its shared library, or (for functions 
but not for data) exported only at a non-default version, the symbol must 
have hidden visibility in that object.  (The special case for data symbols 
at non-default versions is because using aliases for data symbols is 
generally unsafe - it breaks the link between the library's reference to 
the symbol and the main executable's definition.)

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]