diff --git a/src/util.h b/src/util.h
index f63a89..54a3f1 100644
--- a/src/util.h
+++ b/src/util.h
@@ -50,7 +50,13 @@
 #define PRINTF(...) __attribute__((__format__(printf, __VA_ARGS__)))
 #define FLATTEN __attribute__((__flatten__))
 #define PACKED __attribute__((__packed__))
-#define VERSION(sym, ver) __asm__(".symver " # sym "," # ver)
+#if defined(__GNUC__)
+# if __GNUC__ >= 10
+#  define VERSION(sym, ver) __attribute__ ((symver (# ver)))
+# else
+#  define VERSION(sym, ver) __asm__(".symver " # sym "," # ver);
+# endif
+#endif

 /*
  * I'm not actually sure when these appear, but they're present in the
