#include <ld_syscall.h>
#include <ld_hash.h>
#include <ld_string.h>
+/* Pull in the arch specific page size */
+#include <asm/page.h>
unsigned int *fix_address;
if (! fix_page)
{
- fix_page = _dl_mmap (NULL, 4096 , PROT_READ | PROT_WRITE | PROT_EXEC,
+ fix_page = _dl_mmap (NULL, PAGE_SIZE , PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
fix_offset = 0;
}
fix_address[1] = value;
fix_offset += 8;
- if (fix_offset >= 4096)
+ if (fix_offset >= PAGE_SIZE)
fix_page = NULL;
return (unsigned long)fix_address;
return NULL;
}
- header = _dl_mmap((void *) 0, 4096, PROT_READ | PROT_WRITE,
+ header = _dl_mmap((void *) 0, PAGE_SIZE, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
if (_dl_mmap_check_error(header)) {
_dl_dprintf(2, "%s: can't map '%s'\n", _dl_progname, libname);
return NULL;
};
- _dl_read(infile, header, 4096);
+ _dl_read(infile, header, PAGE_SIZE);
epnt = (ElfW(Ehdr) *) (intptr_t) header;
if (epnt->e_ident[0] != 0x7f ||
epnt->e_ident[1] != 'E' ||
libname);
_dl_internal_error_number = LD_ERROR_NOTELF;
_dl_close(infile);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
};
_dl_dprintf(2, "%s: '%s' is not an ELF executable for " ELF_TARGET
"\n", _dl_progname, libname);
_dl_close(infile);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
};
_dl_dprintf(2, "%s: can't map %s\n", _dl_progname, libname);
_dl_internal_error_number = LD_ERROR_MMAP_FAILED;
_dl_close(infile);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
};
libaddr = (unsigned long) status;
_dl_internal_error_number = LD_ERROR_MMAP_FAILED;
_dl_munmap((char *) libaddr, maxvma - minvma);
_dl_close(infile);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
};
_dl_internal_error_number = LD_ERROR_MMAP_FAILED;
_dl_munmap((char *) libaddr, maxvma - minvma);
_dl_close(infile);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
};
_dl_internal_error_number = LD_ERROR_NODYNAMIC;
_dl_dprintf(2, "%s: '%s' is missing a dynamic section\n",
_dl_progname, libname);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
}
}
#endif
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return tpnt;
}
char *start, *ptr, *string;
static char *buf;
- buf = _dl_mmap((void *) 0, 4096, PROT_READ | PROT_WRITE,
+ buf = _dl_mmap((void *) 0, PAGE_SIZE, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
if (_dl_mmap_check_error(buf)) {
_dl_write(fd, "mmap of a spare page failed!\n", 29);
if (!fmt)
return;
- if (_dl_strlen(fmt) >= (4096 - 1)) {
+ if (_dl_strlen(fmt) >= (PAGE_SIZE - 1)) {
_dl_write(fd, "overflow\n", 11);
_dl_exit(20);
}
start = NULL;
}
}
- _dl_munmap(buf, 4096);
+ _dl_munmap(buf, PAGE_SIZE);
return;
}
if (_dl_malloc_function)
return (*_dl_malloc_function) (size);
- if (_dl_malloc_addr - _dl_mmap_zero + size > 4096) {
+ if (_dl_malloc_addr - _dl_mmap_zero + size > PAGE_SIZE) {
#ifdef __SUPPORT_LD_DEBUG_EARLY__
_dl_dprintf(2, "malloc: mmapping more memory\n");
#endif
/* Call mmap to get a page of writable memory that can be used
* for _dl_malloc throughout the shared lib loader. */
- mmap_zero = malloc_buffer = _dl_mmap((void *) 0, 4096,
+ mmap_zero = malloc_buffer = _dl_mmap((void *) 0, PAGE_SIZE,
PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
if (_dl_mmap_check_error(mmap_zero)) {
SEND_STDERR("dl_boot: mmap of a spare page failed!\n");
return NULL;
}
- header = _dl_mmap((void *) 0, 4096, PROT_READ | PROT_WRITE,
+ header = _dl_mmap((void *) 0, PAGE_SIZE, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
if (_dl_mmap_check_error(header)) {
_dl_dprintf(2, "%s: can't map '%s'\n", _dl_progname, libname);
return NULL;
};
- _dl_read(infile, header, 4096);
+ _dl_read(infile, header, PAGE_SIZE);
epnt = (ElfW(Ehdr) *) (intptr_t) header;
if (epnt->e_ident[0] != 0x7f ||
epnt->e_ident[1] != 'E' ||
libname);
_dl_internal_error_number = LD_ERROR_NOTELF;
_dl_close(infile);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
};
_dl_dprintf(2, "%s: '%s' is not an ELF executable for " ELF_TARGET
"\n", _dl_progname, libname);
_dl_close(infile);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
};
_dl_dprintf(2, "%s: can't map %s\n", _dl_progname, libname);
_dl_internal_error_number = LD_ERROR_MMAP_FAILED;
_dl_close(infile);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
};
libaddr = (unsigned long) status;
_dl_internal_error_number = LD_ERROR_MMAP_FAILED;
_dl_munmap((char *) libaddr, maxvma - minvma);
_dl_close(infile);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
};
_dl_internal_error_number = LD_ERROR_MMAP_FAILED;
_dl_munmap((char *) libaddr, maxvma - minvma);
_dl_close(infile);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
};
_dl_internal_error_number = LD_ERROR_NODYNAMIC;
_dl_dprintf(2, "%s: '%s' is missing a dynamic section\n",
_dl_progname, libname);
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return NULL;
}
}
#endif
- _dl_munmap(header, 4096);
+ _dl_munmap(header, PAGE_SIZE);
return tpnt;
}
char *start, *ptr, *string;
static char *buf;
- buf = _dl_mmap((void *) 0, 4096, PROT_READ | PROT_WRITE,
+ buf = _dl_mmap((void *) 0, PAGE_SIZE, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
if (_dl_mmap_check_error(buf)) {
_dl_write(fd, "mmap of a spare page failed!\n", 29);
if (!fmt)
return;
- if (_dl_strlen(fmt) >= (4096 - 1)) {
+ if (_dl_strlen(fmt) >= (PAGE_SIZE - 1)) {
_dl_write(fd, "overflow\n", 11);
_dl_exit(20);
}
start = NULL;
}
}
- _dl_munmap(buf, 4096);
+ _dl_munmap(buf, PAGE_SIZE);
return;
}
if (_dl_malloc_function)
return (*_dl_malloc_function) (size);
- if (_dl_malloc_addr - _dl_mmap_zero + size > 4096) {
+ if (_dl_malloc_addr - _dl_mmap_zero + size > PAGE_SIZE) {
#ifdef __SUPPORT_LD_DEBUG_EARLY__
_dl_dprintf(2, "malloc: mmapping more memory\n");
#endif