Index: libexec/rtld-elf/Makefile =================================================================== --- libexec/rtld-elf/Makefile +++ libexec/rtld-elf/Makefile @@ -30,7 +30,7 @@ .else LDFLAGS+= -nostdlib -e .rtld_start .endif -WARNS?= 2 +WARNS?= 3 INSTALLFLAGS= -C -b PRECIOUSPROG= BINDIR= /libexec Index: libexec/rtld-elf/libmap.h =================================================================== --- libexec/rtld-elf/libmap.h +++ libexec/rtld-elf/libmap.h @@ -5,4 +5,4 @@ int lm_init (char *); void lm_fini (void); char * lm_find (const char *, const char *); -char * lm_findn (const char *, const char *, const int); +char * lm_findn (const char *, const char *, const size_t); Index: libexec/rtld-elf/libmap.c =================================================================== --- libexec/rtld-elf/libmap.c +++ libexec/rtld-elf/libmap.c @@ -200,7 +200,7 @@ /* allow includedir + full length path */ char line[MAXPATHLEN + 13]; size_t cnt; - int i; + size_t i; cnt = 0; p = NULL; @@ -399,7 +399,7 @@ * replacement library, or NULL. */ char * -lm_findn(const char *p, const char *f, const int n) +lm_findn(const char *p, const char *f, const size_t n) { char pathbuf[64], *s, *t; Index: libexec/rtld-elf/malloc.c =================================================================== --- libexec/rtld-elf/malloc.c +++ libexec/rtld-elf/malloc.c @@ -60,15 +60,11 @@ #include "rtld_printf.h" #include "paths.h" -static void morecore(); -static int findbucket(); - /* * Pre-allocate mmap'ed pages */ #define NPOOLPAGES (128*1024/pagesz) static caddr_t pagepool_start, pagepool_end; -static int morepages(); /* * The overhead on a block is at least 4 bytes. When free, this space @@ -96,6 +92,11 @@ #define ov_size ovu.ovu_size }; +static void morecore(int bucket); +static int morepages(int n); +static int findbucket(union overhead *freep, int srchlen); + + #define MAGIC 0xef /* magic # on accounting info */ #define RMAGIC 0x5555 /* magic # on range info */ @@ -158,7 +159,7 @@ { register union overhead *op; register int bucket; - register long n; + register size_t n; register unsigned amt; /* Index: libexec/rtld-elf/map_object.c =================================================================== --- libexec/rtld-elf/map_object.c +++ libexec/rtld-elf/map_object.c @@ -340,7 +340,7 @@ Elf_Ehdr *hdr; /* Make sure file has enough data for the ELF header */ - if (sbp != NULL && sbp->st_size < sizeof(Elf_Ehdr)) { + if (sbp != NULL && sbp->st_size < (off_t)sizeof(Elf_Ehdr)) { _rtld_error("%s: invalid file format", path); return (NULL); } Index: libexec/rtld-elf/rtld.h =================================================================== --- libexec/rtld-elf/rtld.h +++ libexec/rtld-elf/rtld.h @@ -54,7 +54,7 @@ extern size_t tls_last_offset; extern size_t tls_last_size; extern size_t tls_static_space; -extern int tls_dtv_generation; +extern size_t tls_dtv_generation; extern int tls_max_index; extern int npagesizes; Index: libexec/rtld-elf/rtld.c =================================================================== --- libexec/rtld-elf/rtld.c +++ libexec/rtld-elf/rtld.c @@ -70,7 +70,7 @@ #include "notes.h" /* Types. */ -typedef void (*func_ptr_type)(); +typedef void (*func_ptr_type)(void); typedef void * (*path_enum_proc) (const char *path, size_t len, void *arg); /* @@ -235,6 +235,13 @@ int _rtld_is_dlopened(void *) __exported; void _rtld_error(const char *, ...) __exported; +/* Only here to fix -Wmissing-prototypes warnings */ +int __getosreldate(void); +void __pthread_cxa_finalize(struct dl_phdr_info *a); +func_ptr_type _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp); +Elf_Addr _rtld_bind(Obj_Entry *obj, Elf_Size reloff); + + int npagesizes, osreldate; size_t *pagesizes; @@ -261,7 +268,7 @@ size_t tls_last_size; /* Static TLS size of last module */ size_t tls_static_space; /* Static TLS space allocated */ size_t tls_static_max_align; -int tls_dtv_generation = 1; /* Used to detect when dtv size changes */ +size_t tls_dtv_generation = 1; /* Used to detect when dtv size changes */ int tls_max_index = 1; /* Largest module index allocated */ bool ld_library_path_rpath = false; @@ -4832,7 +4839,7 @@ char *tls; Elf_Addr *dtv, *olddtv; Elf_Addr segbase, oldsegbase, addr; - int i; + size_t i; ralign = tcbalign; if (tls_static_max_align > ralign)