rtld: Sync memory allocation with FreeBSD
authorJohn Marino <draco@marino.st>
Sun, 25 Mar 2012 10:49:17 +0000 (12:49 +0200)
committerJohn Marino <draco@marino.st>
Sun, 25 Mar 2012 11:28:16 +0000 (13:28 +0200)
commit244c342a6ea267fc2448f87dc5703cceae62e47e
tree2097aefcf2932b6b3b35b4147d7be2fe95ff5ef6
parent3f04b942847833b9613fd053cbf4379ab352f8b8
rtld: Sync memory allocation with FreeBSD

Taken from:
FreeBSD SVN 233306 (22 March 2012)
FreeBSD SVN 233307 (22 March 2012)
FreeBSD SVN 233357 (22 March 2012)

Remove unused CalTech #ifdef fragments.

Use xmalloc() instead of malloc() in the places where malloc() calls
are assumed to not fail. Make the xcalloc() calling conventions follow
the calloc(3) calling conventions and replace unchecked calls to calloc()
with calls to xcalloc(). Remove redundand declarations from xmalloc.c,
which are already present in rtld.h.

Implement xstrdup() using strlen()/xmalloc()/memcpy() already presented
in rtld, instead of pulling in libc strdup().
libexec/rtld-elf/malloc.c
libexec/rtld-elf/rtld.c
libexec/rtld-elf/rtld.h
libexec/rtld-elf/xmalloc.c