开发者

What happens when a symbol exists in system library, and multiple 3rd-party libraries when linking a program?

开发者 https://www.devze.com 2022-12-07 20:55 出处:网络
The next re开发者_如何学Govision of the POSIX / Single Unix Specification standard is expected to include a C compiler that is capable of producing shared objects / dynamic libraries.

The next re开发者_如何学Govision of the POSIX / Single Unix Specification standard is expected to include a C compiler that is capable of producing shared objects / dynamic libraries.

One of the comments caught my attention, and I'm quoting the essence of it here:

... some dynamic linker implementations require that an exhaustive list of exported symbols ...

I've also heard of __declspec(dllexport) in Microsoft toolchains, and likes.

The current wording for the next revision of the standard doesn't seem to include any capability to specify individual symbols for export, and I'm worried that I can't suppress the exporting of symbols internal to the implementation of my library.

While I seek a portable way to control the visibility of object file symbols, I'd also like to know how do linkers (from toolchains and within the OS) determine which of the many duplicate symbols to link with.

0

精彩评论

暂无评论...
验证码 换一张
取 消