From 1251e94a0c0e123558bef9dc072dae4b5ada6835 Mon Sep 17 00:00:00 2001
From: c8ef <c8ef@outlook.com>
Date: Fri, 19 Jul 2024 19:29:44 +0800
Subject: [PATCH 1/2] modify psABI link

---
 c2mir/x86_64/cx86_64-ABI-code.c   | 5 +++--
 c2mir/x86_64/cx86_64-code.c       | 2 +-
 c2mir/x86_64/mirc_x86_64_stdarg.h | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/c2mir/x86_64/cx86_64-ABI-code.c b/c2mir/x86_64/cx86_64-ABI-code.c
index a84ff2f73f..b8fc85e454 100644
--- a/c2mir/x86_64/cx86_64-ABI-code.c
+++ b/c2mir/x86_64/cx86_64-ABI-code.c
@@ -3,8 +3,9 @@
    x86_64 ABI target specific code.
 */
 
-/* See https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf.  We use MIR_T_UNDEF for
-   MEMORY. */
+/* See https://gitlab.com/x86-psABIs/x86-64-ABI.
+ * We use MIR_T_UNDEF for MEMORY.
+ */
 
 enum add_arg_class { NO_CLASS = MIR_T_BOUND + 1, X87UP_CLASS };
 
diff --git a/c2mir/x86_64/cx86_64-code.c b/c2mir/x86_64/cx86_64-code.c
index f57f691744..e8a0d5855f 100644
--- a/c2mir/x86_64/cx86_64-code.c
+++ b/c2mir/x86_64/cx86_64-code.c
@@ -24,7 +24,7 @@ static string_include_t standard_includes[]
 #define ADJUST_VAR_ALIGNMENT(c2m_ctx, align, type) x86_adjust_var_alignment (c2m_ctx, align, type)
 
 static int x86_adjust_var_alignment (c2m_ctx_t c2m_ctx, int align, struct type *type) {
-  /* see https://www.uclibc.org/docs/psABI-x86_64.pdf */
+  /* see https://gitlab.com/x86-psABIs/x86-64-ABI */
   if (type->mode == TM_ARR && raw_type_size (c2m_ctx, type) >= 16) return 16;
   return align;
 }
diff --git a/c2mir/x86_64/mirc_x86_64_stdarg.h b/c2mir/x86_64/mirc_x86_64_stdarg.h
index 3ef106d18b..521742ed03 100644
--- a/c2mir/x86_64/mirc_x86_64_stdarg.h
+++ b/c2mir/x86_64/mirc_x86_64_stdarg.h
@@ -2,7 +2,7 @@
    Copyright (C) 2019-2024 Vladimir Makarov <vmakarov.gcc@gmail.com>.
 */
 
-/* See C11 7.16 and https://www.uclibc.org/docs/psABI-x86_64.pdf */
+/* See C11 7.16 and https://gitlab.com/x86-psABIs/x86-64-ABI */
 static char stdarg_str[]
   = "#ifndef __STDARG_H\n"
     "#define __STDARG_H\n"

From 69c920899029ac1f0c1036ec700e9be4fbfcb14c Mon Sep 17 00:00:00 2001
From: c8ef <c8ef@outlook.com>
Date: Fri, 19 Jul 2024 21:04:32 +0800
Subject: [PATCH 2/2] style adjust

---
 c2mir/x86_64/cx86_64-ABI-code.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/c2mir/x86_64/cx86_64-ABI-code.c b/c2mir/x86_64/cx86_64-ABI-code.c
index b8fc85e454..9c9f60381b 100644
--- a/c2mir/x86_64/cx86_64-ABI-code.c
+++ b/c2mir/x86_64/cx86_64-ABI-code.c
@@ -4,8 +4,8 @@
 */
 
 /* See https://gitlab.com/x86-psABIs/x86-64-ABI.
- * We use MIR_T_UNDEF for MEMORY.
- */
+   We use MIR_T_UNDEF for MEMORY.
+*/
 
 enum add_arg_class { NO_CLASS = MIR_T_BOUND + 1, X87UP_CLASS };