]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove SO_NAME_MAX_PATH_SIZE limit from core solib code
authorPedro Alves <pedro@palves.net>
Fri, 22 Mar 2024 19:46:58 +0000 (19:46 +0000)
committerPedro Alves <pedro@palves.net>
Fri, 22 Mar 2024 19:46:58 +0000 (19:46 +0000)
solib_map_sections errors out if the library file name is longer than
SO_NAME_MAX_PATH_SIZE.

solib::so_name and solib::so_original_name used to be arrays of
SO_NAME_MAX_PATH_SIZE size, so that check made sense then.

However, since commit 98107b0b17ac ("gdb: make
so_list::{so_original_name,so_name} std::strings") those fields are of
std::string type, so there's really no need for the limit.

This commit simply removes the length limit check.

Approved-By: John Baldwin <jhb@FreeBSD.org>
Change-Id: I2ec676b231cd18ae900c61c5caea461f47e989e6

gdb/solib.c

index 952897c37fc95d1abf71b09e938d958b680d700a..9497f5d30992e3eb684bbd692e513d564471f6c4 100644 (file)
@@ -591,8 +591,6 @@ solib_map_sections (solib &so)
      the library's host-side path.  If we let the target dictate
      that objfile's path, and the target is different from the host,
      GDB/MI will not provide the correct host-side path.  */
-  if (strlen (bfd_get_filename (so.abfd.get ())) >= SO_NAME_MAX_PATH_SIZE)
-    error (_ ("Shared library file name is too long."));
 
   so.so_name = bfd_get_filename (so.abfd.get ());
   so.sections = build_section_table (so.abfd.get ());