diff options
| author | Austin Foxley <austinf@cetoncorp.com> | 2009-09-18 16:22:23 -0700 |
|---|---|---|
| committer | Austin Foxley <austinf@cetoncorp.com> | 2009-09-18 16:22:23 -0700 |
| commit | 0937a4c490a370744c539bd31decfd9e4e61db55 (patch) | |
| tree | 885bfab46e0aed5d21b4947187dd07c4ccef1424 | |
| parent | 9c98c1a161ea32230f21975cdb4b4b2c72d08763 (diff) | |
| download | uClibc-alpine-0937a4c490a370744c539bd31decfd9e4e61db55.tar.bz2 uClibc-alpine-0937a4c490a370744c539bd31decfd9e4e61db55.tar.xz | |
use proper macros
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
| -rw-r--r-- | ldso/ldso/dl-elf.c | 6 | ||||
| -rw-r--r-- | ldso/ldso/ldso.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c index 7bf3145b6..75e8f7186 100644 --- a/ldso/ldso/dl-elf.c +++ b/ldso/ldso/dl-elf.c @@ -119,8 +119,8 @@ void _dl_protect_relro (struct elf_resolve *l) { ElfW(Addr) base = (ElfW(Addr)) DL_RELOC_ADDR(l->loadaddr, l->relro_addr); - ElfW(Addr) start = (base & ~(_dl_pagesize - 1)); - ElfW(Addr) end = ((base + l->relro_size) & ~(_dl_pagesize - 1)); + ElfW(Addr) start = (base & PAGE_ALIGN); + ElfW(Addr) end = ((base + l->relro_size) & PAGE_ALIGN); _dl_if_debug_dprint("RELRO protecting %s: start:%x, end:%x\n", l->libname, start, end); if (start != end && _dl_mprotect ((void *) start, end - start, PROT_READ) < 0) { @@ -464,7 +464,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure, DL_CHECK_LIB_TYPE (epnt, piclib, _dl_progname, libname); - maxvma = (maxvma + ADDR_ALIGN) & ~ADDR_ALIGN; + maxvma = (maxvma + ADDR_ALIGN) & PAGE_ALIGN; minvma = minvma & ~0xffffU; flags = MAP_PRIVATE /*| MAP_DENYWRITE */ ; diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c index 5dbf27e97..485204298 100644 --- a/ldso/ldso/ldso.c +++ b/ldso/ldso/ldso.c @@ -187,7 +187,7 @@ void *_dl_malloc(size_t size) The actual page size doesn't really matter; as long as we're self-consistent here, we're safe. */ if (size < _dl_pagesize) - rounded_size = (size + _dl_pagesize - 1) & _dl_pagesize; + rounded_size = (size + ADDR_ALIGN) & _dl_pagesize; else rounded_size = size; |
