/* BFD support for handling relocation entries.
- Copyright (C) 1990, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
type which modifies the bottom two bytes of a four byte word
would not touch the first byte pointed to in a big endian
world.
-
+
o <<addend>>
The <<addend>> is a value provided by the back end to be added (!)
case 2: return 4;
case 3: return 0;
case 4: return 8;
+ case 8: return 16;
case -2: return 4;
default: abort ();
}
break;
case 1:
- if (relocation)
- {
- short x = bfd_get_16 (abfd, (bfd_byte *) data + addr);
- DOIT (x);
- bfd_put_16 (abfd, x, (unsigned char *) data + addr);
- }
+ {
+ short x = bfd_get_16 (abfd, (bfd_byte *) data + addr);
+ DOIT (x);
+ bfd_put_16 (abfd, x, (unsigned char *) data + addr);
+ }
break;
case 2:
- if (relocation)
- {
- long x = bfd_get_32 (abfd, (bfd_byte *) data + addr);
- DOIT (x);
- bfd_put_32 (abfd, x, (bfd_byte *) data + addr);
- }
+ {
+ long x = bfd_get_32 (abfd, (bfd_byte *) data + addr);
+ DOIT (x);
+ bfd_put_32 (abfd, x, (bfd_byte *) data + addr);
+ }
break;
case -2:
{
case 4:
#ifdef BFD64
- if (relocation)
- {
- bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data + addr);
- DOIT (x);
- bfd_put_64 (abfd, x, (bfd_byte *) data + addr);
- }
+ {
+ bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data + addr);
+ DOIT (x);
+ bfd_put_64 (abfd, x, (bfd_byte *) data + addr);
+ }
#else
abort ();
#endif
{
/* This is a partial relocation, but inplace, so modify the
reloc record a bit.
-
+
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?? */
if (abfd->xvec->flavour == bfd_target_coff_flavour
&& strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0
/* For m68k-coff, the addend was being subtracted twice during
relocation with -r. Removing the line below this comment
fixes that problem; see PR 2953.
-
+
However, Ian wrote the following, regarding removing the line below,
which explains why it is still enabled: --djm
-
+
If you put a patch like that into BFD you need to check all the COFF
linkers. I am fairly certain that patch will break coff-i386 (e.g.,
SCO); see coff_i386_reloc in coff-i386.c where I worked around the
break;
case 1:
- if (relocation)
- {
- short x = bfd_get_16 (abfd, (bfd_byte *) data);
- DOIT (x);
- bfd_put_16 (abfd, x, (unsigned char *) data);
- }
+ {
+ short x = bfd_get_16 (abfd, (bfd_byte *) data);
+ DOIT (x);
+ bfd_put_16 (abfd, x, (unsigned char *) data);
+ }
break;
case 2:
- if (relocation)
- {
- long x = bfd_get_32 (abfd, (bfd_byte *) data);
- DOIT (x);
- bfd_put_32 (abfd, x, (bfd_byte *) data);
- }
+ {
+ long x = bfd_get_32 (abfd, (bfd_byte *) data);
+ DOIT (x);
+ bfd_put_32 (abfd, x, (bfd_byte *) data);
+ }
break;
case -2:
{
break;
case 4:
- if (relocation)
- {
- bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data);
- DOIT (x);
- bfd_put_64 (abfd, x, (bfd_byte *) data);
- }
+ {
+ bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data);
+ DOIT (x);
+ bfd_put_64 (abfd, x, (bfd_byte *) data);
+ }
break;
default:
return bfd_reloc_other;
decided relatively late.
-ENUM
- BFD_RELOC_SWREL32
-ENUMX
- BFD_RELOC_SWREL64
-ENUMDOC
- For openVMS/Alpha systems, these are displacements for switch
-tables.
-
-
ENUM
BFD_RELOC_I960_CALLJ
ENUMDOC
ENUM
BFD_RELOC_ALPHA_LITERAL
+ENUMX
+ BFD_RELOC_ALPHA_ELF_LITERAL
ENUMX
BFD_RELOC_ALPHA_LITUSE
ENUMDOC
in with the file's GP value on reading, for convenience, as with the
GPDISP_LO16 reloc.
+ The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
+ It should refer to the symbol to be referenced, as with 16_GOTOFF,
+ but it generates output not based on the position within the .got
+ section, but relative to the GP value chosen for the file during the
+ final link stage.
+
The LITUSE reloc, on the instruction using the loaded address, gives
information to the linker that it might be able to use to optimize
away some literal section references. The symbol is ignored (read
ENUM
BFD_RELOC_ALPHA_LINKAGE
ENUMDOC
- The LINKAGE relocation outputs a special code in the object file,
- the rest is handled by the linker.
-
-ENUM
- BFD_RELOC_ALPHA_BASEREG
-ENUMDOC
- The BASEREG relocation calculates differences to basereg.
+ The LINKAGE relocation outputs a linkage pair in the object file,
+ which is filled by the linker.
ENUM
BFD_RELOC_MIPS_JMP
BFD_RELOC_ARM_OFFSET_IMM8
ENUMX
BFD_RELOC_ARM_HWLITERAL
+ENUMX
+ BFD_RELOC_ARM_THUMB_ADD
+ENUMX
+ BFD_RELOC_ARM_THUMB_IMM
+ENUMX
+ BFD_RELOC_ARM_THUMB_SHIFT
+ENUMX
+ BFD_RELOC_ARM_THUMB_OFFSET
ENUMDOC
These relocs are only used within the ARM assembler. They are not
(at present) written to any object files.
+ENUM
+ BFD_RELOC_SH_PCDISP8BY2
+ENUMX
+ BFD_RELOC_SH_PCDISP12BY2
+ENUMX
+ BFD_RELOC_SH_IMM4
+ENUMX
+ BFD_RELOC_SH_IMM4BY2
+ENUMX
+ BFD_RELOC_SH_IMM4BY4
+ENUMX
+ BFD_RELOC_SH_IMM8
+ENUMX
+ BFD_RELOC_SH_IMM8BY2
+ENUMX
+ BFD_RELOC_SH_IMM8BY4
+ENUMX
+ BFD_RELOC_SH_PCRELIMM8BY2
+ENUMX
+ BFD_RELOC_SH_PCRELIMM8BY4
+ENUMX
+ BFD_RELOC_SH_SWITCH16
+ENUMX
+ BFD_RELOC_SH_SWITCH32
+ENUMX
+ BFD_RELOC_SH_USES
+ENUMX
+ BFD_RELOC_SH_COUNT
+ENUMX
+ BFD_RELOC_SH_ALIGN
+ENUMX
+ BFD_RELOC_SH_CODE
+ENUMX
+ BFD_RELOC_SH_DATA
+ENUMX
+ BFD_RELOC_SH_LABEL
+ENUMDOC
+ Hitachi SH relocs. Not all of these appear in object files.
+
COMMENT
{* start-sanitize-arc *}
ENUM
COMMENT
{* end-sanitize-d10v *}
+COMMENT
+{* start-sanitize-m32r *}
+ENUM
+ BFD_RELOC_M32R_UIMM24
+ENUMDOC
+ Mitsubishi M32R relocs.
+ This is a 24 bit address.
+ENUM
+ BFD_RELOC_M32R_DISP8
+ENUMDOC
+ This is a 10-bit reloc with the right 2 bits assumed to be 0.
+ENUM
+ BFD_RELOC_M32R_DISP16
+ENUMDOC
+ This is an 18-bit reloc with the right 2 bits assumed to be 0.
+ENUM
+ BFD_RELOC_M32R_DISP24
+ENUMDOC
+ This is an 26-bit reloc with the right 2 bits assumed to be 0.
+COMMENT
+{* end-sanitize-m32r *}
+
+COMMENT
+{* start-sanitize-v850 *}
+ENUM
+ BFD_RELOC_V850_9_PCREL
+ENUMDOC
+ This is a 9-bit reloc
+ENUM
+ BFD_RELOC_V850_22_PCREL
+ENUMDOC
+ This is a 22-bit reloc
+ENUM
+ BFD_RELOC_V850_SDA_OFFSET
+ENUMDOC
+ This is an offset from the short data area pointer..
+ENUM
+ BFD_RELOC_V850_ZDA_OFFSET
+ENUMDOC
+ This is an offset from the zero data area pointer..
+ENUM
+ BFD_RELOC_V850_TDA_OFFSET
+ENUMDOC
+ This is an offset from the tiny data area pointer..
+COMMENT
+{* end-sanitize-v850 *}
+
ENDSENUM
BFD_RELOC_UNUSED
CODE_FRAGMENT