@@ -681,6 +681,33 @@ struct MappingGoMips64_47 {
681
681
static const uptr kShadowAdd = 0x200000000000ull ;
682
682
};
683
683
684
+ /* Go on linux/riscv64 (48-bit VMA)
685
+ 0000 0001 0000 - 00e0 0000 0000: executable and heap (896 GiB)
686
+ 00e0 0000 0000 - 2000 0000 0000: -
687
+ 2000 0000 0000 - 2400 0000 0000: shadow - 4 TiB ( ~ 4 * app)
688
+ 2400 0000 0000 - 3000 0000 0000: -
689
+ 3000 0000 0000 - 3100 0000 0000: metainfo - 1 TiB ( ~ 1 * app)
690
+ 3100 0000 0000 - 8000 0000 0000: -
691
+ */
692
+ struct MappingGoRiscv64 {
693
+ static const uptr kMetaShadowBeg = 0x300000000000ull ;
694
+ static const uptr kMetaShadowEnd = 0x310000000000ull ;
695
+ static const uptr kShadowBeg = 0x200000000000ull ;
696
+ static const uptr kShadowEnd = 0x240000000000ull ;
697
+ static const uptr kLoAppMemBeg = 0x000000010000ull ;
698
+ static const uptr kLoAppMemEnd = 0x000e00000000ull ;
699
+ static const uptr kMidAppMemBeg = 0 ;
700
+ static const uptr kMidAppMemEnd = 0 ;
701
+ static const uptr kHiAppMemBeg = 0 ;
702
+ static const uptr kHiAppMemEnd = 0 ;
703
+ static const uptr kHeapMemBeg = 0 ;
704
+ static const uptr kHeapMemEnd = 0 ;
705
+ static const uptr kVdsoBeg = 0 ;
706
+ static const uptr kShadowMsk = 0 ;
707
+ static const uptr kShadowXor = 0 ;
708
+ static const uptr kShadowAdd = 0x200000000000ull ;
709
+ };
710
+
684
711
/*
685
712
Go on linux/s390x
686
713
0000 0000 1000 - 1000 0000 0000: executable and heap - 16 TiB
@@ -728,6 +755,8 @@ ALWAYS_INLINE auto SelectMapping(Arg arg) {
728
755
return Func::template Apply<MappingGoAarch64>(arg);
729
756
# elif defined(__loongarch_lp64)
730
757
return Func::template Apply<MappingGoLoongArch64_47>(arg);
758
+ # elif SANITIZER_RISCV64
759
+ return Func::template Apply<MappingGoRiscv64>(arg);
731
760
# elif SANITIZER_WINDOWS
732
761
return Func::template Apply<MappingGoWindows>(arg);
733
762
# else
@@ -798,6 +827,7 @@ void ForEachMapping() {
798
827
Func::template Apply<MappingGoAarch64>();
799
828
Func::template Apply<MappingGoLoongArch64_47>();
800
829
Func::template Apply<MappingGoMips64_47>();
830
+ Func::template Apply<MappingGoRiscv64>();
801
831
Func::template Apply<MappingGoS390x>();
802
832
}
803
833
0 commit comments