bfd/ * elflink.c (is_reloc_section): Remove function. (get_dynamic_reloc_section_name): Construct string manually. Index: bfd/elflink.c =================================================================== --- bfd/elflink.c (revision 307279) +++ bfd/elflink.c (working copy) @@ -12542,20 +12542,6 @@ _bfd_elf_default_got_elt_size (bfd *abfd /* Routines to support the creation of dynamic relocs. */ -/* Return true if NAME is a name of a relocation - section associated with section S. */ - -static bfd_boolean -is_reloc_section (bfd_boolean rela, const char * name, asection * s) -{ - if (rela) - return CONST_STRNEQ (name, ".rela") - && strcmp (bfd_get_section_name (NULL, s), name + 5) == 0; - - return CONST_STRNEQ (name, ".rel") - && strcmp (bfd_get_section_name (NULL, s), name + 4) == 0; -} - /* Returns the name of the dynamic reloc section associated with SEC. */ static const char * @@ -12563,26 +12549,19 @@ get_dynamic_reloc_section_name (bfd * asection * sec, bfd_boolean is_rela) { - const char * name; - unsigned int strndx = elf_elfheader (abfd)->e_shstrndx; - unsigned int shnam = _bfd_elf_single_rel_hdr (sec)->sh_name; + char *name; + const char *old_name = bfd_get_section_name (NULL, sec); - name = bfd_elf_string_from_elf_section (abfd, strndx, shnam); - if (name == NULL) + if (old_name == NULL) return NULL; - if (! is_reloc_section (is_rela, name, sec)) - { - static bfd_boolean complained = FALSE; + name = bfd_alloc (abfd, (is_rela ? 6 : 5) + strlen (old_name)); - if (! complained) - { - (*_bfd_error_handler) - (_("%B: bad relocation section name `%s\'"), abfd, name); - complained = TRUE; - } - name = NULL; - } + if (is_rela) + strcpy (name, ".rela"); + else + strcpy (name, ".rel"); + strcat (name, old_name); return name; }