https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112358
--- Comment #10 from John David Anglin <danglin at gcc dot gnu.org> --- The following patch also fixes the warning/error. diff --git a/elf/dl-find_object.c b/elf/dl-find_object.c index 449302eda3..b18a1b209d 100644 --- a/elf/dl-find_object.c +++ b/elf/dl-find_object.c @@ -683,8 +683,12 @@ _dl_find_object_update_1 (struct link_map **loaded, size_t count) atomic_store_release (&_dlfo_loaded_mappings[!active_idx], target_seg); } else - /* Start update cycle without allocation. */ - _dlfo_mappings_begin_update (); + { + assert (target_seg != NULL); + + /* Start update cycle without allocation. */ + _dlfo_mappings_begin_update (); + } } size_t target_seg_index1 = _dlfo_update_init_seg (target_seg, The assert never causes an abort abort in glibc build and check, so I believe the warning/error is a false positive. _dl_find_object_update_1 is sometimes called when target_seg is NULL, but in that case, new_allocated is less than remaining_to_add.