summaryrefslogtreecommitdiff
path: root/bfd/elf64-alpha.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-09-16 18:12:17 +0000
committerNick Clifton <nickc@redhat.com>2006-09-16 18:12:17 +0000
commit2354bf5c588efcc10ae73e52b2150785ed8ce64e (patch)
tree38468012cc35079176a92c9d796fbeb4d353def3 /bfd/elf64-alpha.c
parenta39fb0f1949f476afb48089d2e72e180d0b57300 (diff)
downloadbinutils-redhat-2354bf5c588efcc10ae73e52b2150785ed8ce64e.tar.gz
* 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. * <remainign files>: Make use of the new macros.
Diffstat (limited to 'bfd/elf64-alpha.c')
-rw-r--r--bfd/elf64-alpha.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 0823f5c3ec..f37a3174d3 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