aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog14
-rw-r--r--binutils/dlltool.c4
-rw-r--r--binutils/emul_aix.c8
-rw-r--r--binutils/objcopy.c2
-rw-r--r--binutils/objdump.c2
-rw-r--r--binutils/prdbg.c8
-rw-r--r--binutils/readelf.c2
-rw-r--r--binutils/stabs.c12
8 files changed, 33 insertions, 19 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index c6f7963..461a1f5 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,17 @@
+2021-03-22 Martin Liska <mliska@suse.cz>
+
+ * dlltool.c (scan_drectve_symbols): Replace usage of CONST_STRNEQ with startswith.
+ * emul_aix.c (ar_emul_aix_parse_arg): Likewise.
+ * objcopy.c (is_mergeable_note_section): Likewise.
+ * objdump.c (dump_dwarf_section): Likewise.
+ * prdbg.c (pr_method_type): Likewise.
+ (pr_class_baseclass): Likewise.
+ (tg_class_baseclass): Likewise.
+ * readelf.c (process_lto_symbol_tables): Likewise.
+ * stabs.c (ULLHIGH): Likewise.
+ (parse_stab_argtypes): Likewise.
+ (stab_demangle_function_name): Likewise.
+
2021-03-19 H.J. Lu <hongjiu.lu@intel.com>
* readelf.c (get_machine_name): Add EM_INTELGT.
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index 3d44a0b..ca31df9 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -1367,7 +1367,7 @@ scan_drectve_symbols (bfd *abfd)
while (p < e)
{
if (p[0] == '-'
- && CONST_STRNEQ (p, "-export:"))
+ && startswith (p, "-export:"))
{
char * name;
char * c;
@@ -1399,7 +1399,7 @@ scan_drectve_symbols (bfd *abfd)
char *tag_start = ++p;
while (p < e && *p != ' ' && *p != '-')
p++;
- if (CONST_STRNEQ (tag_start, "data"))
+ if (startswith (tag_start, "data"))
flags &= ~BSF_FUNCTION;
}
diff --git a/binutils/emul_aix.c b/binutils/emul_aix.c
index 5be8f38..c11c28b 100644
--- a/binutils/emul_aix.c
+++ b/binutils/emul_aix.c
@@ -91,25 +91,25 @@ ar_emul_aix_replace (bfd **after_bfd, bfd *new_bfd,
static bfd_boolean
ar_emul_aix_parse_arg (char *arg)
{
- if (CONST_STRNEQ (arg, "-X32_64"))
+ if (startswith (arg, "-X32_64"))
{
big_archive = TRUE;
X32 = TRUE;
X64 = TRUE;
}
- else if (CONST_STRNEQ (arg, "-X32"))
+ else if (startswith (arg, "-X32"))
{
big_archive = TRUE;
X32 = TRUE;
X64 = FALSE;
}
- else if (CONST_STRNEQ (arg, "-X64"))
+ else if (startswith (arg, "-X64"))
{
big_archive = TRUE;
X32 = FALSE;
X64 = TRUE;
}
- else if (CONST_STRNEQ (arg, "-g"))
+ else if (startswith (arg, "-g"))
{
big_archive = FALSE;
X32 = TRUE;
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index d58f910..f5e48e8 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -1316,7 +1316,7 @@ is_mergeable_note_section (bfd * abfd, asection * sec)
&& elf_section_data (sec)->this_hdr.sh_type == SHT_NOTE
/* FIXME: We currently only support merging GNU_BUILD_NOTEs.
We should add support for more note types. */
- && (CONST_STRNEQ (sec->name, GNU_BUILD_ATTRS_SECTION_NAME)))
+ && (startswith (sec->name, GNU_BUILD_ATTRS_SECTION_NAME)))
return TRUE;
return FALSE;
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 0aa0373..cb5ce5b 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -3748,7 +3748,7 @@ dump_dwarf_section (bfd *abfd, asection *section,
const char *match;
int i;
- if (CONST_STRNEQ (name, ".gnu.linkonce.wi."))
+ if (startswith (name, ".gnu.linkonce.wi."))
match = ".debug_info";
else
match = name;
diff --git a/binutils/prdbg.c b/binutils/prdbg.c
index a93dccd..614d7f9 100644
--- a/binutils/prdbg.c
+++ b/binutils/prdbg.c
@@ -937,10 +937,10 @@ pr_method_type (void *p, bfd_boolean domain, int argcount, bfd_boolean varargs)
domain_type = pop_type (info);
if (domain_type == NULL)
return FALSE;
- if (CONST_STRNEQ (domain_type, "class ")
+ if (startswith (domain_type, "class ")
&& strchr (domain_type + sizeof "class " - 1, ' ') == NULL)
domain_type += sizeof "class " - 1;
- else if (CONST_STRNEQ (domain_type, "union class ")
+ else if (startswith (domain_type, "union class ")
&& (strchr (domain_type + sizeof "union class " - 1, ' ')
== NULL))
domain_type += sizeof "union class " - 1;
@@ -1349,7 +1349,7 @@ pr_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean is_virtual,
if (t == NULL)
return FALSE;
- if (CONST_STRNEQ (t, "class "))
+ if (startswith (t, "class "))
t += sizeof "class " - 1;
/* Push it back on to take advantage of the prepend_type and
@@ -2238,7 +2238,7 @@ tg_class_baseclass (void *p, bfd_vma bitpos ATTRIBUTE_UNUSED,
if (t == NULL)
return FALSE;
- if (CONST_STRNEQ (t, "class "))
+ if (startswith (t, "class "))
t += sizeof "class " - 1;
/* Push it back on to take advantage of the prepend_type and
diff --git a/binutils/readelf.c b/binutils/readelf.c
index cf62843..7370aa9 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -12708,7 +12708,7 @@ process_lto_symbol_tables (Filedata * filedata)
i < filedata->file_header.e_shnum;
i++, section++)
if (SECTION_NAME_VALID (section)
- && CONST_STRNEQ (SECTION_NAME (section), ".gnu.lto_.symtab."))
+ && startswith (SECTION_NAME (section), ".gnu.lto_.symtab."))
res &= display_lto_symtab (filedata, section);
return res;
diff --git a/binutils/stabs.c b/binutils/stabs.c
index 90254fd..5b6842e 100644
--- a/binutils/stabs.c
+++ b/binutils/stabs.c
@@ -1760,12 +1760,12 @@ parse_stab_range_type (void * dhandle,
#define ULLHIGH "01777777777777777777777;"
if (index_type == DEBUG_TYPE_NULL)
{
- if (CONST_STRNEQ (s2, LLLOW)
- && CONST_STRNEQ (s3, LLHIGH))
+ if (startswith (s2, LLLOW)
+ && startswith (s3, LLHIGH))
return debug_make_int_type (dhandle, 8, FALSE);
if (! ov2
&& n2 == 0
- && CONST_STRNEQ (s3, ULLHIGH))
+ && startswith (s3, ULLHIGH))
return debug_make_int_type (dhandle, 8, TRUE);
}
@@ -2987,7 +2987,7 @@ parse_stab_argtypes (void *dhandle, struct stab_handle *info,
&& (ISDIGIT (argtypes[2])
|| argtypes[2] == 'Q'
|| argtypes[2] == 't'))
- || CONST_STRNEQ (argtypes, "__ct"));
+ || startswith (argtypes, "__ct"));
is_constructor = (is_full_physname_constructor
|| (tagname != NULL
@@ -2995,7 +2995,7 @@ parse_stab_argtypes (void *dhandle, struct stab_handle *info,
is_destructor = ((argtypes[0] == '_'
&& (argtypes[1] == '$' || argtypes[1] == '.')
&& argtypes[2] == '_')
- || CONST_STRNEQ (argtypes, "__dt"));
+ || startswith (argtypes, "__dt"));
is_v3 = argtypes[0] == '_' && argtypes[1] == 'Z';
if (!(is_destructor || is_full_physname_constructor || is_v3))
@@ -3995,7 +3995,7 @@ stab_demangle_function_name (struct stab_demangle_info *minfo,
*pp = scan + 2;
if (*pp - name >= 5
- && CONST_STRNEQ (name, "type")
+ && startswith (name, "type")
&& (name[4] == '$' || name[4] == '.'))
{
const char *tem;