* libaout.h (machine_type): Reserve several values for sparclet.
[deliverable/binutils-gdb.git] / bfd / reloc.c
index a41860447ac21dcb0148cdd26ebfcf1280c5edad..20be20d7dce23fe7ba494a80b04fa269ed4aebe8 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
@@ -138,7 +138,7 @@ DESCRIPTION
         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 (!)
@@ -428,6 +428,7 @@ bfd_get_reloc_size (howto)
     case 2: return 4;
     case 3: return 0;
     case 4: return 8;
+    case 8: return 16;
     case -2: return 4;
     default: abort ();
     }
@@ -871,20 +872,18 @@ space consuming.  For each target:
       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:
       {
@@ -910,12 +909,11 @@ space consuming.  For each target:
 
     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
@@ -1075,12 +1073,12 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
     {
       /* 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
@@ -1092,10 +1090,10 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
 /* 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
@@ -1331,20 +1329,18 @@ space consuming.  For each target:
       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:
       {
@@ -1360,12 +1356,11 @@ space consuming.  For each target:
       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;
@@ -1800,15 +1795,6 @@ handled specially, because the value the register will have is
 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
@@ -1917,6 +1903,8 @@ ENUMDOC
 
 ENUM
   BFD_RELOC_ALPHA_LITERAL
+ENUMX
+  BFD_RELOC_ALPHA_ELF_LITERAL
 ENUMX
   BFD_RELOC_ALPHA_LITUSE
 ENUMDOC
@@ -1929,6 +1917,12 @@ 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
@@ -1950,13 +1944,8 @@ ENUMDOC
 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
@@ -2162,10 +2151,57 @@ ENUMX
   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
@@ -2213,6 +2249,53 @@ ENUMDOC
 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
This page took 0.026566 seconds and 4 git commands to generate.