aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-sh64.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
commit0112cd268b205d8176b8b4d00988a334822956cf (patch)
tree67d11340ff93c7dbc29c8917bc03d9d24555f43d /bfd/elf64-sh64.c
parent4fa3602bd53183badf1d259128a5f951f32db8cb (diff)
downloadgdb-0112cd268b205d8176b8b4d00988a334822956cf.zip
gdb-0112cd268b205d8176b8b4d00988a334822956cf.tar.gz
gdb-0112cd268b205d8176b8b4d00988a334822956cf.tar.bz2
* 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-sh64.c')
-rw-r--r--bfd/elf64-sh64.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index 4d6d8d5..d972fc6 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -1709,7 +1709,7 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
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);
@@ -2731,7 +2731,7 @@ sh_elf64_check_relocs (bfd *abfd, struct bfd_link_info *info,
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);
@@ -3591,7 +3591,7 @@ sh64_elf64_size_dynamic_sections (bfd *output_bfd,
/* 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)
{
@@ -3624,7 +3624,7 @@ sh64_elf64_size_dynamic_sections (bfd *output_bfd,
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. */
@@ -4070,8 +4070,8 @@ sh64_elf64_merge_symbol_attribute (struct elf_link_hash_entry *h,
static const struct bfd_elf_special_section sh64_elf64_special_sections[]=
{
- { ".cranges", 8, 0, SHT_PROGBITS, 0 },
- { NULL, 0, 0, 0, 0 }
+ { STRING_COMMA_LEN (".cranges"), 0, SHT_PROGBITS, 0 },
+ { NULL, 0, 0, 0, 0 }
};
#define TARGET_BIG_SYM bfd_elf64_sh64_vec