Skip to content

Commit f80bbe5

Browse files
authored
Add riscv64 ELF symbols (#47)
1 parent d480824 commit f80bbe5

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ObjectFile"
22
uuid = "d8793406-e978-5875-9003-1fc021f44a92"
33
authors = ["Elliot Saba <[email protected]>"]
4-
version = "0.4.2"
4+
version = "0.4.3"
55

66
[deps]
77
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

src/ELF/ELFHeader.jl

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ function elf_machine_to_arch(machine::UInt16)
6767
return "aarch64"
6868
elseif machine (EM_PPC64,)
6969
return "ppc64le"
70+
elseif machine (EM_RISCV,)
71+
return "riscv64"
7072
end
7173
end
7274

src/ELF/constants.jl

+19
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,25 @@ end
220220
const EM_BA2 = 202 #Beyond BA2 CPU architecture
221221
const EM_XCORE = 203 #XMOS xCORE processor family
222222
const EM_MCHP_PIC = 204 #Microchip 8-bit PIC(r) family
223+
#205-209 Reserved
224+
const EM_KM32 = 210 #KM211 KM32
225+
const EM_KMX32 = 211 #KM211 KMX32
226+
const EM_EMX16 = 212 #KM211 KMX16
227+
const EM_EMX8 = 213 #KM211 KMX8
228+
const EM_KVARC = 214 #KM211 KVARC
229+
const EM_CDP = 215 #Paneve CDP
230+
const EM_COGE = 216 #Cognitive Smart Memory Processor
231+
const EM_COOL = 217 #Bluechip CoolEngine
232+
const EM_NORC = 218 #Nanoradio Optimized RISC
233+
const EM_CSR_KALIMBA = 219 #CSR Kalimba
234+
const EM_Z80 = 220 #Zilog Z80
235+
const EM_VISIUM = 221 #Controls and Data Services VISIUMcore
236+
const EM_FT32 = 222 #FTDI Chip FT32
237+
const EM_MOXIE = 223 #Moxie processor
238+
const EM_AMDGPU = 224 #AMD GPU
239+
#225-242 Reserved
240+
const EM_RISCV = 243 #RISC-V
241+
const EM_BPF = 247 #Linux BPF -- in-kernel virtual machine
223242
end
224243

225244
# Special Section Indices

0 commit comments

Comments
 (0)