This patch helped me debug core-dumps generated from executing a post-processed ELF. I don't know if changing the DT_DEBUG check order (AUXV, ELF) harms anyone.