Checking patch elf/dl-find_object.c... error: while searching for: /* This is essentially an arbitrary value. dlopen allocates plenty of memory anyway, so over-allocated a bit does not hurt. Not having many small-ish segments helps to avoid many small binary searches. Not using a power of 2 means that we do not waste an extra page just for the malloc header if a mapped allocation is used in the glibc allocator. */ enum { dlfo_mappings_initial_segment_size = 63 }; /* Allocate an empty segment. This used for the first ever allocation. */ static struct dlfo_mappings_segment * _dlfo_mappings_segment_allocate_unpadded (size_t size) { if (size < dlfo_mappings_initial_segment_size) size = dlfo_mappings_initial_segment_size; /* No overflow checks here because the size is a mapping count, and struct link_map_private is larger than what we allocate here. */ enum { element_size = sizeof ((struct dlfo_mappings_segment) {}.objects[0]) }; size_t to_allocate = (sizeof (struct dlfo_mappings_segment) + size * element_size); struct dlfo_mappings_segment *result = malloc (to_allocate); if (result != NULL) { result->previous = NULL; result->to_free = NULL; /* Minimal malloc memory cannot be freed. */ result->size = 0; result->allocated = size; } return result; } /* Allocate an empty segment that is at least SIZE large. PREVIOUS points to the chain of previously allocated segments and can be NULL. */ static struct dlfo_mappings_segment * _dlfo_mappings_segment_allocate (size_t size, struct dlfo_mappings_segment * previous) { /* Exponential sizing policies, so that lookup approximates a binary search. */ error: patch failed: elf/dl-find_object.c:154 error: elf/dl-find_object.c: patch does not apply Checking patch elf/dl-find_object.h... error: while searching for: data structures. Needs to be protected by loader write lock. */ void _dl_find_object_dlclose (struct link_map_private *l) attribute_hidden; /* Called from __libc_freeres to deallocate malloc'ed memory. */ void _dl_find_object_freeres (void) attribute_hidden; #endif /* _DL_FIND_OBJECT_H */ error: patch failed: elf/dl-find_object.h:135 error: elf/dl-find_object.h: patch does not apply Checking patch elf/dl-libc_freeres.c... Hunk #1 succeeded at 122 (offset -6 lines).