This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: ld script fails to hide symbols


On Fri, Feb 15, 2019 at 11:33 AM Ronghua Zhang <ronghuazhang@gmail.com> wrote:
>
> I have a .so library that uses boost and google protobuf. I don't want
> symbols from boost and goole protobuf library to be exposed, so I used the
> following ldscript:
>
> {
>     global:
>         extern "C++" {
>             mynamespace::*;
>         };
>     local: *;
> };
>
> From the output of nm, almost all symbols from boost and google protobuf
> disappeared, but a few symbols are left:
>
> nm -D -C <mylib.so>

Don't use nm for these kinds of things.  Please use "readelf -sW" instead.

> 0000000000000108 b
> boost::asio::detail::keyword_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::task_io_service,
> boost::asio::detail::task_io_service_thread_info>::context>::value_
> 0000000000000000 d google::protobuf::internal::ArenaImpl::thread_cache_
> 00000000000000d8 b grpc_core::ExecCtx::exec_ctx_
>
> I also noticed that although most are marked  T as expected, a few
> functions in the library as marked weak symbols (W). Why is that?
>
> 00000000002b5ae0 W mynamespace::ServiceImpl::data_collection() const
>
> The function is impleme



-- 
H.J.


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