OLD | NEW |
---|---|
1 /* Handle SVR4 shared libraries for GDB, the GNU Debugger. | 1 /* Handle SVR4 shared libraries for GDB, the GNU Debugger. |
2 | 2 |
3 Copyright (C) 1990-1996, 1998-2001, 2003-2012 Free Software | 3 Copyright (C) 1990-1996, 1998-2001, 2003-2012 Free Software |
4 Foundation, Inc. | 4 Foundation, Inc. |
5 | 5 |
6 This file is part of GDB. | 6 This file is part of GDB. |
7 | 7 |
8 This program is free software; you can redistribute it and/or modify | 8 This program is free software; you can redistribute it and/or modify |
9 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
10 the Free Software Foundation; either version 3 of the License, or | 10 the Free Software Foundation; either version 3 of the License, or |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 | 43 |
44 #include "bfd-target.h" | 44 #include "bfd-target.h" |
45 #include "elf-bfd.h" | 45 #include "elf-bfd.h" |
46 #include "exec.h" | 46 #include "exec.h" |
47 #include "auxv.h" | 47 #include "auxv.h" |
48 #include "exceptions.h" | 48 #include "exceptions.h" |
49 | 49 |
50 static struct link_map_offsets *svr4_fetch_link_map_offsets (void); | 50 static struct link_map_offsets *svr4_fetch_link_map_offsets (void); |
51 static int svr4_have_link_map_offsets (void); | 51 static int svr4_have_link_map_offsets (void); |
52 static void svr4_relocate_main_executable (void); | 52 static void svr4_relocate_main_executable (void); |
53 static char* svr4_map_so_name(char *name); | |
eaeltsin
2012/05/22 13:07:20
style:
char *svr4_map
halyavin
2012/05/22 13:19:37
Done.
| |
54 static int svr4_have_map_so_name (void); | |
53 | 55 |
54 /* Link map info to include in an allocated so_list entry. */ | 56 /* Link map info to include in an allocated so_list entry. */ |
55 | 57 |
56 struct lm_info | 58 struct lm_info |
57 { | 59 { |
58 /* Amount by which addresses in the binary should be relocated to | 60 /* Amount by which addresses in the binary should be relocated to |
59 match the inferior. The direct inferior value is L_ADDR_INFERIOR. | 61 match the inferior. The direct inferior value is L_ADDR_INFERIOR. |
60 When prelinking is involved and the prelink base address changes, | 62 When prelinking is involved and the prelink base address changes, |
61 we may need a different offset - the recomputed offset is in L_ADDR. | 63 we may need a different offset - the recomputed offset is in L_ADDR. |
62 It is commonly the same value. It is cached as we want to warn about | 64 It is commonly the same value. It is cached as we want to warn about |
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1220 target_read_string (new->lm_info->l_name, &buffer, | 1222 target_read_string (new->lm_info->l_name, &buffer, |
1221 SO_NAME_MAX_PATH_SIZE - 1, &errcode); | 1223 SO_NAME_MAX_PATH_SIZE - 1, &errcode); |
1222 if (errcode != 0) | 1224 if (errcode != 0) |
1223 { | 1225 { |
1224 warning (_("Can't read pathname for load map: %s."), | 1226 warning (_("Can't read pathname for load map: %s."), |
1225 safe_strerror (errcode)); | 1227 safe_strerror (errcode)); |
1226 do_cleanups (old_chain); | 1228 do_cleanups (old_chain); |
1227 continue; | 1229 continue; |
1228 } | 1230 } |
1229 | 1231 |
1230 strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); | 1232 if (svr4_have_map_so_name ()) |
1233 » { | |
1234 » strncpy (new->so_name, svr4_map_so_name (buffer), | |
1235 » SO_NAME_MAX_PATH_SIZE - 1); | |
1236 » } | |
1237 else | |
1238 » { | |
1239 » strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); | |
1240 » } | |
1231 new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; | 1241 new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; |
1232 strcpy (new->so_original_name, new->so_name); | 1242 strcpy (new->so_original_name, new->so_name); |
1233 xfree (buffer); | 1243 xfree (buffer); |
1234 | 1244 |
1235 /* If this entry has no name, or its name matches the name | 1245 /* If this entry has no name, or its name matches the name |
1236 for the main executable, don't include it in the list. */ | 1246 for the main executable, don't include it in the list. */ |
1237 if (! new->so_name[0] || match_main (new->so_name)) | 1247 if (! new->so_name[0] || match_main (new->so_name)) |
1238 { | 1248 { |
1239 do_cleanups (old_chain); | 1249 do_cleanups (old_chain); |
1240 continue; | 1250 continue; |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2308 sec->bfd)); | 2318 sec->bfd)); |
2309 } | 2319 } |
2310 | 2320 |
2311 | 2321 |
2312 | 2322 |
2313 /* Architecture-specific operations. */ | 2323 /* Architecture-specific operations. */ |
2314 | 2324 |
2315 /* Per-architecture data key. */ | 2325 /* Per-architecture data key. */ |
2316 static struct gdbarch_data *solib_svr4_data; | 2326 static struct gdbarch_data *solib_svr4_data; |
2317 | 2327 |
error: old chunk mismatch | |
OLD | NEW |