mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
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.
This commit is contained in:
parent
c5d771b807
commit
a063facbf6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115524
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user