mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 20:11:19 +02:00
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:
parent
27ab039366
commit
49dae7e900
@ -79,6 +79,13 @@ const
|
|||||||
//machine-specific flags
|
//machine-specific flags
|
||||||
EF_IA_64_ABI64 = $10; //wow, this is really a 64-bit object file!
|
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
|
//section type
|
||||||
SHT_NULL = 0;
|
SHT_NULL = 0;
|
||||||
SHT_PROGBITS = 1;
|
SHT_PROGBITS = 1;
|
||||||
|
@ -290,6 +290,10 @@ begin
|
|||||||
fMachineType:=emtmipsel
|
fMachineType:=emtmipsel
|
||||||
else
|
else
|
||||||
fMachineType:=emtmips;
|
fMachineType:=emtmips;
|
||||||
|
EM_RISCV : if fBits=ELFCLASS32 then
|
||||||
|
fMachineType:=emtriscv32
|
||||||
|
else
|
||||||
|
fMachineType:=emtriscv64;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
subreader.Free;
|
subreader.Free;
|
||||||
|
@ -442,6 +442,7 @@ begin
|
|||||||
fDataAlignment:=4;
|
fDataAlignment:=4;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if aMachineType=EM_IA_64 then fMachineFlags:=EF_IA_64_ABI64
|
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;
|
else fMachineFlags:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user