代码拉取完成,页面将自动刷新
PLEASE READ ALL OF THIS FILE, ESPECIALLY IF YOU ARE DEFINING A NEW
PUBLIC HEADER IN LIBABIGAIL.
How symbols that are exported are controlled in libabigail
==========================================================
We try to limit the number of ELF symbols that are exported by the
libabigail.so shared library. We call this, "symbol visibility control".
As GNU/Linux is our development platform, we control symbol visibility
by using the visibility support of the G++ compiler.
How to do so is properly explained at https://gcc.gnu.org/wiki/Visibility.
All symbols are hidden by default
=================================
When building translation units that make up the libabigail.so shared
library, G++ is invoked with the -fvisibility=hidden directive. Which
instructs it to make symbols of functions and global variables
*locally* defined in the shared library, *NOT* exported (or global).
Exporting symbols of entities declared in public headers
========================================================
In a translation unit that is part of the libabigail.so shared
library, before including a header file that is a public libabigail
header (e.g, abg-ir.h), one need to declare:
#include "abg-internal.h"
ABG_BEGIN_EXPORT_DECLARATIONS
then all the public header files inclusion (using #include directives)
follow. At the end of these public header files inclusion, one need
to declare:
ABG_END_EXPORT_DECLARATIONS
The ABG_BEGIN_EXPORT_DECLARATIONS is a macro defined in abg-internal.h
which expands to:
#pragma GCC visibility push(default)
This instructs G++ to export the symbol of all global functions and
variables definitions that are declared from that point on.
The ABG_END_EXPORT_DECLARATIONS is a macro defined in abg-internal.h
which expands to:
#pragma GCC visibility pop
It instructs G++ to stop exporting symbols of global functions and
variable definition from that point on.
In practice, the pair ABG_BEGIN_EXPORT_DECLARATIONS,
ABG_END_EXPORT_DECLARATIONS allows us to only export symbols of
global functions and variables declared in the block denoted by these
two macros. Symbols of anything else that is declared outside of that block
are going to be hidden, thanks to the -fvisibility=hidden option
passed to G++.
So whenever you are defining a new header file with declarations that
ought to be part of the API of libabigail, the *definition* file which
defines the declarations of the header file must use
the ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS
macro to include the public header.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。