diff options
author | Alan Modra <amodra@gmail.com> | 2019-09-18 15:04:27 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-09-18 21:32:51 +0930 |
commit | 1d38e9d14cc793bca9124d5ed7dc2a6e3122f2e5 (patch) | |
tree | af0c3bdb5483df06b9f1fb399aa40bfdf0c138ce /ld | |
parent | 90d92a632aaf75ce698335efeb383ddf785c12d8 (diff) | |
download | gdb-1d38e9d14cc793bca9124d5ed7dc2a6e3122f2e5.zip gdb-1d38e9d14cc793bca9124d5ed7dc2a6e3122f2e5.tar.gz gdb-1d38e9d14cc793bca9124d5ed7dc2a6e3122f2e5.tar.bz2 |
Constify target name, reloc name, and carsym name
bfd/
* bfd-in.h (carsym.name): Make const.
* reloc.c (struct reloc_howto_struct.name): Likewise.
* targets.c (bfd_target.name): Likewise.!
* bfd.c (bfd_get_sign_extend_vma): Make variable const.
* som.c (som_bfd_fill_in_ar_symbols): Use an intermediary variable
when setting carsym.name.
* bfd-in2.h: Regenerate.
gdb/
* amd64-dicos-tdep.c (amd64_dicos_osabi_sniffer): Constify target.
* i386-cygwin-tdep.c (i386_cygwin_init_abi): Likewise.
* i386-dicos-tdep.c (i386_dicos_osabi_sniffer): Likewise.
ld/
* ldlang.c (stricpy, strcut, name_compare): Constify params.
(get_first_input_target): Make return and "target" const.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/ldlang.c | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 81935a4..b863676 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,10 @@ 2019-09-18 Alan Modra <amodra@gmail.com> + * ldlang.c (stricpy, strcut, name_compare): Constify params. + (get_first_input_target): Make return and "target" const. + +2019-09-18 Alan Modra <amodra@gmail.com> + * emultempl/pe.em (after_open): Use bfd_set_filename. * emultempl/pep.em (after_open): Use bfd_set_filename. diff --git a/ld/ldlang.c b/ld/ldlang.c index 8beccd3..76e862a 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -3149,7 +3149,7 @@ get_target (const bfd_target *target, void *data) /* Like strcpy() but convert to lower case as well. */ static void -stricpy (char *dest, char *src) +stricpy (char *dest, const char *src) { char c; @@ -3163,7 +3163,7 @@ stricpy (char *dest, char *src) from haystack. */ static void -strcut (char *haystack, char *needle) +strcut (char *haystack, const char *needle) { haystack = strstr (haystack, needle); @@ -3182,7 +3182,7 @@ strcut (char *haystack, char *needle) Return a value indicating how "similar" they are. */ static int -name_compare (char *first, char *second) +name_compare (const char *first, const char *second) { char *copy1; char *copy2; @@ -3267,10 +3267,10 @@ closest_target_match (const bfd_target *target, void *data) /* Return the BFD target format of the first input file. */ -static char * +static const char * get_first_input_target (void) { - char *target = NULL; + const char *target = NULL; LANG_FOR_EACH_INPUT_STATEMENT (s) { |