michaeljclark / rv8

RISC-V simulator for x86-64
https://michaeljclark.github.io/
MIT License
671 stars 97 forks source link

Add (draft) ELF128 definitions #4

Open michaeljclark opened 7 years ago

michaeljclark commented 7 years ago

ELF128

There needs to be some discussion around how ELF is mapped to 128-bit, given that there may be ABI variants, and there is a distinction between 128-bit integrals vs 128-bit pointers. i.e. An ELF128 ABI could potentially have an 'offset' concept that is a compact memory representation of a 'pointer' relative to some base pointer.

e.g. define Elf128_Off as u64 as this represents an offset within the ELF image, and likewise define Elf128_Xword and Elf128_Sxword as u64 and s64 respectively, as these are used for segment sizes.

This proposed typing based on ELF64 only promotes the Addr type to 128. Linkers and link loaders may store 'offsets' relative to some reference address. e.g. start of segment.

Draft Elf128 types

michaeljclark commented 7 years ago

Added ELFCLASS128 = 3 however the types and structures have not yet been defined.