Join our Newsletter — 33% off our NHI Course

What evidence shows Relocation Read-Only (RELRO) is working?

Relocation Read-Only (RELRO) is working when relocation-related sections are made read-only after program startup, preventing later overwrites of entries used for code redirection. Evidence should show the binary was built with RELRO enabled and that the relevant memory regions are not writable during normal execution. Check build flags, inspect memory permissions, and confirm the protection remains in place after relocation.

How to tell RELRO is actually protecting the binary at runtime

RELRO is working only if the loader has finished relocation and then locked the relocation data against later writes. The practical check is not just that the binary was compiled with RELRO, but that the relevant sections are mapped read-only after startup and stay that way during normal execution.

A useful verification pattern is to compare build-time indicators with runtime state. Build flags and ELF metadata can show that RELRO was requested, while process memory inspection shows whether the protection survived relocation and is not being reopened later by a bug, custom loader behaviour, or an unusual deployment path.

What evidence proves the protection is in place

The strongest evidence comes from three layers that agree with each other: the binary was linked with RELRO enabled, the relocation-related segments are present as expected, and the live process no longer has those regions writable after startup. If any one of those is missing, the assurance is weaker.

In practice, that means checking the executable’s build properties, then confirming the process map or memory permissions once the program is running. For a robust result, the region that contains relocation data should transition out of writable state after the loader finishes applying relocations, and it should not become writable again under ordinary operation.

It is also worth checking that the observed protection matches the expected mode for the binary. Partial hardening may still leave some metadata exposed in ways that matter for exploit resistance, so the evidence should be specific to the exact object you are validating rather than inferred from a tool’s generic summary.

Why runtime permissions matter more than a compile-time label

A RELRO indicator in build output is necessary but not sufficient. The security value comes from the runtime memory protection, because the attack-relevant condition is whether relocation entries can still be overwritten after the process has started and resolved them.

That distinction matters when you are validating hardening in a real deployment. A binary can advertise the right flags and still fail to provide the intended protection if the loader, platform, or surrounding launch path does something unexpected. Runtime confirmation closes that gap.

For code-redirection defenses, the key question is whether relocation-controlled targets remain immutable once initialization is complete. If they do, overwrite-based redirection becomes materially harder; if they do not, the binary may still be vulnerable even though the build looks hardened.

Risk and Threat Considerations

RELRO reduces the opportunity for an attacker to tamper with relocation-linked control data after startup. If those regions stay writable, an exploit that achieves memory write capability may be able to redirect execution flow more reliably, especially when combined with another memory corruption flaw.

Failure mechanism: The loader applies relocations, but the target pages are not kept read-only, or they are later remapped writable, allowing post-startup overwrite of entries that influence code redirection.

Impact: Attackers with write primitives can more easily pivot from corruption to control-flow manipulation, which can turn a memory-safety bug into code execution or process hijacking.

When you are reviewing hardening evidence across a codebase, the broader secure coding discipline helps you distinguish real protection from nominal configuration. The Secure Coding Guide is a useful companion when the question is about how build-time safeguards translate into measurable runtime protection.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

CIS Controls v8, OWASP ASVS and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
CIS Controls v8 CIS-16 — Application Software Security RELRO is a code-hardening safeguard for compiled software.
Recommendation — Verify binary hardening settings and runtime memory protections for shipped applications.
OWASP ASVS V15 — Secure Coding and Architecture RELRO evidence is part of secure build and hardening verification.
Recommendation — Confirm compiler and linker hardening flags plus runtime memory protection behavior.
NIST SP 800-53 Rev 5 SI-2 — Flaw Remediation Runtime hardening checks help validate that remediation and protection remain effective.
Recommendation — Validate that deployed binaries retain expected protective settings after startup.

Practitioner Guidance

What to verify: Confirm the binary’s hardening flags first, then inspect the live process mapping rather than trusting the build artifact alone. The evidence is strongest when both the file metadata and the runtime permissions tell the same story.

Decision rule: If the relocation-related region is still writable after initialization, treat the deployment as not fully protected, even if the binary was built with RELRO support. The relevant question is whether the protection is present during steady-state execution, not whether it existed briefly during startup.

Common mistake: Relying on a single scanner output or a compile-time label without checking the running process. That can miss deployment-specific failures where the hardening intent was present but not preserved in practice.

Practitioner takeaway: For RELRO, the real proof is steady-state immutability of the relocation data, because that is what blocks later overwrite attempts, not the presence of a flag alone.