summaryrefslogtreecommitdiff
path: root/lib/xref.h
AgeCommit message (Collapse)Author
2023-01-06lib: disable xref ELF note on mips64elDavid Lamparter
mips64el does not have a 64-bit PC-relative relocation, which is needed to emit the ELF note for xrefs. Disabling the ELF note means clippy takes the fallback path using section headers, so everything does still work (... unless you strip the section headers.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-10lib: stuff xrefs into a tree for lookupDavid Lamparter
... so we can actually access by UID without searching the entire list. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-05-17lib: libyang2 add missed conversionChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-05-02lib: rework how we "override" assert()David Lamparter
The previous method, using zassert.h and hoping nothing includes assert.h (which, on glibc at least, just does "#undef assert" and puts its own definition in...) was fragile - and actually broke undetected. Just provide our own assert.h and control overriding by putting it in a separate directory to add to the include path (or not.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-15lib: disable ASAN redzone around xref_p/xref_arrayDavid Lamparter
The "xref_p" variables are placed in the "xref_array" section specifically so they're next to each other and we get an array at the end. The ASAN redzone that is inserted around global variables is breaks that since it'd be inserted before and after each of the array items. So disable the ASAN redzone for these variables (and only these variables, nothing else should be affected.) Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after FRR_DAEMON_INFO & co.David Lamparter
... again ... Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-03lib/xref: fix initializer order for C++David Lamparter
[v2: drop designated initializer names] Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-03lib/xref: work around GCC bug 41091David Lamparter
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>
2021-02-03lib/xref: restore lost extern "C" beginningDavid Lamparter
The `}` is still there, but the `extern "C" {` got lost somewhere, probably in a rebase... Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-01lib/xref: add xrefs for install_element()David Lamparter
Combined with the DEFUN xrefs, this means we can extract the full CLI tree from a binary file. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-01lib/xref: add xrefs for DEFUNsDavid Lamparter
This allows grabbing a list of all DEFUNs and their help texts through the xref extraction mechanics. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-01lib/xref: add xrefs on zlog_* callsDavid Lamparter
This allows extracting a list of all log messages including their ECs and autogenerated unique IDs for them. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-01lib/xref: use to transport thread_* file/line/funcDavid Lamparter
Just a better way of doing what was previously the "debugargdef" macro. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-01lib: "xref" identifier infrastructureDavid Lamparter
This adds the machinery for cross reference points (hence "xref") for things to be annotated with source code location or other metadata and/or to be uniquely identified and found at runtime or by dissecting executable files. The extraction tool to walk down an ELF file is done and working but needs some more cleanup and will be added in a separate commit. Signed-off-by: David Lamparter <equinox@diac24.net>