- } else if ((reg.prot & PROT_READ) && !(reg.prot & PROT_EXEC)) {
- xbt_assert(!result->start_ro,
- "Multiple read only segments for %s, not supported",
- maps[i].pathname.c_str());
+
+ // The next VMA might be end of the data segment:
+ if (i + 1 < maps.size()
+ && maps[i + 1].pathname.empty()
+ && maps[i + 1].prot == PROT_RW
+ && maps[i + 1].start_addr == reg.end_addr) {
+ result->start_rw = (char*) maps[i + 1].start_addr;
+ result->end_rw = (char*) maps[i + 1].end_addr;
+ }
+ }
+
+ // This is the GNU_RELRO-part of the data segment:
+ else if (reg.prot == PROT_READ) {
+ xbt_assert(not result->start_ro, "Multiple read only segments for %s, not supported", maps[i].pathname.c_str());