FreeBSD/contrib/binutils/bfd/elf.c
/* Initialize private output section information from input section.  */
Initialize private output section information from input section.
Initialize private output section information from input section .
bfd_boolean
_bfd_elf_init_private_section_data (bfd *ibfd,
				    asection *isec,
				    bfd *obfd,
				    asection *osec,
				    struct bfd_link_info *link_info)
{
  Elf_Internal_Shdr *ihdr, *ohdr;
  bfd_boolean need_group = link_info == NULL || link_info->relocatable;
  if (ibfd->xvec->flavour != bfd_target_elf_flavour
      || obfd->xvec->flavour != bfd_target_elf_flavour)
    return TRUE;
  if (elf_section_type (osec) == SHT_NULL
      && (osec->flags == isec->flags || !osec->flags))
    elf_section_type (osec) = elf_section_type (isec);
  elf_section_flags (osec) |= (elf_section_flags (isec)
			       & (SHF_MASKOS | SHF_MASKPROC));
  if (need_group)
    {
      if (elf_sec_group (isec) == NULL
	  || (elf_sec_group (isec)->flags & SEC_LINKER_CREATED) == 0)
	{
	  if (elf_section_flags (isec) & SHF_GROUP)
	    elf_section_flags (osec) |= SHF_GROUP;
	  elf_next_in_group (osec) = elf_next_in_group (isec);
	  elf_group_name (osec) = elf_group_name (isec);
	}
    }
  ihdr = &elf_section_data (isec)->this_hdr;
  if ((ihdr->sh_flags & SHF_LINK_ORDER) != 0)
    {
      ohdr = &elf_section_data (osec)->this_hdr;
      ohdr->sh_flags |= SHF_LINK_ORDER;
      elf_linked_to_section (osec) = elf_linked_to_section (isec);
    }
  osec->use_rela_p = isec->use_rela_p;
  return TRUE;
}
bfd_boolean _bfd_elf_init_private_section_data ( bfd * ibfd , asection * isec , bfd * obfd , asection * osec , struct bfd_link_info * link_info ) { Elf_Internal_Shdr * ihdr , * ohdr ; bfd_boolean need_group = link_info == NULL || link_info -> relocatable ; if ( ibfd -> xvec -> flavour != bfd_target_elf_flavour || obfd -> xvec -> flavour != bfd_target_elf_flavour ) return TRUE ; if ( elf_section_type ( osec ) == SHT_NULL && ( osec -> flags == isec -> flags || ! osec -> flags ) ) elf_section_type ( osec ) = elf_section_type ( isec ) ; elf_section_flags ( osec ) |= ( elf_section_flags ( isec ) & ( SHF_MASKOS | SHF_MASKPROC ) ) ; if ( need_group ) { if ( elf_sec_group ( isec ) == NULL || ( elf_sec_group ( isec ) -> flags & SEC_LINKER_CREATED ) == 0 ) { if ( elf_section_flags ( isec ) & SHF_GROUP ) elf_section_flags ( osec ) |= SHF_GROUP ; elf_next_in_group ( osec ) = elf_next_in_group ( isec ) ; elf_group_name ( osec ) = elf_group_name ( isec ) ; } } ihdr = & elf_section_data ( isec ) -> this_hdr ; if ( ( ihdr -> sh_flags & SHF_LINK_ORDER ) != 0 ) { ohdr = & elf_section_data ( osec ) -> this_hdr ; ohdr -> sh_flags |= SHF_LINK_ORDER ; elf_linked_to_section ( osec ) = elf_linked_to_section ( isec ) ; } osec -> use_rela_p = isec -> use_rela_p ; return TRUE ; }
Initialize private output section information from input section.
Initialize private output section information from input section .
/* Don't copy the output ELF section type from input if the
     output BFD section flags have been set to something different.
     elf_fake_sections will set ELF section type based on BFD
     section flags.  */ /* FIXME: Is this correct for all OS/PROC specific flags?  */ /* Set things up for objcopy and relocatable link.  The output
     SHT_GROUP section will have its elf_next_in_group pointing back
     to the input group members.  Ignore linker created group section.
     See elfNN_ia64_object_p in elfxx-ia64.c.  */ /* We need to handle elf_linked_to_section for SHF_LINK_ORDER. We
     don't use the output section of the linked-to section since it
     may be NULL at this point.  */