-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
308 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* BFD support for Athena. | ||
Copyright (C) 2022 d0p1. | ||
This file is part of BFD, the Binary File Descriptor library. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; see the file COPYING3. If not, | ||
see <http://www.gnu.org/licenses/>. */ | ||
|
||
#include "sysdep.h" | ||
#include "bfd.h" | ||
#include "libbfd.h" | ||
|
||
const bfd_arch_info_type bfd_athena_arch = | ||
{ | ||
/* word size */ | ||
32, | ||
|
||
/* address size */ | ||
32, | ||
|
||
/* byte size */ | ||
8, | ||
|
||
/* arch enum */ | ||
bfd_arch_athena, | ||
|
||
/* machine num */ | ||
bfd_mach_athena, | ||
|
||
/* arch name */ | ||
"athena", | ||
|
||
/* printable name */ | ||
"Athena", | ||
|
||
/* alligment */ | ||
4, | ||
|
||
/* is default */ | ||
true, | ||
|
||
/* default check compat */ | ||
bfd_default_compatible, | ||
|
||
/* */ | ||
bfd_default_scan, | ||
|
||
/* memory alloc */ | ||
bfd_arch_default_fill, | ||
|
||
NULL, | ||
|
||
0 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* 32-bit ELF support for Athena. | ||
Copyright (C) 2022 d0p1. | ||
This file is part of BFD, the Binary File Descriptor library. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; see the file COPYING3. If not, | ||
see <http://www.gnu.org/licenses/>. */ | ||
|
||
#include "sysdep.h" | ||
#include "bfd.h" | ||
#include "libbfd.h" | ||
#include "elf-bfd.h" | ||
|
||
static reloc_howto_type * | ||
bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, | ||
bfd_reloc_code_real_type code) | ||
{ | ||
(void)code; | ||
return NULL; | ||
} | ||
|
||
static reloc_howto_type * | ||
bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, | ||
const char *r_name) | ||
{ | ||
(void)r_name; | ||
return NULL; | ||
} | ||
|
||
#define ELF_ARCH bfd_arch_athena | ||
#define ELF_MAXPAGESIZE 4096 | ||
#define ELF_MACHINE_CODE EM_ATHENA | ||
|
||
#define TARGET_BIG_SYM athena_elf32_vec | ||
#define TARGET_BIG_NAME "elf32-athena" | ||
|
||
#include "elf32-target.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
/* tc-athena.c -- Assemble for the Athena ISA | ||
Copyright (C) 2022 d0p1. | ||
This file is part of GAS. | ||
GAS is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 3 of the license, or | ||
(at your option) any later version. | ||
GAS is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; see the file COPYING3. If not, | ||
see <http://www.gnu.org/licenses/>. */ | ||
|
||
#include "as.h" | ||
#include "bfd.h" | ||
|
||
|
||
const char *md_shortopts = ""; | ||
struct option md_longopts[] = {}; | ||
size_t md_longopts_size = sizeof(md_longopts); | ||
|
||
const char comment_chars[] = ""; | ||
const char line_comment_chars[] = "//"; | ||
const char line_separator_chars[] = ";"; | ||
|
||
const char EXP_CHARS[] = ""; | ||
const char FLT_CHARS[] = ""; | ||
|
||
const pseudo_typeS md_pseudo_table[] = | ||
{ | ||
{ NULL, NULL, 0 } | ||
}; | ||
|
||
int md_parse_option(int c, const char *arg) | ||
{ | ||
(void)c; | ||
(void)arg; | ||
return (0); | ||
} | ||
|
||
void md_show_usage(FILE *stream) | ||
{ | ||
fprintf(stream, "Athena Hello\n"); | ||
} | ||
|
||
void md_begin(void) | ||
{ | ||
|
||
} | ||
|
||
void md_assemble(char *insn_str) | ||
{ | ||
(void)insn_str; | ||
} | ||
|
||
symbolS *md_undefined_symbol(char *name) | ||
{ | ||
(void)name; | ||
|
||
return (NULL); | ||
} | ||
|
||
const char *md_atof(int type, char *lit, int *size) | ||
{ | ||
(void)type; | ||
(void)lit; | ||
(void)size; | ||
return (NULL); | ||
} | ||
|
||
valueT md_section_align(asection *seg, valueT val) | ||
{ | ||
(void)seg; | ||
(void)val; | ||
|
||
return (0); | ||
} | ||
|
||
void md_convert_frag(bfd *abfd, asection *seg, fragS *fragp) | ||
{ | ||
(void)abfd; | ||
(void)seg; | ||
(void)fragp; | ||
} | ||
|
||
void md_apply_fix(fixS *fixp, valueT *val, segT seg) | ||
{ | ||
(void)fixp; | ||
(void)val; | ||
(void)seg; | ||
} | ||
|
||
arelent *tc_gen_reloc(asection *seg, fixS *fixp) | ||
{ | ||
(void)seg; | ||
(void)fixp; | ||
|
||
return (NULL); | ||
} | ||
|
||
long md_pcrel_from(fixS *fixp) | ||
{ | ||
(void)fixp; | ||
return 0; | ||
} | ||
|
||
int md_estimate_size_before_relax(fragS *fragp, asection *seg) | ||
{ | ||
(void)fragp; | ||
(void)seg; | ||
|
||
as_fatal(_("wtf bro")); | ||
return (0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* tc-athena.h -- Assemble for the Athena ISA | ||
Copyright (C) 2022 d0p1. | ||
This file is part of GAS. | ||
GAS is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 3 of the license, or | ||
(at your option) any later version. | ||
GAS is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; see the file COPYING3. If not, | ||
see <http://www.gnu.org/licenses/>. */ | ||
|
||
#ifndef TC_ATHENA_H | ||
#define TC_ATHENA_H | ||
|
||
#define TARGET_FORMAT "elf32-athena" | ||
#define TARGET_ARCH bfd_arch_athena | ||
#define TARGET_MARCH bfd_mach_athena | ||
|
||
|
||
#define md_operand(x) | ||
#define md_number_to_chars number_to_chars_bigendian | ||
#define WORKING_DOT_WORD | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.