summaryrefslogtreecommitdiffstats
path: root/libelf/gelf_getshdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/gelf_getshdr.c')
-rw-r--r--libelf/gelf_getshdr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libelf/gelf_getshdr.c b/libelf/gelf_getshdr.c
index 7f01a8fc..f5457a7a 100644
--- a/libelf/gelf_getshdr.c
+++ b/libelf/gelf_getshdr.c
@@ -74,12 +74,13 @@ gelf_getshdr (scn, dst)
return NULL;
}
- rwlock_rdlock (scn->elf->lock);
+ RWLOCK_RDLOCK (scn->elf->lock);
if (scn->elf->class == ELFCLASS32)
{
/* Copy the elements one-by-one. */
- Elf32_Shdr *shdr = scn->shdr.e32 ?: INTUSE(elf32_getshdr) (scn);
+ Elf32_Shdr *shdr
+ = scn->shdr.e32 ?: __elf32_getshdr_internal (scn, LS_RDLOCKED);
if (shdr == NULL)
{
@@ -104,7 +105,8 @@ gelf_getshdr (scn, dst)
}
else
{
- Elf64_Shdr *shdr = scn->shdr.e64 ?: INTUSE(elf64_getshdr) (scn);
+ Elf64_Shdr *shdr
+ = scn->shdr.e64 ?: __elf64_getshdr_internal (scn, LS_RDLOCKED);
if (shdr == NULL)
{
@@ -117,7 +119,7 @@ gelf_getshdr (scn, dst)
}
out:
- rwlock_unlock (scn->elf->lock);
+ RWLOCK_UNLOCK (scn->elf->lock);
return result;
}