-/* FIXME: it is unclear if this is used, or if it is even correct. */
-#define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2)
+extern bfd_boolean riscv_frag_align_code (int);
+#define md_do_align(N, FILL, LEN, MAX, LABEL) \
+ if ((N) != 0 && !(FILL) && !need_pass_2 && subseg_text_p (now_seg)) \
+ { \
+ if (riscv_frag_align_code (N)) \
+ goto LABEL; \
+ }
+
+extern void riscv_handle_align (fragS *);
+#define HANDLE_ALIGN riscv_handle_align
+
+#define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4)