@@ -681,6 +681,33 @@ struct MappingGoMips64_47 {
681681 static const uptr kShadowAdd = 0x200000000000ull ;
682682};
683683
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+
684711/*
685712Go on linux/s390x
6867130000 0000 1000 - 1000 0000 0000: executable and heap - 16 TiB
@@ -728,6 +755,8 @@ ALWAYS_INLINE auto SelectMapping(Arg arg) {
728755 return Func::template Apply<MappingGoAarch64>(arg);
729756# elif defined(__loongarch_lp64)
730757 return Func::template Apply<MappingGoLoongArch64_47>(arg);
758+ # elif SANITIZER_RISCV64
759+ return Func::template Apply<MappingGoRiscv64>(arg);
731760# elif SANITIZER_WINDOWS
732761 return Func::template Apply<MappingGoWindows>(arg);
733762# else
@@ -798,6 +827,7 @@ void ForEachMapping() {
798827 Func::template Apply<MappingGoAarch64>();
799828 Func::template Apply<MappingGoLoongArch64_47>();
800829 Func::template Apply<MappingGoMips64_47>();
830+ Func::template Apply<MappingGoRiscv64>();
801831 Func::template Apply<MappingGoS390x>();
802832}
803833
0 commit comments