Author: markj
Date: Wed Jul 24 15:18:05 2019
New Revision: 350292
URL: https://svnweb.freebsd.org/changeset/base/350292

Log:
  Remove a redundant offset computation in elf_load_section().
  
  With r344705 the offset is always zero.
  
  Submitted by: Wuyang Chung <wuyang.chu...@gmail.com>

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c  Wed Jul 24 15:10:09 2019        (r350291)
+++ head/sys/kern/imgact_elf.c  Wed Jul 24 15:18:05 2019        (r350292)
@@ -550,7 +550,7 @@ __elfN(load_section)(struct image_params *imgp, vm_oof
        size_t map_len;
        vm_map_t map;
        vm_object_t object;
-       vm_offset_t off, map_addr;
+       vm_offset_t map_addr;
        int error, rv, cow;
        size_t copy_len;
        vm_ooffset_t file_addr;
@@ -629,9 +629,8 @@ __elfN(load_section)(struct image_params *imgp, vm_oof
                        return (EIO);
 
                /* send the page fragment to user space */
-               off = trunc_page(offset + filsz) - trunc_page(offset + filsz);
-               error = copyout((caddr_t)sf_buf_kva(sf) + off,
-                   (caddr_t)map_addr, copy_len);
+               error = copyout((caddr_t)sf_buf_kva(sf), (caddr_t)map_addr,
+                   copy_len);
                vm_imgact_unmap_page(sf);
                if (error != 0)
                        return (error);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to