forked from Imagelibrary/binutils-gdb
* 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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user