Add new relocations for alpha explicit relocation support
[deliverable/binutils-gdb.git] / bfd / reloc.c
index 9e8735e5ed6db189c11bcdcc1fa6e2a4b97a54b8..a0db15f1a3b6e88ab6c45ad6bb5ba81ee8986e41 100644 (file)
@@ -389,6 +389,14 @@ DESCRIPTION
 
 .#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
 .
+
+DESCRIPTION
+       This is used to fill in an empty howto entry in an array.
+
+.#define EMPTY_HOWTO(C) \
+.  HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false)
+.
+
 DESCRIPTION
        Helper routine to turn a symbol into a relocation value.
 
@@ -1405,7 +1413,7 @@ _bfd_relocate_contents (howto, input_bfd, relocation, location)
      bfd_byte *location;
 {
   int size;
-  bfd_vma x;
+  bfd_vma x = 0;
   boolean overflow;
   unsigned int rightshift = howto->rightshift;
   unsigned int bitpos = howto->bitpos;
@@ -1560,6 +1568,15 @@ _bfd_relocate_contents (howto, input_bfd, relocation, location)
 
          /* We just assume (b & ~ fieldmask) == 0.  */
 
+         /* We explicitly permit wrap around if this relocation
+            covers the high bit of an address.  The Linux kernel
+            relies on it, and it is the only way to write assembler
+            code which can run when loaded at a location 0x80000000
+            away from the location at which it is linked.  */
+         if (howto->bitsize + rightshift
+             == bfd_arch_bits_per_address (input_bfd))
+           break;
+
          sum = a + b;
          if (sum < a || (sum & ~ fieldmask) != 0)
            {
@@ -1943,6 +1960,25 @@ ENUMDOC
 
      The GNU linker currently doesn't do any of this optimizing.
 
+ENUM
+  BFD_RELOC_ALPHA_USER_LITERAL
+ENUMX
+  BFD_RELOC_ALPHA_USER_LITUSE_BASE
+ENUMX
+  BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF
+ENUMX
+  BFD_RELOC_ALPHA_USER_LITUSE_JSR
+ENUMX
+  BFD_RELOC_ALPHA_USER_GPDISP
+ENUMX
+  BFD_RELOC_ALPHA_USER_GPRELHIGH
+ENUMX
+  BFD_RELOC_ALPHA_USER_GPRELLOW
+ENUMDOC
+  The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to
+     process the explicit !<reloc>!sequence relocations, and are mapped
+     into the normal relocations at the end of processing.
+
 ENUM
   BFD_RELOC_ALPHA_HINT
 ENUMDOC
@@ -2088,6 +2124,21 @@ ENUMX
 ENUMDOC
   ns32k relocations
 
+ENUM
+  BFD_RELOC_PJ_CODE_HI16
+ENUMX
+  BFD_RELOC_PJ_CODE_LO16
+ENUMX
+  BFD_RELOC_PJ_CODE_DIR16
+ENUMX
+  BFD_RELOC_PJ_CODE_DIR32
+ENUMX
+  BFD_RELOC_PJ_CODE_REL16
+ENUMX
+  BFD_RELOC_PJ_CODE_REL32
+ENUMDOC
+  Picojava relocs.  Not all of these appear in object files.
+  
 ENUM
   BFD_RELOC_PPC_B26
 ENUMX
@@ -2165,6 +2216,8 @@ ENUMDOC
   not stored in the instruction.
 ENUM
   BFD_RELOC_ARM_IMMEDIATE
+ENUMX
+  BFD_RELOC_ARM_ADRL_IMMEDIATE
 ENUMX
   BFD_RELOC_ARM_OFFSET_IMM
 ENUMX
@@ -2690,9 +2743,9 @@ DESCRIPTION
 /*ARGSUSED*/
 boolean
 bfd_generic_relax_section (abfd, section, link_info, again)
-     bfd *abfd;
-     asection *section;
-     struct bfd_link_info *link_info;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *section ATTRIBUTE_UNUSED;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
      boolean *again;
 {
   *again = false;
@@ -2715,8 +2768,8 @@ DESCRIPTION
 /*ARGSUSED*/
 boolean
 bfd_generic_gc_sections (abfd, link_info)
-     bfd *abfd;
-     struct bfd_link_info *link_info;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
 {
   return true;
 }
This page took 0.025689 seconds and 4 git commands to generate.