diff options
author | Martin Liska <mliska@suse.cz> | 2021-03-22 14:56:16 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2021-04-01 15:00:56 +0200 |
commit | e9b095a538c189369b4792662ea455d2314b0492 (patch) | |
tree | 8a6918add18cd366abcee7964b40605471ce18df /bfd | |
parent | d34049e8bb32ae2dd717dbac88dbcebefe2d6c09 (diff) | |
download | fsf-binutils-gdb-e9b095a538c189369b4792662ea455d2314b0492.zip fsf-binutils-gdb-e9b095a538c189369b4792662ea455d2314b0492.tar.gz fsf-binutils-gdb-e9b095a538c189369b4792662ea455d2314b0492.tar.bz2 |
Remove strneq macro and use startswith.
bfd/ChangeLog:
* ecoff.c (strneq): Remove strneq and use startswith.
(_bfd_ecoff_slurp_armap): Likewise.
binutils/ChangeLog:
* elfcomm.h (strneq): Remove strneq and use startswith.
* readelf.c (ia64_process_unwind): Likewise.
(process_note): Likewise.
gas/ChangeLog:
* config/obj-coff.c (strneq): Remove strneq and use startswith.
(weak_is_altname): Likewise.
(obj_coff_section): Likewise.
* config/tc-cr16.c (process_label_constant): Likewise.
* config/tc-crx.c (strneq): Likewise.
include/ChangeLog:
* opcode/cr16.h (strneq): Remove strneq and use startswith.
ld/ChangeLog:
* ldbuildid.c (strneq): Remove strneq and use startswith.
(validate_build_id_style): Likewise.
(compute_build_id_size): Likewise.
opcodes/ChangeLog:
* arm-dis.c (strneq): Remove strneq and use startswith.
* cr16-dis.c (print_insn_cr16): Likewise.
* score-dis.c (streq): Likewise.
(strneq): Likewise.
* score7-dis.c (strneq): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/ecoff.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index aa62c92..4977dc9 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2021-04-01 Martin Liska <mliska@suse.cz> + * ecoff.c (strneq): Remove strneq and use startswith. + (_bfd_ecoff_slurp_armap): Likewise. + +2021-04-01 Martin Liska <mliska@suse.cz> + * elf-bfd.h (bfd_section_is_ctf): Use startswith function. * elf.c (_bfd_elf_make_section_from_shdr): Likewise. (elf_get_reloc_section): Likewise. diff --git a/bfd/ecoff.c b/bfd/ecoff.c index f09fc1d..7844a50 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -46,7 +46,6 @@ #include "libiberty.h" #define streq(a, b) (strcmp ((a), (b)) == 0) -#define strneq(a, b, n) (strncmp ((a), (b), (n)) == 0) /* This stuff is somewhat copied from coffcode.h. */ @@ -2870,14 +2869,14 @@ _bfd_ecoff_slurp_armap (bfd *abfd) return bfd_slurp_armap (abfd); /* See if the first element is an armap. */ - if (! strneq (nextname, ecoff_backend (abfd)->armap_start, ARMAP_START_LENGTH) + if (strncmp (nextname, ecoff_backend (abfd)->armap_start, ARMAP_START_LENGTH) != 0 || nextname[ARMAP_HEADER_MARKER_INDEX] != ARMAP_MARKER || (nextname[ARMAP_HEADER_ENDIAN_INDEX] != ARMAP_BIG_ENDIAN && nextname[ARMAP_HEADER_ENDIAN_INDEX] != ARMAP_LITTLE_ENDIAN) || nextname[ARMAP_OBJECT_MARKER_INDEX] != ARMAP_MARKER || (nextname[ARMAP_OBJECT_ENDIAN_INDEX] != ARMAP_BIG_ENDIAN && nextname[ARMAP_OBJECT_ENDIAN_INDEX] != ARMAP_LITTLE_ENDIAN) - || ! strneq (nextname + ARMAP_END_INDEX, ARMAP_END, sizeof ARMAP_END - 1)) + || strncmp (nextname + ARMAP_END_INDEX, ARMAP_END, sizeof ARMAP_END - 1) != 0) { abfd->has_armap = false; return true; |