elf: avoid stack allocation in dl_open_worker
authorDavid Kilroy <David.Kilroy@arm.com>
Wed, 12 Feb 2020 17:31:17 +0000 (14:31 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 12 Feb 2020 17:31:17 +0000 (14:31 -0300)
commit0a8ce6a0966283b17f373f430929bcadef1ae205
tree1accd067979817da9a8c1fffb683d35fb36f3635
parent71bcfa62451dfaa015326d3524f2a0e2d09d80ed
elf: avoid stack allocation in dl_open_worker

As the sort was removed, there's no need to keep a separate map of
links. Instead, when relocating objects iterate over l_initfini
directly.

This allows us to remove the loop copying l_initfini elements into
map. We still need a loop to identify the first and last elements that
need relocation.

Tested by running the testsuite on x86_64.
elf/dl-open.c