]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: disable xref ELF note on mips64el
authorDavid Lamparter <equinox@opensourcerouting.org>
Fri, 6 Jan 2023 15:59:55 +0000 (16:59 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 6 Jan 2023 16:05:16 +0000 (17:05 +0100)
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>
lib/xref.h

index 0e3f00f6907f12eea6a9499b6a0ab1232f4c548b..37242bd79e8265b4eeb6e91f579b5d28422da0b7 100644 (file)
@@ -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