diff --git a/capsule/capsule-init.c b/capsule/capsule-init.c index 8e72b4666c5e82e2ae5d8b155589d4b7a4ee8b7a..89955f71406e409ee52fff0e3f2fed14037e54f6 100644 --- a/capsule/capsule-init.c +++ b/capsule/capsule-init.c @@ -222,10 +222,10 @@ cook_list (ptr_list *list) * as @list does. */ static void -add_new_strings_to_ptrlist (ptr_list *list, const char **strings) +add_new_strings_to_ptrlist (ptr_list *list, const char * const *strings) { - for( char **c = (char **)strings; c && *c; c++ ) - ptr_list_add_ptr( list, *c, str_equal ); + for( const char * const *c = strings; c && *c; c++ ) + ptr_list_add_ptr( list, (char *) *c, str_equal ); } /** diff --git a/capsule/capsule-relocate.c b/capsule/capsule-relocate.c index 923769dd88bb197d2be26befff84c96523364ef5..23c10b1135f1120382719fd2ed7e57fe36e8491c 100644 --- a/capsule/capsule-relocate.c +++ b/capsule/capsule-relocate.c @@ -75,9 +75,9 @@ process_phdr (struct dl_phdr_info *info, } static int -dso_is_blacklisted (const char *path, const char **blacklist) +dso_is_blacklisted (const char *path, const char * const *blacklist) { - char **soname; + const char * const *soname; static const char *never = "libcapsule.so"; if( soname_matches_path( never, path ) ) @@ -86,7 +86,7 @@ dso_is_blacklisted (const char *path, const char **blacklist) if( blacklist == NULL ) return 0; - for( soname = (char **) blacklist; soname && *soname; soname++ ) + for( soname = (const char * const *) blacklist; soname && *soname; soname++ ) if( soname_matches_path( *soname, path ) ) return 1; @@ -138,7 +138,7 @@ relocate_cb (struct dl_phdr_info *info, size_t size, void *data) static int relocate (const capsule cap, capsule_item *relocations, - const char **dso_blacklist, + const char * const *dso_blacklist, ptr_list *seen, char **error) { @@ -219,7 +219,7 @@ capsule_relocate (const capsule cap, char **error) int capsule_relocate_except (const capsule cap, capsule_item *relocations, - const char **except, + const char * const *except, char **error) { unsigned long df = debug_flags; diff --git a/capsule/capsule.h b/capsule/capsule.h index 2df9895a94cc8e53b3dd1a4166c8008356bc6a95..b3306006ff663433eb0e9b39823292c056f52268 100644 --- a/capsule/capsule.h +++ b/capsule/capsule.h @@ -105,7 +105,7 @@ struct _capsule_metadata const char *default_prefix; const char **exclude; const char **export; - const char **nowrap; + const char * const *nowrap; capsule_item *dl_wrappers; capsule_item *items; /*< private >*/ @@ -180,7 +180,7 @@ int capsule_relocate (const capsule capsule, _CAPSULE_PUBLIC int capsule_relocate_except (const capsule capsule, capsule_item *relocations, - const char **except, + const char * const *except, char **error); /** diff --git a/data/capsule-mkstublib b/data/capsule-mkstublib index e346f019eb7b61ccf701fb813965333749806b9a..b94fab64c52c23370c9728139177e1e8fdd835c4 100755 --- a/data/capsule-mkstublib +++ b/data/capsule-mkstublib @@ -270,7 +270,7 @@ cat - <<EOF NULL }; -static const char *invalid_dl_reloc_targets[] = +static const char * const invalid_dl_reloc_targets[] = { soname, "libc.so", diff --git a/utils/process-pt-dynamic.h b/utils/process-pt-dynamic.h index 65012eeda76a354ec8d8e47ab6baaa5e641f3d4c..939af0fb809cbf14775ee1dda59ad26477c9b7ab 100644 --- a/utils/process-pt-dynamic.h +++ b/utils/process-pt-dynamic.h @@ -36,7 +36,7 @@ typedef struct int debug; char *error; mmapinfo *mmap_info; - const char **blacklist; + const char * const *blacklist; ptr_list *seen; } relocation_data;