OSDN Git Service

Fix detection of common symbols
[pf3gnuchains/pf3gnuchains3x.git] / bfd / reloc.c
index 8885814..a0db15f 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)
            {
@@ -1944,6 +1961,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
   The HINT relocation indicates a value that should be filled into the
@@ -2028,6 +2064,14 @@ ENUMX
   BFD_RELOC_MIPS_CALL_HI16
 ENUMX
   BFD_RELOC_MIPS_CALL_LO16
+ENUMX
+  BFD_RELOC_MIPS_SUB
+ENUMX
+  BFD_RELOC_MIPS_GOT_PAGE
+ENUMX
+  BFD_RELOC_MIPS_GOT_OFST
+ENUMX
+  BFD_RELOC_MIPS_GOT_DISP
 COMMENT
 ENUMDOC
   MIPS ELF relocations.
@@ -2081,6 +2125,21 @@ 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
   BFD_RELOC_PPC_BA26
@@ -2158,6 +2217,8 @@ ENUMDOC
 ENUM
   BFD_RELOC_ARM_IMMEDIATE
 ENUMX
+  BFD_RELOC_ARM_ADRL_IMMEDIATE
+ENUMX
   BFD_RELOC_ARM_OFFSET_IMM
 ENUMX
   BFD_RELOC_ARM_SHIFT_IMM
@@ -2537,6 +2598,8 @@ ENUMX
   BFD_RELOC_MCORE_PCREL_32
 ENUMX
   BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2
+ENUMX
+  BFD_RELOC_MCORE_RVA
 ENUMDOC
   Motorola Mcore relocations.
   
@@ -2680,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;
@@ -2705,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;
 }