diff options
| author | Andrew Chambers <[email protected]> | 2021-10-16 12:48:28 +1300 |
|---|---|---|
| committer | Andrew Chambers <[email protected]> | 2021-10-16 12:48:28 +1300 |
| commit | 75da6e3498f7ddc4f701fac77a3d8b9d6e96ca8d (patch) | |
| tree | db92c8662f4ebdbd557bb82623e5b9bcf83eb3e8 /main.c | |
| parent | 8a023c3ea8a62664283344f7d7b9e1a658d5db84 (diff) | |
Fix bug in xchg.
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 { |
