Skip to content

Commit 4924cf9

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[vm] Fill in ELF attributes for RISC-V.
TEST=readelf Change-Id: Ida1069f12998c8d12750d23843a7f964bf618077 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396100 Commit-Queue: Ryan Macnak <[email protected]> Reviewed-by: Alexander Aprelev <[email protected]>
1 parent ac6d86c commit 4924cf9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

runtime/platform/elf.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ static constexpr intptr_t EF_ARM_ABI_FLOAT_HARD = 0x00000400;
168168
static constexpr intptr_t EF_ARM_ABI_FLOAT_SOFT = 0x00000200;
169169
static constexpr intptr_t EF_ARM_ABI = 0x05000000;
170170

171+
static constexpr intptr_t EF_RISCV_RVC = 0x1;
172+
static constexpr intptr_t EF_RISCV_FLOAT_ABI_DOUBLE = 0x4;
173+
171174
static constexpr intptr_t EM_386 = 3;
172175
static constexpr intptr_t EM_ARM = 40;
173176
static constexpr intptr_t EM_X86_64 = 62;

runtime/vm/elf.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,6 +2120,8 @@ void ElfHeader::Write(ElfWriteStream* stream) const {
21202120
uword flags = elf::EF_ARM_ABI | (TargetCPUFeatures::hardfp_supported()
21212121
? elf::EF_ARM_ABI_FLOAT_HARD
21222122
: elf::EF_ARM_ABI_FLOAT_SOFT);
2123+
#elif defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64)
2124+
uword flags = elf::EF_RISCV_RVC | elf::EF_RISCV_FLOAT_ABI_DOUBLE;
21232125
#else
21242126
uword flags = 0;
21252127
#endif

0 commit comments

Comments
 (0)