Fixed the elfreader, so it correctly reads the riscv type.

Set the default machineflag to rvc+rvf+rvd.

git-svn-id: branches/laksen/riscv_new@39495 -
This commit is contained in:
Jeppe Johansen 2018-07-23 12:18:33 +00:00
parent 27ab039366
commit 49dae7e900
3 changed files with 12 additions and 0 deletions

View File

@ -79,6 +79,13 @@ const
//machine-specific flags
EF_IA_64_ABI64 = $10; //wow, this is really a 64-bit object file!
// riscv flags
EF_RISCV_RVC = 1;
// bitfield of 2 indicating the largest float abi supported
EF_RISCV_FLOAT_ABI_SINGLE = 2;
EF_RISCV_FLOAT_ABI_DOUBLE = 4;
//section type
SHT_NULL = 0;
SHT_PROGBITS = 1;

View File

@ -290,6 +290,10 @@ begin
fMachineType:=emtmipsel
else
fMachineType:=emtmips;
EM_RISCV : if fBits=ELFCLASS32 then
fMachineType:=emtriscv32
else
fMachineType:=emtriscv64;
end;
finally
subreader.Free;

View File

@ -442,6 +442,7 @@ begin
fDataAlignment:=4;
{$ENDIF}
if aMachineType=EM_IA_64 then fMachineFlags:=EF_IA_64_ABI64
else if aMachineType=EM_RISCV then fMachineFlags:=EF_RISCV_FLOAT_ABI_DOUBLE or EF_RISCV_RVC // This is the default class for now
else fMachineFlags:=0;
end;