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.
This commit is contained in:
Peter Wemm 1996-03-10 23:44:40 +00:00
parent a0a4788922
commit 250c11f9c3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14473

View File

@ -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,