aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2023-12-28 18:31:32 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2024-07-08 09:41:45 +0100
commit47e778b4e0f3c538ab1f6845056cdf115abe4c89 (patch)
treed6d26b356b8c4d82efec12382e714e8717d87c24
parentf149acd167e49f09afc0402c7bc0aaead94e963a (diff)
downloadglibc-47e778b4e0f3c538ab1f6845056cdf115abe4c89.zip
glibc-47e778b4e0f3c538ab1f6845056cdf115abe4c89.tar.gz
glibc-47e778b4e0f3c538ab1f6845056cdf115abe4c89.tar.bz2
aarch64: Use l_searchlist.r_list for bti
Allows using the same function for static exe. TODO: not clear if the two are always equivalent other than the ordering and in case of static linking when dl-support.c leaves l_initfini NULL.
-rw-r--r--sysdeps/aarch64/dl-bti.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sysdeps/aarch64/dl-bti.c b/sysdeps/aarch64/dl-bti.c
index fd0d308..e03bfc2 100644
--- a/sysdeps/aarch64/dl-bti.c
+++ b/sysdeps/aarch64/dl-bti.c
@@ -84,10 +84,9 @@ _dl_bti_check (struct link_map *l, const char *program)
if (l->l_mach.bti_fail)
bti_failed (l, program);
- unsigned int i = l->l_searchlist.r_nlist;
- while (i-- > 0)
+ for (unsigned int i = 0; i < l->l_searchlist.r_nlist; i++)
{
- struct link_map *dep = l->l_initfini[i];
+ struct link_map *dep = l->l_searchlist.r_list[i];
if (dep->l_mach.bti_fail)
bti_failed (dep, program);
}