diff options
author | Karel Kočí <cynerd@email.cz> | 2018-04-05 11:50:23 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-04-05 11:50:23 +0200 |
commit | 1359b6a4bcc9f37ab8d550cd960bfa6bd9a86a36 (patch) | |
tree | 3865b063c22f8bf3c4f741190d55ec19116be8da /qtmips_machine | |
parent | ff03a2f7b16ee43a591e0747621862c9ef75f41d (diff) | |
download | qtmips-1359b6a4bcc9f37ab8d550cd960bfa6bd9a86a36.tar.gz qtmips-1359b6a4bcc9f37ab8d550cd960bfa6bd9a86a36.tar.bz2 qtmips-1359b6a4bcc9f37ab8d550cd960bfa6bd9a86a36.zip |
Just note that we are checking endianity automatically
Diffstat (limited to 'qtmips_machine')
-rw-r--r-- | qtmips_machine/programloader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qtmips_machine/programloader.cpp b/qtmips_machine/programloader.cpp index f6c2e6d..db16ec5 100644 --- a/qtmips_machine/programloader.cpp +++ b/qtmips_machine/programloader.cpp @@ -28,6 +28,7 @@ ProgramLoader::ProgramLoader(const char *file) { if (this->hdr.e_type != ET_EXEC) throw QTMIPS_EXCEPTION(Input, "Invalid input file type", ""); // Check elf file architecture, of course only mips is supported. + // Note: This also checks that this is big endian as EM_MIPS is suppose to be: MIPS R3000 big-endian if (this->hdr.e_machine != EM_MIPS) throw QTMIPS_EXCEPTION(Input, "Invalid input file architecture", ""); // Check elf file class, only 32bit architecture is supported. @@ -36,7 +37,6 @@ ProgramLoader::ProgramLoader(const char *file) { throw QTMIPS_EXCEPTION(Input, "Getting elf class failed", elf_errmsg(-1)); if (elf_class != ELFCLASS32) throw QTMIPS_EXCEPTION(Input, "Only supported architecture is 32bit", ""); - // TODO We should check in what endianity elf file is coded in // Get number of program sections in elf file if (elf_getphdrnum(this->elf, &this->n_secs)) |