2006-04-19 Randolph Chung * solib-som.c (som_relocate_section_addresses): Cleanup formatting. (som_solib_section_offsets): Only compare filename to match shared object. Index: solib-som.c =================================================================== RCS file: /cvs/src/src/gdb/solib-som.c,v retrieving revision 1.9 diff -u -p -r1.9 solib-som.c --- solib-som.c 24 Mar 2006 23:49:56 -0000 1.9 +++ solib-som.c 19 Apr 2006 00:57:21 -0000 @@ -127,11 +127,9 @@ som_relocate_section_addresses (struct s } else if (aflag & SEC_DATA) { - sec->addr += so->lm_info->data_start; + sec->addr += so->lm_info->data_start; sec->endaddr += so->lm_info->data_start; } - else - ; } /* This hook gets called just before the first instruction in the @@ -787,7 +794,21 @@ som_solib_section_offsets (struct objfil { /* Oh what a pain! We need the offsets before so_list->objfile is valid. The BFDs will never match. Make a best guess. */ - if (strstr (objfile->name, so_list->so_name)) + char *p1, *p2; + + p1 = strrchr(objfile->name, '/'); + p2 = strrchr(so_list->so_name, '/'); + + if (p1) + p1++; + else + p1 = objfile->name; + if (p2) + p2++; + else + p2 = so_list->so_name; + + if (strcmp (p1, p2) == 0) { asection *private_section;