[git commit 0_9_30] - use proper macros

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Sat Oct 10 16:44:02 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=b158ae83fb0f9f4732cc6f02568a80d2da1912cd
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/0_9_30

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 ldso/ldso/dl-elf.c |    4 ++--
 ldso/ldso/ldso.c   |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 2169eb5..ecaaa55 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) {
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index ebb6ddb..a877ccf 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -912,7 +912,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;
 
-- 
1.6.3.3



More information about the uClibc-cvs mailing list