return value;
}
+/*
+FUNCTION
+ bfd_copy_private_header_data
+
+SYNOPSIS
+ bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
+
+DESCRIPTION
+ Copy private BFD header information from the BFD @var{ibfd} to the
+ the BFD @var{obfd}. This copies information that may require
+ sections to exist, but does not require symbol tables. Return
+ <<true>> on success, <<false>> on error.
+ Possible error returns are:
+
+ o <<bfd_error_no_memory>> -
+ Not enough memory exists to create private data for @var{obfd}.
+
+.#define bfd_copy_private_header_data(ibfd, obfd) \
+. BFD_SEND (obfd, _bfd_copy_private_header_data, \
+. (ibfd, obfd))
+
+*/
+
/*
FUNCTION
bfd_copy_private_bfd_data
.#define bfd_merge_sections(abfd, link_info) \
. BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
.
+.#define bfd_is_group_section(abfd, sec) \
+. BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
+.
.#define bfd_discard_group(abfd, sec) \
. BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
.
objalloc. */
bfd_hash_table_free (&preserve->section_htab);
}
+
+/*
+FUNCTION
+ bfd_get_section_ident
+
+SYNOPSIS
+ char *bfd_get_section_ident (asection *sec);
+
+DESCRIPTION
+ This function returns "section name[group name]" in a malloced
+ buffer if @var{sec} is a member of an ELF section group and
+ returns NULL otherwise. The caller should free the non-NULL
+ return after use.
+
+*/
+
+char *
+bfd_get_section_ident (asection *sec)
+{
+ char *buf;
+ bfd_size_type nlen;
+ bfd_size_type glen;
+
+ if (sec->owner == NULL
+ || bfd_get_flavour (sec->owner) != bfd_target_elf_flavour
+ || elf_next_in_group (sec) == NULL
+ || (sec->flags & SEC_GROUP) != 0)
+ return NULL;
+
+ nlen = strlen (sec->name);
+ glen = strlen (elf_group_name (sec));
+ buf = bfd_malloc (nlen + glen + 2 + 1);
+ if (buf != NULL)
+ {
+ strcpy (buf, sec->name);
+ buf [nlen] = '[';
+ strcpy (&buf [nlen + 1], elf_group_name (sec));
+ buf [nlen + 1 + glen] = ']';
+ buf [nlen + 1 + glen + 1] = '\0';
+ }
+
+ return buf;
+}