aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-16 12:48:28 +1300
committerAndrew Chambers <[email protected]>2021-10-16 12:48:28 +1300
commit75da6e3498f7ddc4f701fac77a3d8b9d6e96ca8d (patch)
treedb92c8662f4ebdbd557bb82623e5b9bcf83eb3e8 /main.c
parent8a023c3ea8a62664283344f7d7b9e1a658d5db84 (diff)
Fix bug in xchg.
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/main.c b/main.c
index 86721e8..34c2f82 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,4 @@
#include "minias.h"
-#include <getopt.h>
/* Parsed assembly */
static AsmLine *allasm = NULL;
@@ -29,7 +28,7 @@ static Section *datarel = NULL;
static char *infilename = "<stdin>";
static size_t curlineno = 0;
-void lfatal(const char *fmt, ...) {
+static void lfatal(const char *fmt, ...) {
va_list ap;
fprintf(stderr, "%s:%ld: ", infilename, curlineno);
va_start(ap, fmt);
@@ -155,7 +154,7 @@ static void initsections(void) {
datarel->hdr.sh_entsize = sizeof(Elf64_Rela);
}
-Relocation *newreloc() {
+static Relocation *newreloc() {
if (nrelocs == reloccap) {
reloccap = nrelocs ? nrelocs * 2 : 64;
relocs = xreallocarray(relocs, reloccap, sizeof(Relocation));
@@ -559,7 +558,7 @@ static void assemblexchg(const Instr *xchg) {
rex = (Rex){
.required = isrexreg(xchg->arg1->kind) || isrexreg(xchg->arg2->kind),
.w = isreg64(xchg->arg1->kind) || isreg64(xchg->arg2->kind),
- .r = !!(regbits(reg) & (1 << 3)),
+ .b = !!(regbits(reg) & (1 << 3)),
};
assembleplusr(rex, prefix, opcode, regbits(reg));
} else {