summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2023-01-06 16:59:55 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-01-09 18:27:02 +0000
commit1a89a6f79db101b15299ae19d36d459d2e9673d9 (patch)
tree14b7f8a08eb9f0fc0243fcc85435c58485687920
parent00624c9564457eb62adcd908b310f4df65b0efe5 (diff)
lib: disable xref ELF note on mips64el
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> (cherry picked from commit ee4a6b9f654fbd4e07485037481ad6b4766bbc6d)
-rw-r--r--lib/xref.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/xref.h b/lib/xref.h
index 0e3f00f690..37242bd79e 100644
--- a/lib/xref.h
+++ b/lib/xref.h
@@ -208,8 +208,19 @@ extern const struct xref * const __stop_xref_array[1] DSO_LOCAL;
* some build issue with it just add -DFRR_XREF_NO_NOTE to your build flags
* to disable it.
*/
-#ifdef FRR_XREF_NO_NOTE
+#if defined(FRR_XREF_NO_NOTE) || defined(__mips64)
#define XREF_NOTE ""
+
+/* mips64 note: MIPS64 (regardless of endianness, both mips64 & mips64el)
+ * does not have a 64-bit PC-relative relocation type. Unfortunately, a
+ * 64-bit PC-relative relocation is exactly what the below asm magic emits.
+ * Therefore, the xref ELF note is permanently disabled on MIPS64.
+ *
+ * For some context, refer to https://reviews.llvm.org/D80390
+ *
+ * As noted above, xref extraction still works through the section header
+ * path, so no functionality is lost.
+ */
#else
#if __SIZEOF_POINTER__ == 4