This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Revert later] Adding additional files
- Loading branch information
Showing
7 changed files
with
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "ElfFile.hpp" | ||
|
||
int parseElf(char* fileName); |
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,29 @@ | ||
//****************************************************************************** | ||
// Copyright (c) 2018, The Regents of the University of California (Regents). | ||
// All Rights Reserved. See LICENSE for license details. | ||
//------------------------------------------------------------------------------ | ||
#include "Elfloader.hpp" | ||
#include <sys/mman.h> | ||
#include <sys/stat.h> | ||
#include <fcntl.h> | ||
|
||
|
||
static int | ||
parseElf(char* fileName, bool isRuntime) { | ||
int ret; | ||
|
||
ElfFile* elfFile = ElfFile(fileName); | ||
|
||
|
||
if (!elfFile->initialize(isRuntime)) { | ||
// TODO: Error handling | ||
return false; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
return 1; | ||
} |
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,3 @@ | ||
parse_runtime: | ||
|
||
parse_eapp: |
Empty file.
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,7 @@ | ||
int | ||
main() { | ||
unsigned int a = 7; | ||
unsigned int b = 3; | ||
unsigned int result = a + b; | ||
return result; | ||
} |
Binary file not shown.
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,26 @@ | ||
.file "toy.c" | ||
.option pic | ||
.text | ||
.align 1 | ||
.globl main | ||
.type main, @function | ||
main: | ||
addi sp,sp,-32 | ||
sd s0,24(sp) | ||
addi s0,sp,32 | ||
li a5,7 | ||
sw a5,-20(s0) | ||
li a5,3 | ||
sw a5,-24(s0) | ||
lw a4,-20(s0) | ||
lw a5,-24(s0) | ||
addw a5,a4,a5 | ||
sw a5,-28(s0) | ||
lw a5,-28(s0) | ||
mv a0,a5 | ||
ld s0,24(sp) | ||
addi sp,sp,32 | ||
jr ra | ||
.size main, .-main | ||
.ident "GCC: (GNU) 10.2.0" | ||
.section .note.GNU-stack,"",@progbits |