1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-13 12:59:59 +00:00
oot/tools/fado/lib/fairy/fairy_data.inc

127 lines
4.4 KiB
PHP
Raw Normal View History

New relocation-generating program (#1016) * Update makefiles * git subrepo clone git@github.com:EllipticEllipsis/fado.git tools/fado subrepo: subdir: "tools/fado" merged: "46c4d751a" upstream: origin: "git@github.com:EllipticEllipsis/fado.git" branch: "master" commit: "46c4d751a" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/fado subrepo: subdir: "tools/fado" merged: "88114ebce" upstream: origin: "git@github.com:EllipticEllipsis/fado.git" branch: "master" commit: "88114ebce" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * A few ideas for computing dependencies * Remove reserved identifiers from spec.h and util.h and add required headers * Fix a couple more headers * Program for reloc prerequisites * git subrepo pull tools/fado subrepo: subdir: "tools/fado" merged: "36a905f72" upstream: origin: "git@github.com:EllipticEllipsis/fado.git" branch: "master" commit: "36a905f72" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * Update makefile to make dependency files and use overlay's name * git subrepo pull tools/fado subrepo: subdir: "tools/fado" merged: "43c339a59" upstream: origin: "git@github.com:EllipticEllipsis/fado.git" branch: "master" commit: "43c339a59" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * Change awk to grep, delete ZAPD files, gitignore elf * Delete all the cfg files * Fix memory leaks * Rename and add coloured errors * Makefile tweaks - preprocess spec before grep - split order prerequisites via phony target to reduce dependency edges - remove `resources` target - remove separate overlays targets - use `$(SPEC)` throughout - change to using filenames of relocs for overlay names via `$*` - Rearrange targets to better reflect their categories * Update gitignore * Review * Add a check for the reloc file name * get_segment_by_name * get_stmt_id_by_stmt_name * Cleaning up * algorithm change * function rename * Fix typos Co-authored-by: angie <angheloalf95@gmail.com>
2022-02-06 19:40:26 +00:00
/* Copyright (C) 2021 Elliptic Ellipsis */
/* SPDX-License-Identifier: AGPL-3.0-only */
#include "fairy.h"
#include "mips_elf.h"
New relocation-generating program (#1016) * Update makefiles * git subrepo clone git@github.com:EllipticEllipsis/fado.git tools/fado subrepo: subdir: "tools/fado" merged: "46c4d751a" upstream: origin: "git@github.com:EllipticEllipsis/fado.git" branch: "master" commit: "46c4d751a" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/fado subrepo: subdir: "tools/fado" merged: "88114ebce" upstream: origin: "git@github.com:EllipticEllipsis/fado.git" branch: "master" commit: "88114ebce" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * A few ideas for computing dependencies * Remove reserved identifiers from spec.h and util.h and add required headers * Fix a couple more headers * Program for reloc prerequisites * git subrepo pull tools/fado subrepo: subdir: "tools/fado" merged: "36a905f72" upstream: origin: "git@github.com:EllipticEllipsis/fado.git" branch: "master" commit: "36a905f72" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * Update makefile to make dependency files and use overlay's name * git subrepo pull tools/fado subrepo: subdir: "tools/fado" merged: "43c339a59" upstream: origin: "git@github.com:EllipticEllipsis/fado.git" branch: "master" commit: "43c339a59" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * Change awk to grep, delete ZAPD files, gitignore elf * Delete all the cfg files * Fix memory leaks * Rename and add coloured errors * Makefile tweaks - preprocess spec before grep - split order prerequisites via phony target to reduce dependency edges - remove `resources` target - remove separate overlays targets - use `$(SPEC)` throughout - change to using filenames of relocs for overlay names via `$*` - Rearrange targets to better reflect their categories * Update gitignore * Review * Add a check for the reloc file name * get_segment_by_name * get_stmt_id_by_stmt_name * Cleaning up * algorithm change * function rename * Fix typos Co-authored-by: angie <angheloalf95@gmail.com>
2022-02-06 19:40:26 +00:00
// 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