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/elf64-alpha.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bfd/elf64-alpha.c') diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 0823f5c..f37a317 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1901,7 +1901,7 @@ elf64_alpha_check_relocs (bfd *abfd, struct bfd_link_info *info, if (rel_sec_name == NULL) return FALSE; - BFD_ASSERT (strncmp (rel_sec_name, ".rela", 5) == 0 + BFD_ASSERT (CONST_STRNEQ (rel_sec_name, ".rela") && strcmp (bfd_get_section_name (abfd, sec), rel_sec_name+5) == 0); } @@ -2761,7 +2761,7 @@ elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, of the dynobj section names depend upon the input files. */ name = bfd_get_section_name (dynobj, s); - if (strncmp (name, ".rela", 5) == 0) + if (CONST_STRNEQ (name, ".rela")) { if (s->size != 0) { @@ -2773,7 +2773,7 @@ elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, s->reloc_count = 0; } } - else if (strncmp (name, ".got", 4) != 0 + else if (! CONST_STRNEQ (name, ".got") && strcmp (name, ".plt") != 0 && strcmp (name, ".dynbss") != 0) { @@ -5148,9 +5148,9 @@ elf64_alpha_reloc_type_class (const Elf_Internal_Rela *rela) static const struct bfd_elf_special_section elf64_alpha_special_sections[] = { - { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, - { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, - { NULL, 0, 0, 0, 0 } + { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, + { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, + { NULL, 0, 0, 0, 0 } }; /* ECOFF swapping routines. These are used when dealing with the -- cgit v1.1