* ld.texinfo: Document that fill values now use the four least
[deliverable/binutils-gdb.git] / bfd / elf32-i370.c
index 67c6964cd9f7a6fc7c707c26684f62d81233ac2c..4a43496d29d43f44c2a9e0d39fceb7e449738ff6 100644 (file)
@@ -1,5 +1,6 @@
 /* i370-specific support for 32-bit ELF
-   Copyright 1994, 95, 96, 97, 98, 2000 Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001
+   Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
    Hacked by Linas Vepstas for i370 linas@linas.org
 
@@ -19,8 +20,6 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-
-
 /* This file is based on a preliminary PowerPC ELF ABI.
    But its been hacked on for the IBM 360/370 architectures.
    Basically, the 31bit relocation works, and just about everything
@@ -28,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    dynamic loading to work ...  its never been tested ...
 */
 
-
 #include "bfd.h"
 #include "sysdep.h"
 #include "bfdlink.h"
@@ -61,7 +59,6 @@ enum i370_reloc_type
 
   R_I370_max
 };
-
 \f
 static reloc_howto_type *i370_elf_howto_table[ (int)R_I370_max ];
 
@@ -254,13 +251,14 @@ static reloc_howto_type i370_elf_howto_raw[] =
         false),                /* pcrel_offset */
 
 };
-
 \f
 static void i370_elf_howto_init PARAMS ((void));
+static reloc_howto_type *i370_elf_reloc_type_lookup
+  PARAMS ((bfd *, bfd_reloc_code_real_type));
+
 static void i370_elf_info_to_howto PARAMS ((bfd *abfd, arelent *cache_ptr,
                                            Elf32_Internal_Rela *dst));
 static boolean i370_elf_set_private_flags PARAMS ((bfd *, flagword));
-
 \f
 /* Initialize the i370_elf_howto_table, so that linear accesses can be done.  */
 
@@ -272,11 +270,10 @@ i370_elf_howto_init ()
   for (i = 0; i < sizeof (i370_elf_howto_raw) / sizeof (i370_elf_howto_raw[0]); i++)
     {
       type = i370_elf_howto_raw[i].type;
-      BFD_ASSERT (type < sizeof(i370_elf_howto_table) / sizeof(i370_elf_howto_table[0]));
+      BFD_ASSERT (type < sizeof (i370_elf_howto_table) / sizeof (i370_elf_howto_table[0]));
       i370_elf_howto_table[type] = &i370_elf_howto_raw[i];
     }
 }
-
 \f
 static reloc_howto_type *
 i370_elf_reloc_type_lookup (abfd, code)
@@ -315,6 +312,8 @@ static boolean i370_elf_relocate_section PARAMS ((bfd *,
                                                  Elf_Internal_Rela *relocs,
                                                  Elf_Internal_Sym *local_syms,
                                                  asection **));
+static void i370_elf_post_process_headers
+  PARAMS ((bfd *, struct bfd_link_info *));
 
 static boolean i370_elf_create_dynamic_sections PARAMS ((bfd *,
                                                         struct bfd_link_info *));
@@ -350,7 +349,6 @@ static boolean i370_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_
 
 #define ELF_DYNAMIC_INTERPRETER "/lib/ld.so"
 
-
 /* Set the howto pointer for an i370 ELF reloc.  */
 
 static void
@@ -369,7 +367,7 @@ i370_elf_info_to_howto (abfd, cache_ptr, dst)
 /* hack alert --  the following several routines look generic to me ...
  * why are we bothering with them ???
  */
-/* Function to set whether a module needs the -mrelocatable bit set. */
+/* Function to set whether a module needs the -mrelocatable bit set.  */
 static boolean
 i370_elf_set_private_flags (abfd, flags)
      bfd *abfd;
@@ -438,7 +436,6 @@ i370_elf_merge_private_bfd_data (ibfd, obfd)
 
   return true;
 }
-
 \f
 /* Handle an i370 specific section when reading an object file.  This
    is called when elfcode.h finds a section with an unknown type.  */
@@ -470,8 +467,6 @@ i370_elf_section_from_shdr (abfd, hdr, name)
   bfd_set_section_flags (abfd, newsect, flags);
   return true;
 }
-
-
 \f
 /* Set up any other section flags and such that may be necessary.  */
 /* XXX hack alert bogus This routine is mostly all junk and almost
@@ -479,7 +474,6 @@ i370_elf_section_from_shdr (abfd, hdr, name)
  * just enough to allow glibc-2.1 ld.so to compile & link.
  */
 
-
 static boolean
 i370_elf_fake_sections (abfd, shdr, asect)
      bfd *abfd ATTRIBUTE_UNUSED;
@@ -494,7 +488,6 @@ i370_elf_fake_sections (abfd, shdr, asect)
 
   return true;
 }
-
 \f
 #if 0
 /* Create a special linker section */
@@ -610,7 +603,7 @@ i370_elf_create_dynamic_sections (abfd, info)
        return false;
     }
 
-   /* xxx beats me, seem to need a rela.text ... */
+   /* xxx beats me, seem to need a rela.text ...  */
    s = bfd_make_section (abfd, ".rela.text");
    if (s == NULL
       || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
@@ -654,7 +647,6 @@ i370_elf_adjust_dynamic_symbol (info, h)
                      && (h->elf_link_hash_flags
                          & ELF_LINK_HASH_DEF_REGULAR) == 0)));
 
-
   s = bfd_get_section_by_name (dynobj, ".rela.text");
   BFD_ASSERT (s != NULL);
   s->_raw_size += sizeof (Elf32_External_Rela);
@@ -742,7 +734,6 @@ i370_elf_adjust_dynamic_symbol (info, h)
 
   return true;
 }
-
 \f
 /* Increment the index of a dynamic symbol by a given amount.  Called
    via elf_link_hash_traverse.  */
@@ -769,7 +760,6 @@ i370_elf_adjust_dynindx (h, cparg)
 
   return true;
 }
-
 \f
 /* Set the sizes of the dynamic sections.  */
 /* XXX hack alert bogus This routine is mostly all junk and almost
@@ -879,7 +869,7 @@ i370_elf_size_dynamic_sections (output_bfd, info)
              asection *target;
              const char *outname;
 
-             /* Remember whether there are any relocation sections. */
+             /* Remember whether there are any relocation sections.  */
              relocs = true;
 
              /* If this relocation section applies to a read only
@@ -1002,7 +992,6 @@ i370_elf_size_dynamic_sections (output_bfd, info)
 
   return true;
 }
-
 \f
 /* Look through the relocs for a section during the first phase, and
    allocate space in the global offset table or procedure linkage
@@ -1107,7 +1096,6 @@ i370_elf_check_relocs (abfd, info, sec, relocs)
 
   return true;
 }
-
 \f
 /* Finish up the dynamic sections.  */
 /* XXX hack alert bogus This routine is mostly all junk and almost
@@ -1248,7 +1236,6 @@ i370_elf_finish_dynamic_sections (output_bfd, info)
 
   return true;
 }
-
 \f
 /* The RELOCATE_SECTION function is called by the ELF backend linker
    to handle the relocations for a section.
@@ -1419,12 +1406,12 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            relocation = 0;
          else
            {
-             (*info->callbacks->undefined_symbol)(info,
-                                                  h->root.root.string,
-                                                  input_bfd,
-                                                  input_section,
-                                                  rel->r_offset,
-                                                  true);
+             (*info->callbacks->undefined_symbol) (info,
+                                                   h->root.root.string,
+                                                   input_bfd,
+                                                   input_section,
+                                                   rel->r_offset,
+                                                   true);
              ret = false;
              continue;
            }
@@ -1562,9 +1549,9 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 #ifdef DEBUG
                          if (indx <= 0)
                            {
-                             printf("indx=%d section=%s flags=%08x name=%s\n",
-                                    indx, osec->name, osec->flags,
-                                    h->root.root.string);
+                             printf ("indx=%d section=%s flags=%08x name=%s\n",
+                                     indx, osec->name, osec->flags,
+                                     h->root.root.string);
                            }
 #endif
                        }
@@ -1602,7 +1589,6 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
          continue;
        }
 
-
 #ifdef DEBUG
       fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n",
               howto->name,
@@ -1647,13 +1633,13 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                      name = bfd_section_name (input_bfd, sec);
                  }
 
-               (*info->callbacks->reloc_overflow)(info,
-                                                  name,
-                                                  howto->name,
-                                                  (bfd_vma) 0,
-                                                  input_bfd,
-                                                  input_section,
-                                                  offset);
+               (*info->callbacks->reloc_overflow) (info,
+                                                   name,
+                                                   howto->name,
+                                                   (bfd_vma) 0,
+                                                   input_bfd,
+                                                   input_section,
+                                                   offset);
              }
              break;
 
@@ -1661,7 +1647,6 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
        }
     }
 
-
 #ifdef DEBUG
   fprintf (stderr, "\n");
 #endif
@@ -1690,8 +1675,6 @@ i370_elf_post_process_headers (abfd, link_info)
 #define ELF_MAXPAGESIZE                0x1000
 #define elf_info_to_howto      i370_elf_info_to_howto
 
-
-
 #define elf_backend_plt_not_loaded 1
 #define elf_backend_got_symbol_offset 4
 
@@ -1731,7 +1714,7 @@ int i370_noop()
 #define elf_backend_add_symbol_hook \
   (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \
                        const Elf_Internal_Sym *, const char **, flagword *, \
-                       asection **, bfd_vma *)))               i370_noop
+                       asection **, bfd_vma *)))               i370_noop
 #define elf_backend_finish_dynamic_symbol \
   (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \
                        struct elf_link_hash_entry *, \
This page took 0.029105 seconds and 4 git commands to generate.