Constify string parameters
Andreas Schwab
schwab@suse.de
Thu Dec 11 15:44:00 GMT 2014
The _dl_map_object function accepts a const file name, so make it const
in all callers. Tested on x86_64-suse-linux and installed as obvious.
Andreas.
* elf/rtld.c (struct map_args): Constify str member.
(do_preload): Constify fname argument.
diff --git a/elf/rtld.c b/elf/rtld.c
index 76c57f0..fb02ecd 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -441,7 +441,7 @@ struct relocate_args
struct map_args
{
/* Argument to map_doit. */
- char *str;
+ const char *str;
struct link_map *loader;
int mode;
/* Return value of map_doit. */
@@ -651,7 +651,7 @@ _dl_initial_error_catch_tsd (void)
static unsigned int
-do_preload (char *fname, struct link_map *main_map, const char *where)
+do_preload (const char *fname, struct link_map *main_map, const char *where)
{
const char *objname;
const char *err_str = NULL;
--
2.2.0
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list