This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.22-262-g60084e3
- From: carlos at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 18 Sep 2015 13:29:57 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.22-262-g60084e3
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 60084e34b63a9ad5bdd7381bab2d7bc30db106c9 (commit)
from e952e1dfeb2a603ebd74ac5478a1218061ba893b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=60084e34b63a9ad5bdd7381bab2d7bc30db106c9
commit 60084e34b63a9ad5bdd7381bab2d7bc30db106c9
Author: Carlos O'Donell <carlos@systemhalted.org>
Date: Fri Sep 18 09:27:45 2015 -0400
Use ALIGN_* macros in _dl_map_object_from_fd.
Cleanup _dl_map_object_from_fd to make it clear exactly
what we're doing with the mappings i.e. extending the the
start of the map down to a page boundary, extending the
end of the map up to a page boundary, and offset itself
also to page boundary. The result is much easier to read
as expected from the ALIGN_* cleanups.
diff --git a/ChangeLog b/ChangeLog
index 760e9bc..bb75382 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-18 Carlos O'Donell <carlos@redhat.com>
+
+ * elf/dl-load.c: Include libc-internal.h.
+ (_dl_map_object_from_fd): Use ALIGN_UP and ALIGN_DOWN.
+
2015-09-18 Vincent Bernat <vincent@bernat.im>
[BZ #17887]
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 0c052e4..993a419 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -36,6 +36,7 @@
#include <caller.h>
#include <sysdep.h>
#include <stap-probe.h>
+#include <libc-internal.h>
#include <dl-dst.h>
#include <dl-load.h>
@@ -1077,12 +1078,11 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
}
struct loadcmd *c = &loadcmds[nloadcmds++];
- c->mapstart = ph->p_vaddr & ~(GLRO(dl_pagesize) - 1);
- c->mapend = ((ph->p_vaddr + ph->p_filesz + GLRO(dl_pagesize) - 1)
- & ~(GLRO(dl_pagesize) - 1));
+ c->mapstart = ALIGN_DOWN (ph->p_vaddr, GLRO(dl_pagesize));
+ c->mapend = ALIGN_UP (ph->p_vaddr + ph->p_filesz, GLRO(dl_pagesize));
c->dataend = ph->p_vaddr + ph->p_filesz;
c->allocend = ph->p_vaddr + ph->p_memsz;
- c->mapoff = ph->p_offset & ~(GLRO(dl_pagesize) - 1);
+ c->mapoff = ALIGN_DOWN (ph->p_offset, GLRO(dl_pagesize));
/* Determine whether there is a gap between the last segment
and this one. */
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 +++++
elf/dl-load.c | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
hooks/post-receive
--
GNU C Library master sources