* ld/emultempl/pe.em (pe_fixup_stdcalls): Make at a const char *.
(gldEMULATION_NAME_after_open): Make pnt a const char *.
(gldEMULATION_NAME_place_orphan): Make dollar a const char *.
* ld/emultempl/pep.em (pep_fixup_stdcalls): Make at a
const char *. Introduce at2 as non-const char *.
(gldEMULATION_NAME_after_open): Make pnt a const char *.
(gldEMULATION_NAME_place_orphan): Make dollar a const char *.
* ld/emultempl/spuelf.em (spu_elf_load_ovl_mgr): Make p a
const char *. Introduce np as char *.
* ld/ldelf.c (ldelf_search_needed): Call strchr on freeme, so
slash is non-const, then assign freeme to replacement.
the linker handle the rest). */
if (sec->spec.name != NULL)
{
- char *q = strchr (sec->spec.name, '\$');
+ const char *q = strchr (sec->spec.name, '\$');
if (q != NULL
&& (q[1] == '\0'
if (undef->type == bfd_link_hash_undefined)
{
const char * name = undef->root.string;
- char * at;
+ const char * at;
int lead_at = (*name == '@');
if (lead_at)
{
if (is->the_bfd->my_archive)
{
- char *pnt;
+ const char *pnt;
/* Microsoft import libraries may contain archive members for
one or more DLLs, together with static object files.
int constraint)
{
const char *orig_secname = secname;
- char *dollar = NULL;
+ const char *dollar = NULL;
lang_output_section_statement_type *os;
lang_statement_list_type add_child;
lang_output_section_statement_type *match_by_name = NULL;
for (undef = link_info.hash->undefs; undef; undef=undef->u.undef.next)
if (undef->type == bfd_link_hash_undefined)
{
- char* at = strchr (undef->root.string, '@');
+ const char* at = strchr (undef->root.string, '@');
int lead_at = (*undef->root.string == '@');
if (lead_at)
at = strchr (undef->root.string + 1, '@');
/* The symbol is a stdcall symbol, so let's look for a
cdecl symbol with the same name and resolve to that. */
char *cname = xstrdup (undef->root.string);
+ char *at2;
if (lead_at)
*cname = '_';
- at = strchr (cname, '@');
- if (at)
- *at = 0;
+ at2 = strchr (cname, '@');
+ if (at2)
+ *at2 = 0;
sym = bfd_link_hash_lookup (link_info.hash, cname, 0, 0, 1);
if (sym && sym->type == bfd_link_hash_defined)
{
if (is->the_bfd->my_archive)
{
- char *pnt;
+ const char *pnt;
/* Microsoft import libraries may contain archive members for
one or more DLLs, together with static object files.
int constraint)
{
const char *orig_secname = secname;
- char *dollar = NULL;
+ const char *dollar = NULL;
lang_output_section_statement_type *os;
lang_statement_list_type add_child;
lang_output_section_statement_type *match_by_name = NULL;
if (!lang_output_section_find (oname))
{
lang_output_section_statement_type *os = NULL;
- char *p = strchr (oname + 1, '.');
+ const char *p = strchr (oname + 1, '.');
if (p != NULL)
{
size_t len = p - oname;
- p = memcpy (xmalloc (len + 1), oname, len);
- p[len] = '\0';
- os = lang_output_section_find (p);
- free (p);
+ char *np = memcpy (xmalloc (len + 1), oname, len);
+ np[len] = '\0';
+ os = lang_output_section_find (np);
+ free (np);
}
if (os != NULL)
oname = os->name;
replacement, rep_len + 1);
}
- replacement = freeme;
- if ((slash = strrchr (replacement, '/')) != NULL)
+ if ((slash = strrchr (freeme, '/')) != NULL)
* slash = 0;
+ replacement = freeme;
}
}
break;
if (pattern[0] != '/')
{
- char *p = strrchr (filename, '/');
+ const char *p = strrchr (filename, '/');
size_t patlen = strlen (pattern) + 1;
newp = xmalloc (p - filename + 1 + patlen);