diff options
| author | David Lamparter <equinox@diac24.net> | 2021-02-02 19:38:38 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2021-02-03 00:55:07 +0100 |
| commit | 08a73c422de98eb12a5f3a86112e7a4829eb3fd6 (patch) | |
| tree | 4e70d2ce2c2c5ecaae37799acf1b1fafcc7beed9 /doc/developer | |
| parent | 96a70614507b75def9baf590dcac91ed88c268ff (diff) | |
lib/xref: work around GCC bug 41091
gcc fucks up global variables with section attributes when they're used
in templated C++ code. The template instantiation "magic" kinda breaks
down (it's implemented through COMDAT in the linker, which clashes with
the section attribute.)
The workaround provides full runtime functionality, but the xref
extraction tool (xrelfo.py) won't work on C++ code compiled by GCC.
FWIW, clang gets this right.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'doc/developer')
| -rw-r--r-- | doc/developer/xrefs.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/developer/xrefs.rst b/doc/developer/xrefs.rst index 689a21cc1f..6a0794d41b 100644 --- a/doc/developer/xrefs.rst +++ b/doc/developer/xrefs.rst @@ -161,3 +161,10 @@ the xref array is in the file. Also note the owner is clearly marked as For SystemTap's use of ELF notes, refer to https://libstapsdt.readthedocs.io/en/latest/how-it-works/internals.html as an entry point. + +.. note:: + + Due to GCC bug 41091, the "xref_array" section is not correctly generated + for C++ code when compiled by GCC. A workaround is present for runtime + functionality, but to extract the xrefs from a C++ source file, it needs + to be built with clang (or a future fixed version of GCC) instead. |
