Same iteration variable used for inner and outer loop
commit60d5a1ad24f1b853f55dfaf57b23f1588fda1bf7
authorCupertino Miranda <Cupertino.Miranda@synopsys.com>
Thu, 6 Apr 2017 09:57:25 +0000 (6 11:57 +0200)
committerWaldemar Brodkorb <wbx@openadk.org>
Sat, 8 Apr 2017 19:44:35 +0000 (8 21:44 +0200)
treecc335c1c7f8d7ffda27354964a575dbf42dc80ea
parenta3805b91ecdb458cd20245c20e49deacc58e9c32
Same iteration variable used for inner and outer loop

Inner loop was using same counter variable (i) as the outer loop, therefore
making outer loop terminate before it visited all of the ELF program segments.
Surrounding code in this inner loop clearly shows the intention that this loop
should not affect the outer one, therefore leading me to the conclusion that
this should be a bug an not expected code.

This bug was detected due to some other bug in ARC binutils that kept setting
TEXTREL for any PIE application.

Apart from the but, I have also moved the debug message inside of the TEXTREL
condition as mprotect is only really called if TELTREL is set.
ldso/ldso/ldso.c