/* Copyright (C) 2021 Elliptic Ellipsis */
/* SPDX-License-Identifier: AGPL-3.0-only */
#include "fairy.h"
#include "mips_elf.h"

// clang-format off
static const FairyDefineString stTypes[] = {
    FAIRY_DEF_STRING(STT_, NOTYPE),
    FAIRY_DEF_STRING(STT_, OBJECT),
    FAIRY_DEF_STRING(STT_, FUNC),
    FAIRY_DEF_STRING(STT_, SECTION),
    FAIRY_DEF_STRING(STT_, FILE),
    FAIRY_DEF_STRING(STT_, COMMON),
    FAIRY_DEF_STRING(STT_, TLS),
    FAIRY_DEF_STRING(STT_, NUM),
    FAIRY_DEF_STRING(STT_, LOOS),
    FAIRY_DEF_STRING(STT_, GNU_IFUNC),
    FAIRY_DEF_STRING(STT_, HIOS),
    FAIRY_DEF_STRING(STT_, LOPROC),
    FAIRY_DEF_STRING(STT_, HIPROC),
    { 0 },
};

static const FairyDefineString stBinds[] = {
    FAIRY_DEF_STRING(STB_, LOCAL),
    FAIRY_DEF_STRING(STB_, GLOBAL),
    FAIRY_DEF_STRING(STB_, WEAK),
    FAIRY_DEF_STRING(STB_, NUM),
    FAIRY_DEF_STRING(STB_, LOOS),
    FAIRY_DEF_STRING(STB_, GNU_UNIQUE),
    FAIRY_DEF_STRING(STB_, HIOS),
    FAIRY_DEF_STRING(STB_, LOPROC),
    FAIRY_DEF_STRING(STB_, HIPROC),
    { 0 },
};

static const FairyDefineString stVisibilities[] = {
    FAIRY_DEF_STRING(STV_, DEFAULT),
    FAIRY_DEF_STRING(STV_, INTERNAL),
    FAIRY_DEF_STRING(STV_, HIDDEN),
    FAIRY_DEF_STRING(STV_, PROTECTED),
    { 0 },
};

/* TODO: understand this data better: there are several cases with the same number */
static const FairyDefineString shTypes[] = {
    FAIRY_DEF_STRING(SHT_, NULL),
    FAIRY_DEF_STRING(SHT_, PROGBITS),
    FAIRY_DEF_STRING(SHT_, SYMTAB),
    FAIRY_DEF_STRING(SHT_, STRTAB),
    FAIRY_DEF_STRING(SHT_, RELA),
    FAIRY_DEF_STRING(SHT_, HASH),
    FAIRY_DEF_STRING(SHT_, DYNAMIC),
    FAIRY_DEF_STRING(SHT_, NOTE),
    FAIRY_DEF_STRING(SHT_, NOBITS),
    FAIRY_DEF_STRING(SHT_, REL),
    FAIRY_DEF_STRING(SHT_, SHLIB),
    FAIRY_DEF_STRING(SHT_, DYNSYM),
    FAIRY_DEF_STRING(SHT_, INIT_ARRAY),
    FAIRY_DEF_STRING(SHT_, FINI_ARRAY),
    FAIRY_DEF_STRING(SHT_, PREINIT_ARRAY),
    FAIRY_DEF_STRING(SHT_, GROUP),
    FAIRY_DEF_STRING(SHT_, SYMTAB_SHNDX),
    FAIRY_DEF_STRING(SHT_, NUM),
    FAIRY_DEF_STRING(SHT_, LOOS),
    FAIRY_DEF_STRING(SHT_, GNU_ATTRIBUTES),
    FAIRY_DEF_STRING(SHT_, GNU_HASH),
    FAIRY_DEF_STRING(SHT_, GNU_LIBLIST),
    FAIRY_DEF_STRING(SHT_, CHECKSUM),
    FAIRY_DEF_STRING(SHT_, LOSUNW),
    FAIRY_DEF_STRING(SHT_, SUNW_move),
    FAIRY_DEF_STRING(SHT_, SUNW_COMDAT),
    FAIRY_DEF_STRING(SHT_, SUNW_syminfo),
    FAIRY_DEF_STRING(SHT_, GNU_verdef),
    FAIRY_DEF_STRING(SHT_, GNU_verneed),
    FAIRY_DEF_STRING(SHT_, GNU_versym),
    FAIRY_DEF_STRING(SHT_, HISUNW),
    FAIRY_DEF_STRING(SHT_, HIOS),
    FAIRY_DEF_STRING(SHT_, LOPROC),
    FAIRY_DEF_STRING(SHT_, HIPROC),
    FAIRY_DEF_STRING(SHT_, LOUSER),
    FAIRY_DEF_STRING(SHT_, HIUSER),
    FAIRY_DEF_STRING(SHT_, MIPS_LIBLIST),
    FAIRY_DEF_STRING(SHT_, MIPS_MSYM),
    FAIRY_DEF_STRING(SHT_, MIPS_CONFLICT),
    FAIRY_DEF_STRING(SHT_, MIPS_GPTAB),
    FAIRY_DEF_STRING(SHT_, MIPS_UCODE),
    FAIRY_DEF_STRING(SHT_, MIPS_DEBUG),
    FAIRY_DEF_STRING(SHT_, MIPS_REGINFO),
    FAIRY_DEF_STRING(SHT_, MIPS_PACKAGE),
    FAIRY_DEF_STRING(SHT_, MIPS_PACKSYM),
    FAIRY_DEF_STRING(SHT_, MIPS_RELD),
    FAIRY_DEF_STRING(SHT_, MIPS_IFACE),
    FAIRY_DEF_STRING(SHT_, MIPS_CONTENT),
    FAIRY_DEF_STRING(SHT_, MIPS_OPTIONS),
    FAIRY_DEF_STRING(SHT_, MIPS_SHDR),
    FAIRY_DEF_STRING(SHT_, MIPS_FDESC),
    FAIRY_DEF_STRING(SHT_, MIPS_EXTSYM),
    FAIRY_DEF_STRING(SHT_, MIPS_DENSE),
    FAIRY_DEF_STRING(SHT_, MIPS_PDESC),
    FAIRY_DEF_STRING(SHT_, MIPS_LOCSYM),
    FAIRY_DEF_STRING(SHT_, MIPS_AUXSYM),
    FAIRY_DEF_STRING(SHT_, MIPS_OPTSYM),
    FAIRY_DEF_STRING(SHT_, MIPS_LOCSTR),
    FAIRY_DEF_STRING(SHT_, MIPS_LINE),
    FAIRY_DEF_STRING(SHT_, MIPS_RFDESC),
    FAIRY_DEF_STRING(SHT_, MIPS_DELTASYM),
    FAIRY_DEF_STRING(SHT_, MIPS_DELTAINST),
    FAIRY_DEF_STRING(SHT_, MIPS_DELTACLASS),
    FAIRY_DEF_STRING(SHT_, MIPS_DWARF),
    FAIRY_DEF_STRING(SHT_, MIPS_DELTADECL),
    FAIRY_DEF_STRING(SHT_, MIPS_SYMBOL_LIB),
    FAIRY_DEF_STRING(SHT_, MIPS_EVENTS),
    FAIRY_DEF_STRING(SHT_, MIPS_TRANSLATE),
    FAIRY_DEF_STRING(SHT_, MIPS_PIXIE),
    FAIRY_DEF_STRING(SHT_, MIPS_XLATE),
    FAIRY_DEF_STRING(SHT_, MIPS_XLATE_DEBUG),
    FAIRY_DEF_STRING(SHT_, MIPS_WHIRL),
    FAIRY_DEF_STRING(SHT_, MIPS_EH_REGION),
    FAIRY_DEF_STRING(SHT_, MIPS_XLATE_OLD),
    FAIRY_DEF_STRING(SHT_, MIPS_PDR_EXCEPTION),
    // FAIRY_DEF_STRING(SHT_, MIPS_XHASH), /* New in 2019 */
    { 0 },
};

// clang-format on
