-/* $OpenBSD: dlfcn.c,v 1.89 2013/11/13 05:41:41 deraadt Exp $ */
+/* $OpenBSD: dlfcn.c,v 1.90 2015/01/22 05:48:17 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
elf_object_t *object;
elf_object_t *dynobj;
const elf_object_t *pobj;
- char *retval;
+ char *retval;
const Elf_Sym *sym = NULL;
int flags;
int i;
fmt = object->sod.sod_library ? fmt1 : fmt2;
-
+
for (i = 0; fmt[i]; i++) {
if (fmt[i] != '%' && fmt[i] != '\\') {
_dl_fdprintf(fd, "%c", fmt[i]);
-/* $OpenBSD: library_mquery.c,v 1.48 2015/01/16 16:18:07 deraadt Exp $ */
+/* $OpenBSD: library_mquery.c,v 1.49 2015/01/22 05:48:17 deraadt Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
_dl_close(libfile);
dynp = (Elf_Dyn *)((unsigned long)dynp + LOFF);
- object = _dl_finalize_object(libname, dynp,
+ object = _dl_finalize_object(libname, dynp,
(Elf_Phdr *)((char *)lowld->start + ehdr->e_phoff), ehdr->e_phnum,
type, (Elf_Addr)lowld->start, LOFF);
if (object) {
-/* $OpenBSD: loader.c,v 1.152 2015/01/16 16:18:07 deraadt Exp $ */
+/* $OpenBSD: loader.c,v 1.153 2015/01/22 05:48:17 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
}
if (fini_complete && initfirst_skipped)
- fini_complete = initfirst_skipped = skip_initfirst = 0;
+ fini_complete = initfirst_skipped = skip_initfirst = 0;
}
}
*/
dynp = (Elf_Dyn *)((void *)_DYNAMIC);
ehdr = (Elf_Ehdr *)dl_data[AUX_base];
- dyn_obj = _dl_finalize_object(us, dynp,
+ dyn_obj = _dl_finalize_object(us, dynp,
(Elf_Phdr *)((char *)dl_data[AUX_base] + ehdr->e_phoff),
ehdr->e_phnum, OBJTYPE_LDR, dl_data[AUX_base], dyn_loff);
_dl_add_object(dyn_obj);
-/* $OpenBSD: malloc.c,v 1.6 2015/01/16 16:18:07 deraadt Exp $ */
+/* $OpenBSD: malloc.c,v 1.7 2015/01/22 05:48:17 deraadt Exp $ */
/*
* Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
/* low bits of r->p determine size: 0 means >= page size and p->size holding
* real size, otherwise r->size is a shift count, or 1 for malloc(0)
*/
-#define REALSIZE(sz, r) \
+#define REALSIZE(sz, r) \
(sz) = (uintptr_t)(r)->p & MALLOC_PAGEMASK, \
(sz) = ((sz) == 0 ? (r)->size : ((sz) == 1 ? 0 : (1 << ((sz)-1))))
p = MMAP_ERROR(p);
if (p == MAP_FAILED)
return 1;
-
+
_dl_memset(p, 0, newsize);
- for (i = 0; i < d->regions_total; i++) {
+ for (i = 0; i < d->regions_total; i++) {
void *q = d->r[i].p;
if (q != NULL) {
size_t index = hash(q) & mask;
}
}
/* avoid pages containing meta info to end up in cache */
- if (_dl_munmap(d->r, d->regions_total * sizeof(struct region_info)))
+ if (_dl_munmap(d->r, d->regions_total * sizeof(struct region_info)))
wrterror("munmap");
d->regions_free = d->regions_free + d->regions_total;
d->regions_total = newtotal;
}
-/*
+/*
* The hashtable uses the assumption that p is never NULL. This holds since
* non-MAP_FIXED mappings with hint 0 start at BRKSIZ.
*/
}
}
-
+
/*
* Allocate a page of chunks
*/
lp = &bp->bits[i / MALLOC_BITS];
if (!*lp) {
i += MALLOC_BITS;
- i &= ~(MALLOC_BITS - 1);
+ i &= ~(MALLOC_BITS - 1);
if (i >= bp->total)
i = 0;
} else
* print the error message once, to avoid making the problem
* potentially worse.
*/
-static void
+static void
malloc_recurse(void)
{
static int noprint;
if (ptr == NULL)
return;
- malloc_func = "free():";
+ malloc_func = "free():";
if (g_pool == NULL) {
wrterror("free() called before allocation");
return;
{
void *r;
- malloc_func = "calloc():";
+ malloc_func = "calloc():";
if (g_pool == NULL) {
if (malloc_init() != 0)
return NULL;
size *= nmemb;
r = omalloc(size, 1);
-
+
malloc_active--;
return r;
}
r = find(g_pool, p);
if (r == NULL)
wrterror("bogus pointer (double free?)");
- REALSIZE(oldsz, r);
+ REALSIZE(oldsz, r);
if (oldsz > MALLOC_MAXCHUNK) {
if (oldsz < mopts.malloc_guard)
wrterror("guard size");
_dl_realloc(void *ptr, size_t size)
{
void *r;
-
- malloc_func = "realloc():";
+
+ malloc_func = "realloc():";
if (g_pool == NULL) {
if (malloc_init() != 0)
return NULL;
-/* $OpenBSD: path.c,v 1.4 2015/01/16 16:18:07 deraadt Exp $ */
+/* $OpenBSD: path.c,v 1.5 2015/01/22 05:48:17 deraadt Exp $ */
/*
* Copyright (c) 2013 Kurt Miller <kurt@intricatesoftware.com>
retval[pos++][pp - p_begin] = '\0';
}
- if (*pp) /* Try curdir if ':' at end */
+ if (*pp) /* Try curdir if ':' at end */
pp++;
else
pp = NULL;
-/* $OpenBSD: resolve.c,v 1.67 2014/07/10 09:03:01 otto Exp $ */
+/* $OpenBSD: resolve.c,v 1.68 2015/01/22 05:48:17 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
/* substitution types */
typedef enum {
- SUBST_UNKNOWN, SUBST_ORIGIN, SUBST_OSNAME, SUBST_OSREL, SUBST_PLATFORM
+ SUBST_UNKNOWN, SUBST_ORIGIN, SUBST_OSNAME, SUBST_OSREL, SUBST_PLATFORM
} SUBST_TYPES;
elf_object_t *_dl_objects;
return;
/* NULL terminate tmp_path */
- *tp = '\0';
+ *tp = '\0';
if (_dl_strcmp(tmp_path, *path) == 0)
return;
void
_dl_debug_state(void)
{
- /* Debugger stub */
+ /* Debugger stub */
}
-/* $OpenBSD: resolve.h,v 1.70 2013/11/13 05:41:42 deraadt Exp $ */
+/* $OpenBSD: resolve.h,v 1.71 2015/01/22 05:48:17 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
/* object that caused this module to be loaded, used in symbol lookup */
elf_object_t *load_object;
- struct sod sod;
+ struct sod sod;
void *prebind_data;