summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-03-10 23:44:40 +0000
committerpeter <peter@FreeBSD.org>1996-03-10 23:44:40 +0000
commitc2c92de148b011da2a37e1676f3dbf8aaa02722f (patch)
tree49b2a70a61b236c10a13acfaf47b294843e8a4cd
parent602a9dfadd213fcdd180b62802f7c4ca99bff62c (diff)
downloadFreeBSD-src-c2c92de148b011da2a37e1676f3dbf8aaa02722f.zip
FreeBSD-src-c2c92de148b011da2a37e1676f3dbf8aaa02722f.tar.gz
Tweak the data/bss segment page count. The last version worked
with all the test cases I tried, I'm sure this is more correct. Tweak some prototypes.
-rw-r--r--sys/kern/imgact_elf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 462e8b9..9574363 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_elf.c,v 1.1 1996/03/10 08:42:54 sos Exp $
+ * $Id: imgact_elf.c,v 1.2 1996/03/10 22:37:34 peter Exp $
*/
#include <sys/param.h>
@@ -61,9 +61,9 @@
#define MAX_PHDR 32 /* XXX enough ? */
-static int read_from_vp __P((struct vnode *vp, vm_offset_t offset, caddr_t buf, vm_size_t size));
static int map_pages __P((struct vnode *vp, vm_offset_t offset, vm_offset_t *buf, vm_size_t size));
static void unmap_pages __P((struct vnode *vp, vm_offset_t buf, vm_size_t size));
+static int elf_check_permissions __P((struct proc *p, struct vnode *vp));
static int elf_check_header __P((Elf32_Ehdr *hdr, int type));
static int elf_load_section __P((struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot));
static int elf_load_file __P((struct proc *p, char *file, u_long *addr, u_long *entry));
@@ -180,7 +180,6 @@ unmap_pages(struct vnode *vp, vm_offset_t buf, vm_size_t size)
static int
elf_check_permissions(struct proc *p, struct vnode *vp)
-
{
struct vattr attr;
int error;
@@ -288,7 +287,7 @@ elf_load_section(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset,
*/
copy_len = (offset + filsz) - trunc_page(offset + filsz);
map_addr = trunc_page(vmaddr + filsz);
- map_len = round_page(memsz - filsz);
+ map_len = round_page(vmaddr + memsz) - map_addr;
if (map_len != 0) {
if (error = vm_map_find(&vmspace->vm_map, NULL, 0,
OpenPOWER on IntegriCloud