diff --git a/linker/linker.cpp b/linker/linker.cpp index 79c3ac54e..b8dd216e7 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -462,13 +462,13 @@ ProtectedDataGuard::ProtectedDataGuard() { if (ref_count_++ == 0) { protect_data(PROT_READ | PROT_WRITE); } -} -ProtectedDataGuard::~ProtectedDataGuard() { if (ref_count_ == 0) { // overflow __libc_fatal("Too many nested calls to dlopen()"); } +} +ProtectedDataGuard::~ProtectedDataGuard() { if (--ref_count_ == 0) { protect_data(PROT_READ); }