FreeBSD/contrib/binutils/bfd/elflink.c
/* Adjust the dynamic symbol, H, for copy in the dynamic bss section,
   DYNBSS.  */
Adjust the dynamic symbol, H, for copy in the dynamic bss section,
DYNBSS.
Adjust the dynamic symbol H for copy in the dynamic bss section DYNBSS .
bfd_boolean
_bfd_elf_adjust_dynamic_copy (struct elf_link_hash_entry *h,
			      asection *dynbss)
{
  unsigned int power_of_two;
  bfd_vma mask;
  asection *sec = h->root.u.def.section;
  power_of_two = bfd_get_section_alignment (sec->owner, sec);
  mask = ((bfd_vma) 1 << power_of_two) - 1;
  while ((h->root.u.def.value & mask) != 0)
    {
       mask >>= 1;
       --power_of_two;
    }
  if (power_of_two > bfd_get_section_alignment (dynbss->owner,
						dynbss))
    {
      if (! bfd_set_section_alignment (dynbss->owner, dynbss,
				       power_of_two))
	return FALSE;
    }
  dynbss->size = BFD_ALIGN (dynbss->size, mask + 1);
  h->root.u.def.section = dynbss;
  h->root.u.def.value = dynbss->size;
  dynbss->size += h->size;
  return TRUE;
}
bfd_boolean _bfd_elf_adjust_dynamic_copy ( struct elf_link_hash_entry * h , asection * dynbss ) { unsigned int power_of_two ; bfd_vma mask ; asection * sec = h -> root . u . def . section ; power_of_two = bfd_get_section_alignment ( sec -> owner , sec ) ; mask = ( ( bfd_vma ) 1 << power_of_two ) - 1 ; while ( ( h -> root . u . def . value & mask ) != 0 ) { mask >>= 1 ; -- power_of_two ; } if ( power_of_two > bfd_get_section_alignment ( dynbss -> owner , dynbss ) ) { if ( ! bfd_set_section_alignment ( dynbss -> owner , dynbss , power_of_two ) ) return FALSE ; } dynbss -> size = BFD_ALIGN ( dynbss -> size , mask + 1 ) ; h -> root . u . def . section = dynbss ; h -> root . u . def . value = dynbss -> size ; dynbss -> size += h -> size ; return TRUE ; }
Adjust the dynamic symbol, H, for copy in the dynamic bss section,
DYNBSS.
Adjust the dynamic symbol H for copy in the dynamic bss section DYNBSS .
/* The section aligment of definition is the maximum alignment
     requirement of symbols defined in the section.  Since we don't
     know the symbol alignment requirement, we start with the
     maximum alignment and check low bits of the symbol address
     for the minimum alignment.  */ /* Adjust the section alignment if needed.  */ /* We make sure that the symbol will be aligned properly.  */ /* Define the symbol as being at this point in DYNBSS.  */ /* Increment the size of DYNBSS to make room for the symbol.  */