Skip to content

Commit

Permalink
Merge pull request #161 from UQ-PAC/walter-gtirb-to-ir
Browse files Browse the repository at this point in the history
Gtirb to ir
  • Loading branch information
l-kent authored Feb 22, 2024
2 parents 7ad7a20 + 2416045 commit c5d396a
Show file tree
Hide file tree
Showing 454 changed files with 7,807 additions and 3,447 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ src/main/antlr4/.antlr
*.so
examplesold/
src/test/scala/dump/
src/test/analysis/dump/
src/test/analysis/dump/
*.gtirb
*.json
11 changes: 10 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,20 @@ lazy val root = project
libraryDependencies += scalactic,
libraryDependencies += scalaTests,
libraryDependencies += sourceCode,
libraryDependencies += mainArgs
libraryDependencies += mainArgs,
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test
)

scalacOptions ++= Seq("-deprecation", "-feature")

Compile / PB.targets := Seq(
scalapb.gen() -> (Compile / sourceManaged).value / "scalapb"
)
libraryDependencies ++= Seq(
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"
)
libraryDependencies += "io.spray" %% "spray-json" % "1.3.6"

lazy val updateExpected = taskKey[Unit]("updates .expected for test cases")

updateExpected := {
Expand Down
951 changes: 951 additions & 0 deletions examples/clz/clz.adt

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions examples/clz/clz.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
int main(int argc, char** argv) {

return __builtin_clz(argc);

}
Binary file added examples/clz/clz.gts
Binary file not shown.
126 changes: 126 additions & 0 deletions examples/clz/clz.relf
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@

Relocation section '.rela.dyn' at offset 0x468 contains 8 entries:
Offset Info Type Symbol's Value Symbol's Name + Addend
000000000001fd88 0000000000000403 R_AARCH64_RELATIVE 710
000000000001fd90 0000000000000403 R_AARCH64_RELATIVE 6c0
000000000001fff0 0000000000000403 R_AARCH64_RELATIVE 714
0000000000020008 0000000000000403 R_AARCH64_RELATIVE 20008
000000000001ffd8 0000000400000401 R_AARCH64_GLOB_DAT 0000000000000000 _ITM_deregisterTMCloneTable + 0
000000000001ffe0 0000000500000401 R_AARCH64_GLOB_DAT 0000000000000000 __cxa_finalize@GLIBC_2.17 + 0
000000000001ffe8 0000000600000401 R_AARCH64_GLOB_DAT 0000000000000000 __gmon_start__ + 0
000000000001fff8 0000000800000401 R_AARCH64_GLOB_DAT 0000000000000000 _ITM_registerTMCloneTable + 0

Relocation section '.rela.plt' at offset 0x528 contains 4 entries:
Offset Info Type Symbol's Value Symbol's Name + Addend
000000000001ffb0 0000000300000402 R_AARCH64_JUMP_SLOT 0000000000000000 __libc_start_main@GLIBC_2.34 + 0
000000000001ffb8 0000000500000402 R_AARCH64_JUMP_SLOT 0000000000000000 __cxa_finalize@GLIBC_2.17 + 0
000000000001ffc0 0000000600000402 R_AARCH64_JUMP_SLOT 0000000000000000 __gmon_start__ + 0
000000000001ffc8 0000000700000402 R_AARCH64_JUMP_SLOT 0000000000000000 abort@GLIBC_2.17 + 0

Symbol table '.dynsym' contains 9 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000588 0 SECTION LOCAL DEFAULT 11 .init
2: 0000000000020000 0 SECTION LOCAL DEFAULT 22 .data
3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.34 (2)
4: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable
5: 0000000000000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@GLIBC_2.17 (3)
6: 0000000000000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
7: 0000000000000000 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.17 (3)
8: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable

Symbol table '.symtab' contains 92 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000238 0 SECTION LOCAL DEFAULT 1 .interp
2: 0000000000000254 0 SECTION LOCAL DEFAULT 2 .note.gnu.build-id
3: 0000000000000278 0 SECTION LOCAL DEFAULT 3 .note.ABI-tag
4: 0000000000000298 0 SECTION LOCAL DEFAULT 4 .gnu.hash
5: 00000000000002b8 0 SECTION LOCAL DEFAULT 5 .dynsym
6: 0000000000000390 0 SECTION LOCAL DEFAULT 6 .dynstr
7: 0000000000000424 0 SECTION LOCAL DEFAULT 7 .gnu.version
8: 0000000000000438 0 SECTION LOCAL DEFAULT 8 .gnu.version_r
9: 0000000000000468 0 SECTION LOCAL DEFAULT 9 .rela.dyn
10: 0000000000000528 0 SECTION LOCAL DEFAULT 10 .rela.plt
11: 0000000000000588 0 SECTION LOCAL DEFAULT 11 .init
12: 00000000000005a0 0 SECTION LOCAL DEFAULT 12 .plt
13: 0000000000000600 0 SECTION LOCAL DEFAULT 13 .text
14: 0000000000000730 0 SECTION LOCAL DEFAULT 14 .fini
15: 0000000000000744 0 SECTION LOCAL DEFAULT 15 .rodata
16: 0000000000000748 0 SECTION LOCAL DEFAULT 16 .eh_frame_hdr
17: 0000000000000788 0 SECTION LOCAL DEFAULT 17 .eh_frame
18: 000000000001fd88 0 SECTION LOCAL DEFAULT 18 .init_array
19: 000000000001fd90 0 SECTION LOCAL DEFAULT 19 .fini_array
20: 000000000001fd98 0 SECTION LOCAL DEFAULT 20 .dynamic
21: 000000000001ff98 0 SECTION LOCAL DEFAULT 21 .got
22: 0000000000020000 0 SECTION LOCAL DEFAULT 22 .data
23: 0000000000020010 0 SECTION LOCAL DEFAULT 23 .bss
24: 0000000000000000 0 SECTION LOCAL DEFAULT 24 .comment
25: 0000000000000000 0 SECTION LOCAL DEFAULT 25 .debug_aranges
26: 0000000000000000 0 SECTION LOCAL DEFAULT 26 .debug_info
27: 0000000000000000 0 SECTION LOCAL DEFAULT 27 .debug_abbrev
28: 0000000000000000 0 SECTION LOCAL DEFAULT 28 .debug_line
29: 0000000000000000 0 SECTION LOCAL DEFAULT 29 .debug_str
30: 0000000000000000 0 SECTION LOCAL DEFAULT 30 .debug_line_str
31: 0000000000000000 0 FILE LOCAL DEFAULT ABS Scrt1.o
32: 0000000000000278 0 NOTYPE LOCAL DEFAULT 3 $d
33: 0000000000000278 32 OBJECT LOCAL DEFAULT 3 __abi_tag
34: 0000000000000600 0 NOTYPE LOCAL DEFAULT 13 $x
35: 000000000000079c 0 NOTYPE LOCAL DEFAULT 17 $d
36: 0000000000000744 0 NOTYPE LOCAL DEFAULT 15 $d
37: 0000000000000000 0 FILE LOCAL DEFAULT ABS crti.o
38: 0000000000000634 0 NOTYPE LOCAL DEFAULT 13 $x
39: 0000000000000634 20 FUNC LOCAL DEFAULT 13 call_weak_fn
40: 0000000000000588 0 NOTYPE LOCAL DEFAULT 11 $x
41: 0000000000000730 0 NOTYPE LOCAL DEFAULT 14 $x
42: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtn.o
43: 0000000000000598 0 NOTYPE LOCAL DEFAULT 11 $x
44: 000000000000073c 0 NOTYPE LOCAL DEFAULT 14 $x
45: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c
46: 0000000000000650 0 NOTYPE LOCAL DEFAULT 13 $x
47: 0000000000000650 0 FUNC LOCAL DEFAULT 13 deregister_tm_clones
48: 0000000000000680 0 FUNC LOCAL DEFAULT 13 register_tm_clones
49: 0000000000020008 0 NOTYPE LOCAL DEFAULT 22 $d
50: 00000000000006c0 0 FUNC LOCAL DEFAULT 13 __do_global_dtors_aux
51: 0000000000020010 1 OBJECT LOCAL DEFAULT 23 completed.0
52: 000000000001fd90 0 NOTYPE LOCAL DEFAULT 19 $d
53: 000000000001fd90 0 OBJECT LOCAL DEFAULT 19 __do_global_dtors_aux_fini_array_entry
54: 0000000000000710 0 FUNC LOCAL DEFAULT 13 frame_dummy
55: 000000000001fd88 0 NOTYPE LOCAL DEFAULT 18 $d
56: 000000000001fd88 0 OBJECT LOCAL DEFAULT 18 __frame_dummy_init_array_entry
57: 00000000000007b0 0 NOTYPE LOCAL DEFAULT 17 $d
58: 0000000000020010 0 NOTYPE LOCAL DEFAULT 23 $d
59: 0000000000000000 0 FILE LOCAL DEFAULT ABS example.c
60: 0000000000000714 0 NOTYPE LOCAL DEFAULT 13 $x
61: 0000000000000810 0 NOTYPE LOCAL DEFAULT 17 $d
62: 0000000000000000 0 FILE LOCAL DEFAULT ABS crtstuff.c
63: 0000000000000828 0 NOTYPE LOCAL DEFAULT 17 $d
64: 0000000000000828 0 OBJECT LOCAL DEFAULT 17 __FRAME_END__
65: 0000000000000000 0 FILE LOCAL DEFAULT ABS
66: 000000000001fd98 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC
67: 0000000000000748 0 NOTYPE LOCAL DEFAULT 16 __GNU_EH_FRAME_HDR
68: 000000000001ffd0 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
69: 00000000000005a0 0 NOTYPE LOCAL DEFAULT 12 $x
70: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.34
71: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable
72: 0000000000020000 0 NOTYPE WEAK DEFAULT 22 data_start
73: 0000000000020010 0 NOTYPE GLOBAL DEFAULT 23 __bss_start__
74: 0000000000000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@GLIBC_2.17
75: 0000000000020018 0 NOTYPE GLOBAL DEFAULT 23 _bss_end__
76: 0000000000020010 0 NOTYPE GLOBAL DEFAULT 22 _edata
77: 0000000000000730 0 FUNC GLOBAL HIDDEN 14 _fini
78: 0000000000020018 0 NOTYPE GLOBAL DEFAULT 23 __bss_end__
79: 0000000000020000 0 NOTYPE GLOBAL DEFAULT 22 __data_start
80: 0000000000000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
81: 0000000000020008 0 OBJECT GLOBAL HIDDEN 22 __dso_handle
82: 0000000000000000 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.17
83: 0000000000000744 4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used
84: 0000000000020018 0 NOTYPE GLOBAL DEFAULT 23 _end
85: 0000000000000600 52 FUNC GLOBAL DEFAULT 13 _start
86: 0000000000020018 0 NOTYPE GLOBAL DEFAULT 23 __end__
87: 0000000000020010 0 NOTYPE GLOBAL DEFAULT 23 __bss_start
88: 0000000000000714 28 FUNC GLOBAL DEFAULT 13 main
89: 0000000000020010 0 OBJECT GLOBAL HIDDEN 22 __TMC_END__
90: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMCloneTable
91: 0000000000000588 0 FUNC GLOBAL HIDDEN 11 _init

Loading

0 comments on commit c5d396a

Please sign in to comment.