summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-03-25 16:21:50 -0400
committerRich Felker <dalias@aerifal.cx>2014-03-25 16:21:50 -0400
commitfa7248c971b04ae76c21f1c48684530290a85d12 (patch)
tree00f4ff53de63eb76a9fbf7d30ca26f28552e8636 /src
parent8769196ffb20569fb97fce9716b3a21fada3f02a (diff)
downloadmusl-fa7248c971b04ae76c21f1c48684530290a85d12.tar.gz
cosmetic improvements in dynamic linker cleanup
consistent use of braces in if/else structure, line length.
Diffstat (limited to 'src')
-rw-r--r--src/ldso/dynlink.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 2f151c22..7058bf61 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -301,10 +301,10 @@ static void reclaim(struct dso *dso, size_t start, size_t end)
static void reclaim_gaps(struct dso *dso)
{
- Phdr *ph;
- size_t phcnt;
+ Phdr *ph = dso->phdr;
+ size_t phcnt = dso->phnum;
- for (phcnt = dso->phnum, ph = dso->phdr; phcnt--; ph=(void *)((char *)ph+dso->phentsize)) {
+ for (; phcnt--; ph=(void *)((char *)ph+dso->phentsize)) {
if (ph->p_type!=PT_LOAD) continue;
if ((ph->p_flags&(PF_R|PF_W))!=(PF_R|PF_W)) continue;
reclaim(dso, ph->p_vaddr & -PAGE_SIZE, ph->p_vaddr);
@@ -351,9 +351,9 @@ static void *map_library(int fd, struct dso *dso)
ph = ph0 = (void *)((char *)buf + eh->e_phoff);
}
for (i=eh->e_phnum; i; i--, ph=(void *)((char *)ph+eh->e_phentsize)) {
- if (ph->p_type == PT_DYNAMIC)
+ if (ph->p_type == PT_DYNAMIC) {
dyn = ph->p_vaddr;
- else if (ph->p_type == PT_TLS) {
+ } else if (ph->p_type == PT_TLS) {
tls_image = ph->p_vaddr;
dso->tls_align = ph->p_align;
dso->tls_len = ph->p_filesz;