2003-10-22 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / bfd / reloc.c
index e50eb11bc4e09d1c240474066f67ee036de43a04..5e3a59255495090a68253f91ac6b86eff6d951c5 100644 (file)
@@ -122,15 +122,16 @@ DESCRIPTION
         o <<sym_ptr_ptr>>
 
         The symbol table pointer points to a pointer to the symbol
-        associated with the relocation request.  It is
-        the pointer into the table returned by the back end's
-        <<get_symtab>> action. @xref{Symbols}. The symbol is referenced
-        through a pointer to a pointer so that tools like the linker
-        can fix up all the symbols of the same name by modifying only
-        one pointer. The relocation routine looks in the symbol and
-        uses the base of the section the symbol is attached to and the
-        value of the symbol as the initial relocation offset. If the
-        symbol pointer is zero, then the section provided is looked up.
+        associated with the relocation request.  It is the pointer
+        into the table returned by the back end's
+        <<canonicalize_symtab>> action. @xref{Symbols}. The symbol is
+        referenced through a pointer to a pointer so that tools like
+        the linker can fix up all the symbols of the same name by
+        modifying only one pointer. The relocation routine looks in
+        the symbol and uses the base of the section the symbol is
+        attached to and the value of the symbol as the initial
+        relocation offset. If the symbol pointer is zero, then the
+        section provided is looked up.
 
         o <<address>>
 
@@ -2116,7 +2117,10 @@ ENUMX
   BFD_RELOC_MIPS_RELGOT
 ENUMX
   BFD_RELOC_MIPS_JALR
+ENUMDOC
+  MIPS ELF relocations.
 COMMENT
+
 ENUM
   BFD_RELOC_FRV_LABEL16
 ENUMX
@@ -2138,10 +2142,42 @@ ENUMX
 ENUMDOC
   Fujitsu Frv Relocations.
 COMMENT
-COMMENT
-ENUMDOC
-  MIPS ELF relocations.
 
+ENUM
+  BFD_RELOC_MN10300_GOTOFF24
+ENUMDOC
+  This is a 24bit GOT-relative reloc for the mn10300.
+ENUM
+  BFD_RELOC_MN10300_GOT32
+ENUMDOC
+  This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
+  in the instruction.
+ENUM
+  BFD_RELOC_MN10300_GOT24
+ENUMDOC
+  This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
+  in the instruction.
+ENUM
+  BFD_RELOC_MN10300_GOT16
+ENUMDOC
+  This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
+  in the instruction.
+ENUM
+  BFD_RELOC_MN10300_COPY
+ENUMDOC
+  Copy symbol at runtime.
+ENUM
+  BFD_RELOC_MN10300_GLOB_DAT
+ENUMDOC
+  Create GOT entry.
+ENUM
+  BFD_RELOC_MN10300_JMP_SLOT
+ENUMDOC
+  Create PLT entry.
+ENUM
+  BFD_RELOC_MN10300_RELATIVE
+ENUMDOC
+  Adjust by program base.
 COMMENT
 
 ENUM
@@ -3097,6 +3133,8 @@ ENUMX
   BFD_RELOC_MMIX_PUSHJ_2
 ENUMX
   BFD_RELOC_MMIX_PUSHJ_3
+ENUMX
+  BFD_RELOC_MMIX_PUSHJ_STUBBABLE
 ENUMDOC
   These are relocations for the PUSHJ instruction.
 ENUM
@@ -3994,7 +4032,8 @@ SYNOPSIS
 
 DESCRIPTION
        Provides default handling for relaxing for back ends which
-       don't do relaxing -- i.e., does nothing.
+       don't do relaxing -- i.e., does nothing except make sure that the
+       final size of the section is set.
 */
 
 bfd_boolean
@@ -4003,6 +4042,11 @@ bfd_generic_relax_section (bfd *abfd ATTRIBUTE_UNUSED,
                           struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
                           bfd_boolean *again)
 {
+  /* We're not relaxing the section, so just copy the size info if it's
+     zero.  Someone else, like bfd_merge_sections, might have set it, so
+     don't overwrite a non-zero value.  */
+  if (section->_cooked_size == 0)
+    section->_cooked_size = section->_raw_size;
   *again = FALSE;
   return TRUE;
 }
@@ -4097,8 +4141,13 @@ bfd_generic_get_relocated_section_contents (bfd *abfd,
                                 input_section->_raw_size))
     goto error_return;
 
-  /* We're not relaxing the section, so just copy the size info.  */
-  input_section->_cooked_size = input_section->_raw_size;
+  /* Don't set input_section->_cooked_size here.  The caller has set
+     _cooked_size or called bfd_relax_section, which sets _cooked_size.
+     Despite using this generic relocation function, some targets perform
+     target-specific relaxation or string merging, which happens before
+     this function is called.  We do not want to clobber the _cooked_size
+     they computed.  */
+
   input_section->reloc_done = TRUE;
 
   reloc_count = bfd_canonicalize_reloc (input_bfd,
This page took 0.024842 seconds and 4 git commands to generate.