Offer an option to build the gdbserver statically. This helps in case of debugging shared library loading.
1 diff -ur glibc-2.1.3.orig/malloc/malloc.c glibc-2.1.3/malloc/malloc.c
2 --- glibc-2.1.3.orig/malloc/malloc.c Wed Feb 23 10:02:55 2000
3 +++ glibc-2.1.3/malloc/malloc.c Thu Aug 1 09:24:10 2002
4 @@ -3656,12 +3656,20 @@
8 - INTERNAL_SIZE_T sz, csz, oldtopsize;
9 + INTERNAL_SIZE_T bytes, sz, csz, oldtopsize;
12 + /* size_t is unsigned so the behavior on overflow is defined;
13 + * request2size() uses similar post-checks anyway. */
14 + bytes = n * elem_size;
15 + if ((n | elem_size) >= 65536 && elem_size && bytes / elem_size != n) {
16 + __set_errno (ENOMEM);
20 #if defined _LIBC || defined MALLOC_HOOKS
21 if (__malloc_hook != NULL) {
24 #if defined __GNUC__ && __GNUC__ >= 2
25 mem = (*__malloc_hook)(sz, __builtin_return_address (0));
31 - if(request2size(n * elem_size, sz))
32 + if(request2size(bytes, sz))
34 arena_get(ar_ptr, sz);