summaryrefslogtreecommitdiffstats
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog16
-rw-r--r--ld/emultempl/aix.em4
-rw-r--r--ld/emultempl/beos.em19
-rw-r--r--ld/emultempl/elf32.em19
-rw-r--r--ld/emultempl/pe.em5
-rw-r--r--ld/emultempl/sunos.em14
-rw-r--r--ld/emultempl/xtensaelf.em7
-rw-r--r--ld/ldctor.c4
-rw-r--r--ld/ldmain.c4
-rw-r--r--ld/ldwrite.c6
-rw-r--r--ld/lexsup.c2
-rw-r--r--ld/pe-dll.c118
12 files changed, 116 insertions, 102 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index dab46921e0..99cc47762d 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,19 @@
+2006-09-16 Nick Clifton <nickc@redhat.com>
+ Pedro Alves <pedro_alves@portugalmail.pt>
+
+ * ldctor.c: Make use of new STRING_COMMA_LEN and CONST_STRNEQ
+ macros defined in bfd.h.
+ * ldmain.c: Likewise.
+ * ldwrite.c: Likewise.
+ * lexsup.c: Likewise.
+ * pe-dll.c: Likewise.
+ * emultempl/aix.em: Likewise.
+ * emultempl/beos.em: Likewise.
+ * emultempl/elf32.em: Likewise.
+ * emultempl/pe.em: Likewise.
+ * emultempl/sunos.em: Likewise.
+ * emultempl/xtensaelf.em: Likewise.
+
2006-09-15 Nick Clifton <nickc@redhat.com>
PR ld/3107
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
index d525edd890..a85f7d0c05 100644
--- a/ld/emultempl/aix.em
+++ b/ld/emultempl/aix.em
@@ -10,7 +10,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* AIX emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005
+ 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
AIX support by Ian Lance Taylor <ian@cygnus.com>
@@ -268,7 +268,7 @@ gld${EMULATION_NAME}_parse_args (int argc, char **argv)
if (indx == 0)
indx = 1;
- if (indx < argc && strncmp (argv[indx], "-b", 2) == 0)
+ if (indx < argc && CONST_STRNEQ (argv[indx], "-b"))
{
char *s;
diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em
index 220ba5900a..adb5dfbfcb 100644
--- a/ld/emultempl/beos.em
+++ b/ld/emultempl/beos.em
@@ -8,7 +8,7 @@ fi
cat >e${EMULATION_NAME}.c <<EOF
/* This file is part of GLD, the Gnu Linker.
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005 Free Software Foundation, Inc.
+ 2005, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -452,16 +452,15 @@ sort_by_section_name (const void *a, const void *b)
const lang_statement_union_type *const *rb = b;
int i;
i = strcmp ((*ra)->input_section.section->name,
- (*rb)->input_section.section->name);
-/* this is a hack to make .stab and .stabstr last, so we don't have
- to fix strip/objcopy for .reloc sections.
- FIXME stripping images with a .rsrc section still needs to be fixed */
- if ( i != 0)
+ (*rb)->input_section.section->name);
+ /* This is a hack to make .stab and .stabstr last, so we don't have
+ to fix strip/objcopy for .reloc sections.
+ FIXME stripping images with a .rsrc section still needs to be fixed. */
+ if (i != 0)
{
- if ((strncmp ((*ra)->input_section.section->name, ".stab", 5) == 0)
- && (strncmp ((*rb)->input_section.section->name, ".stab", 5) != 0))
+ if ((CONST_STRNEQ ((*ra)->input_section.section->name, ".stab"))
+ && (! CONST_STRNEQ ((*rb)->input_section.section->name, ".stab")))
return 1;
- return i;
}
return i;
}
@@ -534,7 +533,7 @@ sort_sections (lang_statement_union_type *s)
{
/* Is this the .idata section? */
if (sec->spec.name != NULL
- && strncmp (sec->spec.name, ".idata", 6) == 0)
+ && CONST_STRNEQ (sec->spec.name, ".idata"))
{
/* Sort the children. We want to sort any objects in
the same archive. In order to handle the case of
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 38bceaa024..3350ac027a 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -365,7 +365,7 @@ case ${target} in
struct bfd_link_needed_list *l;
for (l = needed; l != NULL; l = l->next)
- if (strncmp (l->name, "libc.so", 7) == 0)
+ if (CONST_STRNEQ (l->name, "libc.so"))
break;
if (l == NULL)
{
@@ -698,7 +698,7 @@ gld${EMULATION_NAME}_parse_ld_so_conf
if (p[0] == '\0')
continue;
- if (!strncmp (p, "include", 7) && (p[7] == ' ' || p[7] == '\t'))
+ if (CONST_STRNEQ (p, "include") && (p[7] == ' ' || p[7] == '\t'))
{
char *dir, c;
p += 8;
@@ -1326,7 +1326,7 @@ output_rel_find (asection *sec, int isdyn)
lookup = lookup->next)
{
if (lookup->constraint != -1
- && strncmp (".rel", lookup->name, 4) == 0)
+ && CONST_STRNEQ (lookup->name, ".rel"))
{
int lookrela = lookup->name[4] == 'a';
@@ -1435,7 +1435,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s)
default:
break;
}
- else if (strncmp (secname, ".rel", 4) == 0)
+ else if (CONST_STRNEQ (secname, ".rel"))
{
secname = secname[4] == 'a' ? ".rela.dyn" : ".rel.dyn";
isdyn = 1;
@@ -1483,7 +1483,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s)
sections into the .text section to get them out of the way. */
if (link_info.executable
&& ! link_info.relocatable
- && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0
+ && CONST_STRNEQ (secname, ".gnu.warning.")
&& hold[orphan_text].os != NULL)
{
lang_add_section (&hold[orphan_text].os->children, s,
@@ -1502,7 +1502,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s)
;
else if ((s->flags & SEC_LOAD) != 0
&& ((iself && sh_type == SHT_NOTE)
- || (!iself && strncmp (secname, ".note", 5) == 0)))
+ || (!iself && CONST_STRNEQ (secname, ".note"))))
place = &hold[orphan_interp];
else if ((s->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
place = &hold[orphan_bss];
@@ -1511,7 +1511,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s)
else if ((s->flags & SEC_READONLY) == 0)
place = &hold[orphan_data];
else if (((iself && (sh_type == SHT_RELA || sh_type == SHT_REL))
- || (!iself && strncmp (secname, ".rel", 4) == 0))
+ || (!iself && CONST_STRNEQ (secname, ".rel")))
&& (s->flags & SEC_LOAD) != 0)
place = &hold[orphan_rel];
else if ((s->flags & SEC_CODE) == 0)
@@ -1871,15 +1871,16 @@ EOF
fi
cat >>e${EMULATION_NAME}.c <<EOF
- else if (strncmp (optarg, "max-page-size=", 14) == 0)
+ else if (CONST_STRNEQ (optarg, "max-page-size="))
{
char *end;
+
config.maxpagesize = strtoul (optarg + 14, &end, 0);
if (*end)
einfo (_("%P%F: invalid maxium page size \`%s'\n"),
optarg + 14);
}
- else if (strncmp (optarg, "common-page-size=", 17) == 0)
+ else if (CONST_STRNEQ (optarg, "common-page-size="))
{
char *end;
config.commonpagesize = strtoul (optarg + 17, &end, 0);
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 0e75e182c5..fa4cafe888 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -925,8 +925,7 @@ pe_find_data_imports (void)
for (i = 0; i < nsyms; i++)
{
- if (memcmp (symbols[i]->name, "__head_",
- sizeof ("__head_") - 1))
+ if (! CONST_STRNEQ (symbols[i]->name, "__head_"))
continue;
if (pe_dll_extra_pe_debug)
@@ -1060,7 +1059,7 @@ gld_${EMULATION_NAME}_after_open (void)
{
if (strcmp (sec->name, ".idata\$2") == 0)
idata2 = 1;
- if (strncmp (sec->name, ".idata\$", 7) == 0)
+ if (CONST_STRNEQ (sec->name, ".idata\$"))
is_imp = 1;
reloc_count += sec->reloc_count;
}
diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em
index a480558c90..4fbe108f76 100644
--- a/ld/emultempl/sunos.em
+++ b/ld/emultempl/sunos.em
@@ -10,7 +10,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* SunOS emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
SunOS shared library support by Ian Lance Taylor <ian@cygnus.com>
@@ -160,7 +160,7 @@ gld${EMULATION_NAME}_find_so (lang_input_statement_type *inp)
|| ! inp->dynamic)
return;
- ASSERT (strncmp (inp->local_sym_name, "-l", 2) == 0);
+ ASSERT (CONST_STRNEQ (inp->local_sym_name, "-l"));
for (search = search_head; search != NULL; search = search->next)
{
@@ -273,7 +273,7 @@ gld${EMULATION_NAME}_search_dir
const char *s;
int found_maj, found_min;
- if (strncmp (entry->d_name, "lib", 3) != 0
+ if (! CONST_STRNEQ (entry->d_name, "lib")
|| strncmp (entry->d_name + 3, filename, len) != 0)
continue;
@@ -288,7 +288,7 @@ gld${EMULATION_NAME}_search_dir
native linker does not. This is more convenient for packages
which just generate .so files for shared libraries, as on ELF
systems. */
- if (strncmp (entry->d_name + 3 + len, ".so", 3) != 0)
+ if (! CONST_STRNEQ (entry->d_name + 3 + len, ".so"))
continue;
if (entry->d_name[6 + len] == '\0')
;
@@ -400,7 +400,7 @@ gld${EMULATION_NAME}_after_open (void)
if (global_found)
continue;
- if (strncmp (lname, "-l", 2) != 0)
+ if (! CONST_STRNEQ (lname, "-l"))
{
bfd *abfd;
@@ -586,7 +586,7 @@ gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s)
{
if (s->filename == NULL)
return;
- if (strncmp (global_needed->name, "-l", 2) != 0)
+ if (! CONST_STRNEQ (global_needed->name, "-l"))
{
if (strcmp (s->filename, global_needed->name) == 0)
global_found = TRUE;
@@ -605,7 +605,7 @@ gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s)
else
++sname;
- if (strncmp (sname, "lib", 3) != 0)
+ if (! CONST_STRNEQ (sname, "lib"))
return;
sname += 3;
diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
index 1135d27ef0..bbee546202 100644
--- a/ld/emultempl/xtensaelf.em
+++ b/ld/emultempl/xtensaelf.em
@@ -267,8 +267,7 @@ replace_instruction_table_sections (bfd *abfd, asection *sec)
insn_sec_name = INSN_SEC_BASE_NAME;
prop_sec_name = PROP_SEC_BASE_NAME;
}
- else if (strncmp (sec_name, LINKONCE_SEC_OLD_TEXT_BASE_NAME,
- strlen (LINKONCE_SEC_OLD_TEXT_BASE_NAME)) == 0)
+ else if (CONST_STRNEQ (sec_name, LINKONCE_SEC_OLD_TEXT_BASE_NAME))
{
insn_sec_name = sec_name;
owned_prop_sec_name = (char *) xmalloc (strlen (sec_name) + 20);
@@ -1207,9 +1206,9 @@ is_inconsistent_linkonce_section (asection *sec)
return FALSE;
/* Check if this is an Xtensa property section. */
- if (strncmp (sec_name + linkonce_len, "p.", 2) == 0)
+ if (CONST_STRNEQ (sec_name + linkonce_len, "p."))
name = sec_name + linkonce_len + 2;
- else if (strncmp (sec_name + linkonce_len, "prop.", 5) == 0)
+ else if (CONST_STRNEQ (sec_name + linkonce_len, "prop."))
name = strchr (sec_name + linkonce_len + 5, '.') + 1;
if (name)
diff --git a/ld/ldctor.c b/ld/ldctor.c
index 3de4ef1605..f9cdcd1d96 100644
--- a/ld/ldctor.c
+++ b/ld/ldctor.c
@@ -1,6 +1,6 @@
/* ldctor.c -- constructor support routines
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
By Steve Chamberlain <sac@cygnus.com>
This file is part of GLD, the Gnu Linker.
@@ -131,7 +131,7 @@ ctor_prio (const char *name)
while (*name == '_')
++name;
- if (strncmp (name, "GLOBAL_", sizeof "GLOBAL_" - 1) != 0)
+ if (! CONST_STRNEQ (name, "GLOBAL_"))
return -1;
name += sizeof "GLOBAL_" - 1;
diff --git a/ld/ldmain.c b/ld/ldmain.c
index d9b434323d..bc03e02743 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -608,7 +608,7 @@ get_sysroot (int argc, char **argv)
const char *path;
for (i = 1; i < argc; i++)
- if (strncmp (argv[i], "--sysroot=", strlen ("--sysroot=")) == 0)
+ if (CONST_STRNEQ (argv[i], "--sysroot="))
return argv[i] + strlen ("--sysroot=");
path = get_relative_sysroot (BINDIR);
@@ -637,7 +637,7 @@ get_emulation (int argc, char **argv)
for (i = 1; i < argc; i++)
{
- if (!strncmp (argv[i], "-m", 2))
+ if (CONST_STRNEQ (argv[i], "-m"))
{
if (argv[i][2] == '\0')
{
diff --git a/ld/ldwrite.c b/ld/ldwrite.c
index ee9d74a796..6c8152db50 100644
--- a/ld/ldwrite.c
+++ b/ld/ldwrite.c
@@ -1,6 +1,6 @@
/* ldwrite.c -- write out the linked file
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002,
- 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Written by Steve Chamberlain sac@cygnus.com
This file is part of GLD, the Gnu Linker.
@@ -293,7 +293,7 @@ build_link_order (lang_statement_union_type *statement)
static bfd_boolean
unsplittable_name (const char *name)
{
- if (strncmp (name, ".stab", 5) == 0)
+ if (CONST_STRNEQ (name, ".stab"))
{
/* There are several stab like string sections. We pattern match on
".stab...str" */
@@ -338,7 +338,7 @@ clone_section (bfd *abfd, asection *s, const char *name, int *count)
{
/* Some section names cannot be truncated, as the name is
used to locate some other section. */
- if (strncmp (name, ".stab", 5) == 0
+ if (CONST_STRNEQ (name, ".stab")
|| strcmp (name, "$GDB_SYMBOLS$") == 0)
{
einfo (_ ("%F%P: cannot create split section name for %s\n"), name);
diff --git a/ld/lexsup.c b/ld/lexsup.c
index 19cb037f0d..c4336c45be 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -1308,7 +1308,7 @@ parse_args (unsigned argc, char **argv)
link_info.discard = discard_all;
break;
case 'Y':
- if (strncmp (optarg, "P,", 2) == 0)
+ if (CONST_STRNEQ (optarg, "P,"))
optarg += 2;
if (default_dirlist != NULL)
free (default_dirlist);
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 8af1b06390..0b783fbcba 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -164,42 +164,42 @@ pe_details_type;
static autofilter_entry_type autofilter_symbollist_generic[] =
{
- { ".text", 5 },
+ { STRING_COMMA_LEN (".text") },
/* Entry point symbols. */
- { "DllMain", 7 },
- { "DllMainCRTStartup", 17 },
- { "_DllMainCRTStartup", 18 },
+ { STRING_COMMA_LEN ("DllMain") },
+ { STRING_COMMA_LEN ("DllMainCRTStartup") },
+ { STRING_COMMA_LEN ("_DllMainCRTStartup") },
/* Runtime pseudo-reloc. */
- { "_pei386_runtime_relocator", 25 },
- { "do_pseudo_reloc", 15 },
- { NULL, 0 }
+ { STRING_COMMA_LEN ("_pei386_runtime_relocator") },
+ { STRING_COMMA_LEN ("do_pseudo_reloc") },
+ { STRING_COMMA_LEN (NULL) }
};
static autofilter_entry_type autofilter_symbollist_i386[] =
{
- { ".text", 5 },
+ { STRING_COMMA_LEN (".text") },
/* Entry point symbols, and entry hooks. */
- { "cygwin_crt0", 11 },
- { "DllMain@12", 10 },
- { "DllEntryPoint@0", 15 },
- { "DllMainCRTStartup@12", 20 },
- { "_cygwin_dll_entry@12", 20 },
- { "_cygwin_crt0_common@8", 21 },
- { "_cygwin_noncygwin_dll_entry@12", 30 },
- { "cygwin_attach_dll", 17 },
- { "cygwin_premain0", 15 },
- { "cygwin_premain1", 15 },
- { "cygwin_premain2", 15 },
- { "cygwin_premain3", 15 },
+ { STRING_COMMA_LEN ("cygwin_crt0") },
+ { STRING_COMMA_LEN ("DllMain@12") },
+ { STRING_COMMA_LEN ("DllEntryPoint@0") },
+ { STRING_COMMA_LEN ("DllMainCRTStartup@12") },
+ { STRING_COMMA_LEN ("_cygwin_dll_entry@12") },
+ { STRING_COMMA_LEN ("_cygwin_crt0_common@8") },
+ { STRING_COMMA_LEN ("_cygwin_noncygwin_dll_entry@12") },
+ { STRING_COMMA_LEN ("cygwin_attach_dll") },
+ { STRING_COMMA_LEN ("cygwin_premain0") },
+ { STRING_COMMA_LEN ("cygwin_premain1") },
+ { STRING_COMMA_LEN ("cygwin_premain2") },
+ { STRING_COMMA_LEN ("cygwin_premain3") },
/* Runtime pseudo-reloc. */
- { "_pei386_runtime_relocator", 25 },
- { "do_pseudo_reloc", 15 },
+ { STRING_COMMA_LEN ("_pei386_runtime_relocator") },
+ { STRING_COMMA_LEN ("do_pseudo_reloc") },
/* Global vars that should not be exported. */
- { "impure_ptr", 10 },
- { "_impure_ptr", 11 },
- { "_fmode", 6 },
- { "environ", 7 },
- { NULL, 0 }
+ { STRING_COMMA_LEN ("impure_ptr") },
+ { STRING_COMMA_LEN ("_impure_ptr") },
+ { STRING_COMMA_LEN ("_fmode") },
+ { STRING_COMMA_LEN ("environ") },
+ { STRING_COMMA_LEN (NULL) }
};
#define PE_ARCH_i386 1
@@ -273,51 +273,51 @@ static pe_details_type *pe_details;
/* Do not specify library suffix explicitly, to allow for dllized versions. */
static autofilter_entry_type autofilter_liblist[] =
{
- { "libcegcc", 8 },
- { "libcygwin", 9 },
- { "libgcc", 6 },
- { "libstdc++", 9 },
- { "libmingw32", 10 },
- { "libmingwex", 10 },
- { "libg2c", 6 },
- { "libsupc++", 9 },
- { "libobjc", 7 },
- { "libgcj", 6 },
- { NULL, 0 }
+ { STRING_COMMA_LEN ("libcegcc") },
+ { STRING_COMMA_LEN ("libcygwin") },
+ { STRING_COMMA_LEN ("libgcc") },
+ { STRING_COMMA_LEN ("libstdc++") },
+ { STRING_COMMA_LEN ("libmingw32") },
+ { STRING_COMMA_LEN ("libmingwex") },
+ { STRING_COMMA_LEN ("libg2c") },
+ { STRING_COMMA_LEN ("libsupc++") },
+ { STRING_COMMA_LEN ("libobjc") },
+ { STRING_COMMA_LEN ("libgcj") },
+ { STRING_COMMA_LEN (NULL) }
};
static autofilter_entry_type autofilter_objlist[] =
{
- { "crt0.o", 6 },
- { "crt1.o", 6 },
- { "crt2.o", 6 },
- { "dllcrt1.o", 9 },
- { "dllcrt2.o", 9 },
- { "gcrt0.o", 7 },
- { "gcrt1.o", 7 },
- { "gcrt2.o", 7 },
- { "crtbegin.o", 10 },
- { "crtend.o", 8 },
- { NULL, 0 }
+ { STRING_COMMA_LEN ("crt0.o") },
+ { STRING_COMMA_LEN ("crt1.o") },
+ { STRING_COMMA_LEN ("crt2.o") },
+ { STRING_COMMA_LEN ("dllcrt1.o") },
+ { STRING_COMMA_LEN ("dllcrt2.o") },
+ { STRING_COMMA_LEN ("gcrt0.o") },
+ { STRING_COMMA_LEN ("gcrt1.o") },
+ { STRING_COMMA_LEN ("gcrt2.o") },
+ { STRING_COMMA_LEN ("crtbegin.o") },
+ { STRING_COMMA_LEN ("crtend.o") },
+ { STRING_COMMA_LEN (NULL) }
};
static autofilter_entry_type autofilter_symbolprefixlist[] =
{
- { "__imp_", 6 },
+ { STRING_COMMA_LEN ("__imp_") },
/* Do __imp_ explicitly to save time. */
- { "__rtti_", 7 },
+ { STRING_COMMA_LEN ("__rtti_") },
/* Don't re-export auto-imported symbols. */
- { "_nm_", 4 },
- { "__builtin_", 10 },
+ { STRING_COMMA_LEN ("_nm_") },
+ { STRING_COMMA_LEN ("__builtin_") },
/* Don't export symbols specifying internal DLL layout. */
- { "_head_", 6 },
- { NULL, 0 }
+ { STRING_COMMA_LEN ("_head_") },
+ { STRING_COMMA_LEN (NULL) }
};
static autofilter_entry_type autofilter_symbolsuffixlist[] =
{
- { "_iname", 6 },
- { NULL, 0 }
+ { STRING_COMMA_LEN ("_iname") },
+ { STRING_COMMA_LEN (NULL) }
};
#define U(str) (pe_details->underscored ? "_" str : str)
@@ -432,7 +432,7 @@ auto_export (bfd *abfd, def_file *d, const char *n)
libname = lbasename (abfd->my_archive->filename);
/* We should not re-export imported stuff. */
- if (strncmp (n, "_imp_", 5) == 0)
+ if (CONST_STRNEQ (n, "_imp_"))
return 0;
for (i = 0; i < d->num_exports; i++)
@@ -2674,7 +2674,7 @@ pe_implied_import_dll (const char *filename)
/* Skip unwanted symbols, which are
exported in buggy auto-import releases. */
- if (strncmp (erva + name_rva, "_nm_", 4) != 0)
+ if (! CONST_STRNEQ (erva + name_rva, "_nm_"))
{
/* is_data is true if the address is in the data, rdata or bss
segment. */
OpenPOWER on IntegriCloud