4 ms·
ASLRing text segments is optional, but possible. There are negative performance tradeoffs.
by loeg 6y ago
ASLRing text segments is optional, but possible. There are negative performance tradeoffs.
- barrkel 6y agoThere are limitations in sharing text segments in different processes, and extra memory usage mapping in text segments so relocations can be, uh, relocated, but once running there is no additional performance overhead. The runtime image is effectively "self-modified code" by the OS loader, patched to final addresses. No PIC register, no indirect references.
- loeg 6y agoRight. You've described the performance impact: a ton of relocations hurts startup time, and the modified memory reduces sharing, costing additional memory. If startup time does not matter and memory is free, sure, it has no costs.
- barrkel 6y agoYeah; a linear scan over what, possibly as many as a couple of megabytes. I bet that takes a while. (Seriously? :-)