GNU Binutils with patches for OS216
修訂 | 992f1ddc3be1f5195f18beaa801ac50f284b10c5 (tree) |
---|---|
時間 | 2016-12-21 02:07:19 |
作者 | Pedro Alves <palves@redh...> |
Commiter | Pedro Alves |
gdb: Constify solib_find
gdb/ChangeLog:
2016-12-20 Pedro Alves <palves@redhat.com>
* nto-tdep.c (nto_find_and_open_solib): Constify 'solib'
parameter.
* nto-tdep.h (nto_find_and_open_solib): Constify 'solib'
parameter.
* solib.c (solib_find_1, exec_file_find, solib_find): Constify
in_pathname' parameter.
* solist.h (struct target_so_ops) <find_and_open_solib>: Constify
'soname' parameter.
(exec_file_find, solib_find): Constify 'in_pathname' parameter.
@@ -1,4 +1,16 @@ | ||
1 | 1 | 2016-12-20 Pedro Alves <palves@redhat.com> |
2 | + | |
3 | + * nto-tdep.c (nto_find_and_open_solib): Constify 'solib' | |
4 | + parameter. | |
5 | + * nto-tdep.h (nto_find_and_open_solib): Constify 'solib' | |
6 | + parameter. | |
7 | + * solib.c (solib_find_1, exec_file_find, solib_find): Constify | |
8 | + in_pathname' parameter. | |
9 | + * solist.h (struct target_so_ops) <find_and_open_solib>: Constify | |
10 | + 'soname' parameter. | |
11 | + (exec_file_find, solib_find): Constify 'in_pathname' parameter. | |
12 | + | |
13 | +2016-12-20 Pedro Alves <palves@redhat.com> | |
2 | 14 | Yao Qi <yao.qi@linaro.org> |
3 | 15 | |
4 | 16 | PR gdb/20977 |
@@ -87,7 +87,8 @@ nto_map_arch_to_cputype (const char *arch) | ||
87 | 87 | } |
88 | 88 | |
89 | 89 | int |
90 | -nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname) | |
90 | +nto_find_and_open_solib (const char *solib, unsigned o_flags, | |
91 | + char **temp_pathname) | |
91 | 92 | { |
92 | 93 | char *buf, *arch_path, *nto_root; |
93 | 94 | const char *endian; |
@@ -164,7 +164,7 @@ void nto_relocate_section_addresses (struct so_list *, | ||
164 | 164 | |
165 | 165 | int nto_map_arch_to_cputype (const char *); |
166 | 166 | |
167 | -int nto_find_and_open_solib (char *, unsigned, char **); | |
167 | +int nto_find_and_open_solib (const char *, unsigned, char **); | |
168 | 168 | |
169 | 169 | enum gdb_osabi nto_elf_osabi_sniffer (bfd *abfd); |
170 | 170 |
@@ -152,7 +152,7 @@ show_solib_search_path (struct ui_file *file, int from_tty, | ||
152 | 152 | */ |
153 | 153 | |
154 | 154 | static char * |
155 | -solib_find_1 (char *in_pathname, int *fd, int is_solib) | |
155 | +solib_find_1 (const char *in_pathname, int *fd, int is_solib) | |
156 | 156 | { |
157 | 157 | const struct target_so_ops *ops = solib_ops (target_gdbarch ()); |
158 | 158 | int found_file = -1; |
@@ -383,7 +383,7 @@ solib_find_1 (char *in_pathname, int *fd, int is_solib) | ||
383 | 383 | file handle for the main executable. */ |
384 | 384 | |
385 | 385 | char * |
386 | -exec_file_find (char *in_pathname, int *fd) | |
386 | +exec_file_find (const char *in_pathname, int *fd) | |
387 | 387 | { |
388 | 388 | char *result; |
389 | 389 | const char *fskind = effective_target_file_system_kind (); |
@@ -434,7 +434,7 @@ exec_file_find (char *in_pathname, int *fd) | ||
434 | 434 | above. */ |
435 | 435 | |
436 | 436 | char * |
437 | -solib_find (char *in_pathname, int *fd) | |
437 | +solib_find (const char *in_pathname, int *fd) | |
438 | 438 | { |
439 | 439 | const char *solib_symbols_extension |
440 | 440 | = gdbarch_solib_symbols_extension (target_gdbarch ()); |
@@ -443,7 +443,7 @@ solib_find (char *in_pathname, int *fd) | ||
443 | 443 | extension. */ |
444 | 444 | if (solib_symbols_extension != NULL) |
445 | 445 | { |
446 | - char *p = in_pathname + strlen (in_pathname); | |
446 | + const char *p = in_pathname + strlen (in_pathname); | |
447 | 447 | |
448 | 448 | while (p > in_pathname && *p != '.') |
449 | 449 | p--; |
@@ -127,7 +127,7 @@ struct target_so_ops | ||
127 | 127 | If TEMP_PATHNAME is non-NULL: If the file is successfully opened a |
128 | 128 | pointer to a malloc'd and realpath'd copy of SONAME is stored there, |
129 | 129 | otherwise NULL is stored there. */ |
130 | - int (*find_and_open_solib) (char *soname, | |
130 | + int (*find_and_open_solib) (const char *soname, | |
131 | 131 | unsigned o_flags, char **temp_pathname); |
132 | 132 | |
133 | 133 | /* Hook for looking up global symbols in a library-specific way. */ |
@@ -172,10 +172,10 @@ void free_so (struct so_list *so); | ||
172 | 172 | struct so_list *master_so_list (void); |
173 | 173 | |
174 | 174 | /* Find main executable binary file. */ |
175 | -extern char *exec_file_find (char *in_pathname, int *fd); | |
175 | +extern char *exec_file_find (const char *in_pathname, int *fd); | |
176 | 176 | |
177 | 177 | /* Find shared library binary file. */ |
178 | -extern char *solib_find (char *in_pathname, int *fd); | |
178 | +extern char *solib_find (const char *in_pathname, int *fd); | |
179 | 179 | |
180 | 180 | /* Open BFD for shared library file. */ |
181 | 181 | extern bfd *solib_bfd_fopen (char *pathname, int fd); |