Rebase to FSF GDB 7.9.50.20150531 (pre-7.10 trunk snapshot).

This commit is contained in:
Jan Kratochvil 2015-05-31 20:47:21 +02:00
commit 32f92b2e34
32 changed files with 1228 additions and 2609 deletions

View file

@ -9,12 +9,12 @@ Index: gdb-7.5.50.20130310/gdb/solib-svr4.c
- struct elf_build_id *build_id;
+ struct elf_build_id *build_id = NULL;
strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
/* May get overwritten below. */
strcpy (new->so_name, new->so_original_name);
strcpy (newobj->so_name, newobj->so_original_name);
- build_id = build_id_addr_get (new->lm_info->l_ld);
- build_id = build_id_addr_get (newobj->lm_info->l_ld);
+ /* In the case the main executable was found according to its build-id
+ (from a core file) prevent loading a different build of a library
+ with accidentally the same SO_NAME.
@ -28,7 +28,7 @@ Index: gdb-7.5.50.20130310/gdb/solib-svr4.c
+ to the only existing file loaded that time - the executable. */
+ if (symfile_objfile != NULL
+ && (symfile_objfile->flags & OBJF_BUILD_ID_CORE_LOADED) != 0)
+ build_id = build_id_addr_get (new->lm_info->l_ld);
+ build_id = build_id_addr_get (newobj->lm_info->l_ld);
if (build_id != NULL)
{
char *name, *build_id_filename;
@ -37,7 +37,7 @@ Index: gdb-7.5.50.20130310/gdb/solib-svr4.c
}
else
- {
- debug_print_missing (new->so_name, build_id_filename);
- debug_print_missing (newobj->so_name, build_id_filename);
-
- /* In the case the main executable was found according to
- its build-id (from a core file) prevent loading
@ -51,9 +51,9 @@ Index: gdb-7.5.50.20130310/gdb/solib-svr4.c
- if (symfile_objfile != NULL
- && (symfile_objfile->flags
- & OBJF_BUILD_ID_CORE_LOADED) != 0)
- new->so_name[0] = 0;
- newobj->so_name[0] = 0;
- }
+ debug_print_missing (new->so_name, build_id_filename);
+ debug_print_missing (newobj->so_name, build_id_filename);
xfree (build_id_filename);
xfree (build_id);