/* BFD support for handling relocation entries.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
Written by Cygnus Support.
bfd_get_reloc_size
SYNOPSIS
- int bfd_get_reloc_size (reloc_howto_type *);
+ unsigned int bfd_get_reloc_size (reloc_howto_type *);
DESCRIPTION
For a reloc_howto_type that operates on a fixed number of bytes,
this returns the number of bytes operated on.
*/
-int
+unsigned int
bfd_get_reloc_size (howto)
reloc_howto_type *howto;
{
case complain_overflow_signed:
{
/* Assumes two's complement. */
- bfd_signed_vma reloc_signed_max = (1 << (bitsize - 1)) - 1;
+ bfd_signed_vma reloc_signed_max =
+ ((bfd_signed_vma) 1 << (bitsize - 1)) - 1;
bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
/* The above right shift is incorrect for a signed value.
/* Assumes two's complement. This expression avoids
overflow if `bitsize' is the number of bits in
bfd_vma. */
- bfd_vma reloc_unsigned_max = (((1 << (bitsize - 1)) - 1) << 1) | 1;
+ bfd_vma reloc_unsigned_max =
+ ((((bfd_vma) 1 << (bitsize - 1)) - 1) << 1) | 1;
if ((bfd_vma) check > reloc_unsigned_max)
flag = bfd_reloc_overflow;
case complain_overflow_signed:
{
/* Assumes two's complement. */
- bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
+ bfd_signed_vma reloc_signed_max =
+ ((bfd_signed_vma) 1 << (howto->bitsize - 1)) - 1;
bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
if (signed_check > reloc_signed_max
overflow if howto->bitsize is the number of bits in
bfd_vma. */
bfd_vma reloc_unsigned_max =
- (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
+ ((((bfd_vma) 1 << (howto->bitsize - 1)) - 1) << 1) | 1;
if (check > reloc_unsigned_max)
overflow = true;
ENUMDOC
SPARC64 relocations
+ENUM
+ BFD_RELOC_SPARC_32LE
+ENUMDOC
+ SPARC little endian relocation
+
ENUM
BFD_RELOC_ALPHA_GPDISP_HI16
ENUMDOC
BFD_RELOC_MIPS_CALL_HI16
ENUMX
BFD_RELOC_MIPS_CALL_LO16
+COMMENT
+{* start-sanitize-r5900 *}
+ENUMX
+ BFD_RELOC_MIPS15_S3
+COMMENT
+{* end-sanitize-r5900 *}
ENUMDOC
MIPS ELF relocations.
+COMMENT
+{* start-sanitize-sky *}
+ENUM
+ BFD_RELOC_MIPS_DVP_11_PCREL
+ENUMDOC
+ MIPS DVP Relocations.
+ This is an 11-bit pc relative reloc. The recorded address is for the
+ lower instruction word, and the value is in 128 bit units.
+ENUM
+ BFD_RELOC_MIPS_DVP_27_S4
+ENUMDOC
+ This is a 27 bit address left shifted by 4.
+ENUM
+ BFD_RELOC_MIPS_DVP_11_S4
+ENUMDOC
+ This is the 11 bit offset operand of ilw/stw instructions
+ left shifted by 4.
+ENUM
+ BFD_RELOC_MIPS_DVP_U15_S3
+ENUMDOC
+ This is the 15 bit unsigned immediate operand of the iaddiu instruction
+ left shifted by 3.
+COMMENT
+{* end-sanitize-sky *}
+
ENUM
BFD_RELOC_386_GOT32
ENUMX
stored in the instruction. The high 24 bits are installed in bits 23
through 0.
-COMMENT
ENUM
BFD_RELOC_D10V_10_PCREL_R
ENUMDOC
ENUMDOC
This is an 18-bit reloc with the right 2 bits
assumed to be 0.
-COMMENT
-COMMENT
-{* start-sanitize-d30v *}
ENUM
BFD_RELOC_D30V_6
ENUMDOC
BFD_RELOC_D30V_32_PCREL
ENUMDOC
This is a 32-bit pc-relative reloc.
-COMMENT
-{* end-sanitize-d30v *}
ENUM
BFD_RELOC_M32R_24
This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
instruction.
-COMMENT
-{* start-sanitize-sky *}
ENUM
- BFD_RELOC_TXVU_11_PCREL
+ BFD_RELOC_TIC30_LDP
ENUMDOC
- SKY TXVU Relocations.
- This is an 11-bit pc relative reloc. The recorded address is for the
- lower instruction word.
-COMMENT
-{* end-sanitize-sky *}
+ This is a 8bit DP reloc for the tms320c30, where the most
+ significant 8 bits of a 24 bit word are placed into the least
+ significant 8 bits of the opcode.
+
+ENUM
+ BFD_RELOC_VTABLE_INHERIT
+ENUMX
+ BFD_RELOC_VTABLE_ENTRY
+ENUMDOC
+ These two relocations are used by the linker to determine which of
+ the entries in a C++ virtual function table are actually used. When
+ the --gc-sections option is given, the linker will zero out the entries
+ that are not used, so that the code for those functions need not be
+ included in the output.
+
+ VTABLE_INHERIT is a zero-space relocation used to describe to the
+ linker the inheritence tree of a C++ virtual function table. The
+ relocation's symbol should be the parent class' vtable, and the
+ relocation should be located at the child vtable.
+
+ VTABLE_ENTRY is a zero-space relocation that describes the use of a
+ virtual function table entry. The reloc's symbol should refer to the
+ table of the class mentioned in the code. Off of that base, an offset
+ describes the entry that is being used. For Rela hosts, this offset
+ is stored in the reloc's addend. For Rel hosts, we are forced to put
+ this offset in the reloc's section offset.
ENDSENUM
BFD_RELOC_UNUSED
return true;
}
+/*
+INTERNAL_FUNCTION
+ bfd_generic_gc_sections
+
+SYNOPSIS
+ boolean bfd_generic_gc_sections
+ (bfd *, struct bfd_link_info *);
+
+DESCRIPTION
+ Provides default handling for relaxing for back ends which
+ don't do section gc -- i.e., does nothing.
+*/
+
+/*ARGSUSED*/
+boolean
+bfd_generic_gc_sections (abfd, link_info)
+ bfd *abfd;
+ struct bfd_link_info *link_info;
+{
+ return true;
+}
+
/*
INTERNAL_FUNCTION
bfd_generic_get_relocated_section_contents