GithubHelp home page GithubHelp logo

risc-v-parser's Introduction

Elf Parser

Elf-file parser that extracts .text and .symtab from the elf file.

Supports only:

RV32I, RV32M and RVC commands which have equivalents in RV32I. If Elf file contains a command which is not listed here, parser will output unknown_command.

Python 3.10.1

Sample of .text output

.text
00010074 register_fini: addi a5, zero, 0
00010078             beq a5, zero, LOC_00000
0001007c             lui a0, 65536
00010080             addi a0, a0, 1164
00010084             jal zero, atexit
00010088  LOC_00000: jalr zero, 0(ra)
0001008c     _start: auipc gp, 8192
00010090             addi gp, gp, -684
00010094             addi a0, gp, -972
00010098             addi a2, gp, -944
0001009c             sub a2, a2, a0
000100a0             addi a1, zero, 0
000100a4             jal ra, memset
000100a8             auipc a0, 0
...

Sample of .symtab output

.symtab
Symbol Value              Size Type     Bind     Vis       Index Name
[   0] 0x0                   0 NOTYPE   LOCAL    DEFAULT   UNDEF 
[   1] 0x10074               0 SECTION  LOCAL    DEFAULT       1 
[   2] 0x115cc               0 SECTION  LOCAL    DEFAULT       2 
[   3] 0x115d0               0 SECTION  LOCAL    DEFAULT       3 
[   4] 0x115d8               0 SECTION  LOCAL    DEFAULT       4 
[   5] 0x115e0               0 SECTION  LOCAL    DEFAULT       5 
[   6] 0x11a08               0 SECTION  LOCAL    DEFAULT       6 
[   7] 0x11a14               0 SECTION  LOCAL    DEFAULT       7 
[   8] 0x0                   0 SECTION  LOCAL    DEFAULT       8 
[   9] 0x0                   0 SECTION  LOCAL    DEFAULT       9 
[  10] 0x0                   0 FILE     LOCAL    DEFAULT     ABS 
[  11] 0x10074              24 FUNC     LOCAL    DEFAULT       1 register_fini
[  12] 0x0                   0 FILE     LOCAL    DEFAULT     ABS 
[  13] 0x115cc               0 OBJECT   LOCAL    DEFAULT       2 
[  14] 0x100d8               0 FUNC     LOCAL    DEFAULT       1 __do_global_dtors_aux
[  15] 0x11a14               1 OBJECT   LOCAL    DEFAULT       7 completed.1
[  16] 0x115d8               0 OBJECT   LOCAL    DEFAULT       4 __do_global_dtors
[  17] 0x10124               0 FUNC     LOCAL    DEFAULT       1 frame_dummy
...

risc-v-parser's People

Contributors

vanerk03 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.