diff options
author | marcel <marcel@FreeBSD.org> | 2003-05-31 19:55:05 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-05-31 19:55:05 +0000 |
commit | 9bba923f2e3e4a4a2918fcf3e5e5df9c9c338a9f (patch) | |
tree | 7f874477443cb9663f7b30b002f002be3fbdfcc6 /sys | |
parent | 22c73f78e77c007d9ecf2a43b181f7132905ebd5 (diff) | |
download | FreeBSD-src-9bba923f2e3e4a4a2918fcf3e5e5df9c9c338a9f.zip FreeBSD-src-9bba923f2e3e4a4a2918fcf3e5e5df9c9c338a9f.tar.gz |
Fix ia32 compat on ia64. Recent ia64 MD changes caused the garbage on
the stack to be changed in a way incompatible with elf32_map_insert()
where we used data_buf without initializing it for when the partial
mapping resulting in a misaligned image (typical when the page size
implied by the image is not the same as the page size in use by the
kernel). Since data_buf is passed by reference to vm_map_find(), the
compiler cannot warn about it.
While here, move all local variables to the top of the function.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/imgact_elf.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index f6b0cb2..9c36d80 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -274,7 +274,9 @@ __elfN(map_insert)(vm_map_t map, vm_object_t object, vm_ooffset_t offset, vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, int cow) { - int rv; + vm_offset_t data_buf, off; + vm_size_t sz; + int error, rv; if (start != trunc_page(start)) { rv = __elfN(map_partial)(map, object, offset, start, @@ -293,10 +295,6 @@ __elfN(map_insert)(vm_map_t map, vm_object_t object, vm_ooffset_t offset, } if (end > start) { if (offset & PAGE_MASK) { - vm_offset_t data_buf, off; - vm_size_t sz; - int error; - /* * The mapping is not page aligned. This means we have * to copy the data. Sigh. @@ -305,6 +303,7 @@ __elfN(map_insert)(vm_map_t map, vm_object_t object, vm_ooffset_t offset, FALSE, prot, max, 0); if (rv) return (rv); + data_buf = 0; while (start < end) { vm_object_reference(object); rv = vm_map_find(exec_map, |