/* BFD support for handling relocation entries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
.
.typedef enum bfd_reloc_status
.{
-. {* No errors detected *}
+. {* No errors detected. *}
. bfd_reloc_ok,
.
-. {* The relocation was performed, but there was an overflow. *}
+. {* The relocation was performed, but there was an overflow. *}
. bfd_reloc_overflow,
.
-. {* The address to relocate was not within the section supplied. *}
+. {* The address to relocate was not within the section supplied. *}
. bfd_reloc_outofrange,
.
-. {* Used by special functions *}
+. {* Used by special functions. *}
. bfd_reloc_continue,
.
-. {* Unsupported relocation size requested. *}
+. {* Unsupported relocation size requested. *}
. bfd_reloc_notsupported,
.
-. {* Unused *}
+. {* Unused. *}
. bfd_reloc_other,
.
-. {* The symbol to relocate against was undefined. *}
+. {* The symbol to relocate against was undefined. *}
. bfd_reloc_undefined,
.
. {* The relocation was performed, but may not be ok - presently
.
.typedef struct reloc_cache_entry
.{
-. {* A pointer into the canonical table of pointers *}
+. {* A pointer into the canonical table of pointers. *}
. struct symbol_cache_entry **sym_ptr_ptr;
.
-. {* offset in section *}
+. {* offset in section. *}
. bfd_size_type address;
.
-. {* addend for relocation value *}
+. {* addend for relocation value. *}
. bfd_vma addend;
.
-. {* Pointer to how to perform the required relocation *}
+. {* Pointer to how to perform the required relocation. *}
. reloc_howto_type *howto;
.
-.} arelent;
-
+.}
+.arelent;
+.
*/
/*
.
.enum complain_overflow
.{
-. {* Do not complain on overflow. *}
+. {* Do not complain on overflow. *}
. complain_overflow_dont,
.
. {* Complain if the bitfield overflows, whether it is considered
-. as signed or unsigned. *}
+. as signed or unsigned. *}
. complain_overflow_bitfield,
.
. {* Complain if the value overflows when considered as signed
-. number. *}
+. number. *}
. complain_overflow_signed,
.
. {* Complain if the value overflows when considered as an
-. unsigned number. *}
+. unsigned number. *}
. complain_overflow_unsigned
.};
information that libbfd needs to know to tie up a back end's data.
CODE_FRAGMENT
-.struct symbol_cache_entry; {* Forward declaration *}
+.struct symbol_cache_entry; {* Forward declaration. *}
.
.struct reloc_howto_struct
.{
. empty (e.g., m88k bcs); this flag signals the fact. *}
. boolean pcrel_offset;
.};
-
+.
*/
/*
. } \
. } \
. }
-
+.
*/
/*
.{
. arelent relent;
. struct relent_chain *next;
-.} arelent_chain;
-
+.}
+.arelent_chain;
+.
*/
/* N_ONES produces N one bits, without overflowing machine arithmetic. */
bfd_arch_bits_per_address (abfd),
relocation);
- /*
- Either we are relocating all the way, or we don't want to apply
- the relocation to the reloc entry (probably because there isn't
- any room in the output format to describe addends to relocs)
- */
+ /* Either we are relocating all the way, or we don't want to apply
+ the relocation to the reloc entry (probably because there isn't
+ any room in the output format to describe addends to relocs). */
/* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler
(OSF version 1.3, compiler version 3.11). It miscompiles the
relocation >>= (bfd_vma) howto->rightshift;
- /* Shift everything up to where it's going to be used */
-
+ /* Shift everything up to where it's going to be used. */
relocation <<= (bfd_vma) howto->bitpos;
- /* Wait for the day when all have the mask in them */
+ /* Wait for the day when all have the mask in them. */
/* What we do:
i instruction to be left alone
For now, this function should be considered reserved for the
assembler.
-
*/
bfd_reloc_status_type
If we've relocated with a symbol with a section, change
into a ref to the section belonging to the symbol. */
-
reloc_entry->address += input_section->output_offset;
/* WTF?? */
6) if the resulting object files are the same, you have at least
made it no worse
7) if they are different you have to figure out which version is
- right
-*/
+ right. */
relocation -= reloc_entry->addend;
#endif
reloc_entry->addend = 0;
bfd_arch_bits_per_address (abfd),
relocation);
- /*
- Either we are relocating all the way, or we don't want to apply
- the relocation to the reloc entry (probably because there isn't
- any room in the output format to describe addends to relocs)
- */
+ /* Either we are relocating all the way, or we don't want to apply
+ the relocation to the reloc entry (probably because there isn't
+ any room in the output format to describe addends to relocs). */
/* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler
(OSF version 1.3, compiler version 3.11). It miscompiles the
relocation >>= (bfd_vma) howto->rightshift;
- /* Shift everything up to where it's going to be used */
-
+ /* Shift everything up to where it's going to be used. */
relocation <<= (bfd_vma) howto->bitpos;
- /* Wait for the day when all have the mask in them */
+ /* Wait for the day when all have the mask in them. */
/* What we do:
i instruction to be left alone
The GPREL_HI/LO relocations together form a 32-bit offset from the
GP register.
+ENUM
+ BFD_RELOC_ALPHA_BRSGP
+ENUMDOC
+ Like BFD_RELOC_23_PCREL_S2, except that the source and target must
+ share a common GP, and the target address is adjusted for
+ STO_ALPHA_STD_GPLOAD.
+
+ENUM
+ BFD_RELOC_ALPHA_TLSGD
+ENUMX
+ BFD_RELOC_ALPHA_TLSLDM
+ENUMX
+ BFD_RELOC_ALPHA_DTPMOD64
+ENUMX
+ BFD_RELOC_ALPHA_GOTDTPREL16
+ENUMX
+ BFD_RELOC_ALPHA_DTPREL64
+ENUMX
+ BFD_RELOC_ALPHA_DTPREL_HI16
+ENUMX
+ BFD_RELOC_ALPHA_DTPREL_LO16
+ENUMX
+ BFD_RELOC_ALPHA_DTPREL16
+ENUMX
+ BFD_RELOC_ALPHA_GOTTPREL16
+ENUMX
+ BFD_RELOC_ALPHA_TPREL64
+ENUMX
+ BFD_RELOC_ALPHA_TPREL_HI16
+ENUMX
+ BFD_RELOC_ALPHA_TPREL_LO16
+ENUMX
+ BFD_RELOC_ALPHA_TPREL16
+ENUMDOC
+ Alpha thread-local storage relocations.
+
ENUM
BFD_RELOC_MIPS_JMP
ENUMDOC
ENUMX
BFD_RELOC_MIPS_JALR
COMMENT
+COMMENT
ENUMDOC
MIPS ELF relocations.
BFD_RELOC_386_GOTOFF
ENUMX
BFD_RELOC_386_GOTPC
+ENUMX
+ BFD_RELOC_386_TLS_LE
+ENUMX
+ BFD_RELOC_386_TLS_GD
+ENUMX
+ BFD_RELOC_386_TLS_LDM
+ENUMX
+ BFD_RELOC_386_TLS_LDO_32
+ENUMX
+ BFD_RELOC_386_TLS_IE_32
+ENUMX
+ BFD_RELOC_386_TLS_LE_32
+ENUMX
+ B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_GOTPLT10BY8
+ENUMX
+ BFD_RELOC_SH_GOTPLT32
+ENUMX
+ BFD_RELOC_SH_SHMEDIA_CODE
+ENUMX
+ BFD_RELOC_SH_IMMU5
+ENUMX
+ BFD_RELOC_SH_IMMS6
+ENUMX
+ BFD_RELOC_SH_IMMS6BY32
+ENUMX
+ BFD_RELOC_SH_IMMU6
+ENUMX
+ BFD_RELOC_SH_IMMS10
+ENUMX
+ BFD_RELOC_SH_IMMS10BY2
+ENUMX
+ BFD_RELOC_SH_IMMS10BY4
+ENUMX
+ BFD_RELOC_SH_IMMS10BY8
+ENUMX
+ BFD_RELOC_SH_IMMS16
+ENUMX
+ BFD_RELOC_SH_IMMU16
+ENUMX
+ BFD_RELOC_SH_IMM_LOW16
+ENUMX
+ BFD_RELOC_SH_IMM_LOW16_PCREL
+ENUMX
+ BFD_RELOC_SH_IMM_MEDLOW16
+ENUMX
+ BFD_RELOC_SH_IMM_MEDLOW16_PCREL
+ENUMX
+ BFD_RELOC_SH_IMM_MEDHI16
+ENUMX
+ BFD_RELOC_SH_IMM_MEDHI16_PCREL
+ENUMX
+ BFD_RELOC_SH_IMM_HI16
+ENUMX
+ BFD_RELOC_SH_IMM_HI16_PCREL
+ENUMX
+ BFD_RELOC_SH_PT_16
ENUMDOC
Hitachi SH relocs. Not all of these appear in object files.
ENUMDOC
This is a 32-bit pc-relative reloc.
+ENUM
+ BFD_RELOC_DLX_HI16_S
+ENUMDOC
+ DLX relocs
+ENUM
+ BFD_RELOC_DLX_LO16
+ENUMDOC
+ DLX relocs
+ENUM
+ BFD_RELOC_DLX_JMP26
+ENUMDOC
+ DLX relocs
+
ENUM
BFD_RELOC_M32R_24
ENUMDOC
BFD_RELOC_IA64_IPLTLSB
ENUMX
BFD_RELOC_IA64_COPY
+ENUMX
+ BFD_RELOC_IA64_LTOFF22X
+ENUMX
+ BFD_RELOC_IA64_LDXMOV
+ENUMX
+ BFD_RELOC_IA64_TPREL14
ENUMX
BFD_RELOC_IA64_TPREL22
+ENUMX
+ BFD_RELOC_IA64_TPREL64I
ENUMX
BFD_RELOC_IA64_TPREL64MSB
ENUMX
BFD_RELOC_IA64_TPREL64LSB
ENUMX
- BFD_RELOC_IA64_LTOFF_TP22
+ BFD_RELOC_IA64_LTOFF_TPREL22
ENUMX
- BFD_RELOC_IA64_LTOFF22X
+ BFD_RELOC_IA64_DTPMOD64MSB
ENUMX
- BFD_RELOC_IA64_LDXMOV
+ BFD_RELOC_IA64_DTPMOD64LSB
+ENUMX
+ BFD_RELOC_IA64_LTOFF_DTPMOD22
+ENUMX
+ BFD_RELOC_IA64_DTPREL14
+ENUMX
+ BFD_RELOC_IA64_DTPREL22
+ENUMX
+ BFD_RELOC_IA64_DTPREL64I
+ENUMX
+ BFD_RELOC_IA64_DTPREL32MSB
+ENUMX
+ BFD_RELOC_IA64_DTPREL32LSB
+ENUMX
+ BFD_RELOC_IA64_DTPREL64MSB
+ENUMX
+ BFD_RELOC_IA64_DTPREL64LSB
+ENUMX
+ BFD_RELOC_IA64_LTOFF_DTPREL22
ENUMDOC
Intel IA64 Relocations.
ENUMDOC
Sony Xstormy16 Relocations.
+ENUM
+ BFD_RELOC_VAX_GLOB_DAT
+ENUMX
+ BFD_RELOC_VAX_JMP_SLOT
+ENUMX
+ BFD_RELOC_VAX_RELATIVE
+ENUMDOC
+ Relocations used by VAX ELF.
+
ENDSENUM
BFD_RELOC_UNUSED
CODE_FRAGMENT
don't do relaxing -- i.e., does nothing.
*/
-/*ARGSUSED*/
boolean
bfd_generic_relax_section (abfd, section, link_info, again)
bfd *abfd ATTRIBUTE_UNUSED;
don't do section gc -- i.e., does nothing.
*/
-/*ARGSUSED*/
boolean
bfd_generic_gc_sections (abfd, link_info)
bfd *abfd ATTRIBUTE_UNUSED;
which don't have SEC_MERGE support -- i.e., does nothing.
*/
-/*ARGSUSED*/
boolean
bfd_generic_merge_sections (abfd, link_info)
bfd *abfd ATTRIBUTE_UNUSED;
boolean relocateable;
asymbol **symbols;
{
- /* Get enough memory to hold the stuff */
+ /* Get enough memory to hold the stuff. */
bfd *input_bfd = link_order->u.indirect.section->owner;
asection *input_section = link_order->u.indirect.section;
if (reloc_vector == NULL && reloc_size != 0)
goto error_return;
- /* read in the section */
+ /* Read in the section. */
if (!bfd_get_section_contents (input_bfd,
input_section,
(PTR) data,
input_section->_raw_size))
goto error_return;
- /* We're not relaxing the section, so just copy the size info */
+ /* We're not relaxing the section, so just copy the size info. */
input_section->_cooked_size = input_section->_raw_size;
input_section->reloc_done = true;
{
asection *os = input_section->output_section;
- /* A partial link, so keep the relocs */
+ /* A partial link, so keep the relocs. */
os->orelocation[os->reloc_count] = *parent;
os->reloc_count++;
}