The base should be 0, but also a valid capability. Initialize to a zero
capability instead of relying on AT_BASE.
TODO: this is a hack. we will need stricter bounds and possibly separate
l_addr and bounds info.
GL(dl_sysinfo) = DL_SYSINFO_DEFAULT;
#endif
+#ifdef __CHERI_PURE_CAPABILITY__
+ /* Base is 0 in non-pie static executable, but it needs to be a valid
+ capability. Use the zero capability instead of AT_BASE. */
+ elfptr_t zerocap;
+ asm volatile ("cvtd %0,xzr" : "=r"(zerocap));
+ _dl_main_map.l_addr = zerocap;
+#endif
+
_dl_auxv = av;
dl_parse_auxv_t auxv_values;
/* Use an explicit initialization loop here because memset may not