FreeBSD/contrib/binutils/gas/config/tc-arm.c
/* Relocations against function names must be left unadjusted,
   so that the linker can use this information to generate interworking
   stubs.  The MIPS version of this function
   also prevents relocations that are mips-16 specific, but I do not
   know why it does this.

   FIXME:
   There is one other problem that ought to be addressed here, but
   which currently is not:  Taking the address of a label (rather
   than a function) and then later jumping to that address.  Such
   addresses also ought to have their bottom bit set (assuming that
   they reside in Thumb code), but at the moment they will not.	 */
Relocations against function names must be left unadjusted,
so that the linker can use this information to generate interworking
stubs.  The MIPS version of this function
also prevents relocations that are mips-16 specific, but I do not
know why it does this.

There is one other problem that ought to be addressed here, but
which currently is not:  Taking the address of a label (rather
than a function) and then later jumping to that address.  Such
addresses also ought to have their bottom bit set (assuming that
they reside in Thumb code), but at the moment they will not.
Relocations against function names must be left unadjusted so that the linker can use this information to generate interworking stubs . The MIPS version of this function also prevents relocations that are mips - 16 specific but I do not know why it does this . There is one other problem that ought to be addressed here but which currently is not : Taking the address of a label ( rather than a function ) and then later jumping to that address . Such addresses also ought to have their bottom bit set ( assuming that they reside in Thumb code ) but at the moment they will not .
bfd_boolean
arm_fix_adjustable (fixS * fixP)
{
  if (fixP->fx_addsy == NULL)
    return 1;
  if (symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_FUNCTION)
    return 0;
  if (THUMB_IS_FUNC (fixP->fx_addsy)
      && fixP->fx_subsy == NULL)
    return 0;
  if (	 fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
      || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
    return 0;
  if (fixP->fx_r_type == BFD_RELOC_ARM_PLT32
      || fixP->fx_r_type == BFD_RELOC_ARM_GOT32
      || fixP->fx_r_type == BFD_RELOC_ARM_GOTOFF
      || fixP->fx_r_type == BFD_RELOC_ARM_TLS_GD32
      || fixP->fx_r_type == BFD_RELOC_ARM_TLS_LE32
      || fixP->fx_r_type == BFD_RELOC_ARM_TLS_IE32
      || fixP->fx_r_type == BFD_RELOC_ARM_TLS_LDM32
      || fixP->fx_r_type == BFD_RELOC_ARM_TLS_LDO32
      || fixP->fx_r_type == BFD_RELOC_ARM_TARGET2)
    return 0;
  if ((fixP->fx_r_type >= BFD_RELOC_ARM_ALU_PC_G0_NC
       && fixP->fx_r_type <= BFD_RELOC_ARM_LDC_SB_G2)
      || fixP->fx_r_type == BFD_RELOC_ARM_LDR_PC_G0)
    return 0;
  if (fixP->fx_r_type == BFD_RELOC_ARM_MOVW
      || fixP->fx_r_type == BFD_RELOC_ARM_MOVT
      || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVW
      || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVT)
    return 0;
  return 1;
}
bfd_boolean arm_fix_adjustable ( fixS * fixP ) { if ( fixP -> fx_addsy == NULL ) return 1 ; if ( symbol_get_bfdsym ( fixP -> fx_addsy ) -> flags & BSF_FUNCTION ) return 0 ; if ( THUMB_IS_FUNC ( fixP -> fx_addsy ) && fixP -> fx_subsy == NULL ) return 0 ; if ( fixP -> fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixP -> fx_r_type == BFD_RELOC_VTABLE_ENTRY ) return 0 ; if ( fixP -> fx_r_type == BFD_RELOC_ARM_PLT32 || fixP -> fx_r_type == BFD_RELOC_ARM_GOT32 || fixP -> fx_r_type == BFD_RELOC_ARM_GOTOFF || fixP -> fx_r_type == BFD_RELOC_ARM_TLS_GD32 || fixP -> fx_r_type == BFD_RELOC_ARM_TLS_LE32 || fixP -> fx_r_type == BFD_RELOC_ARM_TLS_IE32 || fixP -> fx_r_type == BFD_RELOC_ARM_TLS_LDM32 || fixP -> fx_r_type == BFD_RELOC_ARM_TLS_LDO32 || fixP -> fx_r_type == BFD_RELOC_ARM_TARGET2 ) return 0 ; if ( ( fixP -> fx_r_type >= BFD_RELOC_ARM_ALU_PC_G0_NC && fixP -> fx_r_type <= BFD_RELOC_ARM_LDC_SB_G2 ) || fixP -> fx_r_type == BFD_RELOC_ARM_LDR_PC_G0 ) return 0 ; if ( fixP -> fx_r_type == BFD_RELOC_ARM_MOVW || fixP -> fx_r_type == BFD_RELOC_ARM_MOVT || fixP -> fx_r_type == BFD_RELOC_ARM_THUMB_MOVW || fixP -> fx_r_type == BFD_RELOC_ARM_THUMB_MOVT ) return 0 ; return 1 ; }
Relocations against function names must be left unadjusted,
so that the linker can use this information to generate interworking
stubs.
Relocations against function names must be left unadjusted so that the linker can use this information to generate interworking stubs .
/* Preserve relocations against symbols with function type.  */ /* We need the symbol name for the VTABLE entries.  */ /* Don't allow symbols to be discarded on GOT related relocs.	 */ /* Similarly for group relocations.  */