From 0112cd268b205d8176b8b4d00988a334822956cf Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Sat, 16 Sep 2006 18:12:17 +0000 Subject: * bfd-in.h (STRING_AND_COMMA): New macro. Takes one constant string as its argument and emits the string followed by a comma and then the length of the string. (CONST_STRNEQ): New macro. Checks to see if a variable string has a constant string as its initial characters. (CONST_STRNCPY): New macro. Copies a constant string to the start of a variable string. * bfd-in2.h: Regenerate. * : Make use of the new macros. --- bfd/elf32-vax.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bfd/elf32-vax.c') diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index bf481e4..62735a6 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -738,7 +738,7 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); @@ -1194,7 +1194,7 @@ elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) /* Remember whether there is a PLT. */ plt = s->size != 0; } - else if (strncmp (name, ".rela", 5) == 0) + else if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -1226,7 +1226,7 @@ elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0 + else if (! CONST_STRNEQ (name, ".got") && strcmp (name, ".dynbss") != 0) { /* It's not one of our sections, so don't allocate space. */ @@ -1646,7 +1646,7 @@ elf_vax_relocate_section (bfd *output_bfd, if (name == NULL) return FALSE; - BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (name, ".rela") && strcmp (bfd_get_section_name (input_bfd, input_section), name + 5) == 0); -- cgit v1.1