(1) describe -relax
[deliverable/binutils-gdb.git] / ld / ldwrite.c
index 93af48c26b678ac0b125e24e448a87eb7b3b1a2f..6e1603a246753f4e8209044c02f498456f965511 100644 (file)
@@ -18,53 +18,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /*
  * $Id$ 
- *
- *  $Log$
- *  Revision 1.3  1991/03/22 22:32:22  steve
- *  *** empty log message ***
- *
- * Revision 1.2  1991/03/22  22:31:37  steve
- * *** empty log message ***
- *
- * Revision 1.1.1.1  1991/03/21  21:29:05  gumby
- * Back from Intel with Steve
- *
- * Revision 1.1  1991/03/21  21:29:04  gumby
- * Initial revision
- *
- * Revision 1.2  1991/03/15  18:45:55  rich
- * foo
- *
- * Revision 1.1  1991/03/13  00:48:37  chrisb
- * Initial revision
- *
- * Revision 1.7  1991/03/10  19:15:03  sac
- * Took out the abort() which had been put in the wrong place
- * Updated the version #.
- *
- * Revision 1.6  1991/03/10  09:31:41  rich
- *  Modified Files:
- *     Makefile config.h ld-emul.c ld-emul.h ld-gld.c ld-gld960.c
- *     ld-lnk960.c ld.h lddigest.c ldexp.c ldexp.h ldfile.c ldfile.h
- *     ldgram.y ldinfo.h ldlang.c ldlang.h ldlex.h ldlex.l ldmain.c
- *     ldmain.h ldmisc.c ldmisc.h ldsym.c ldsym.h ldversion.c
- *     ldversion.h ldwarn.h ldwrite.c ldwrite.h y.tab.h
- *
- * As of this round of changes, ld now builds on all hosts of (Intel960)
- * interest and copy passes my copy test on big endian hosts again.
- *
- * Revision 1.5  1991/03/09  03:25:08  sac
- * Added support for LONG, SHORT and BYTE keywords in scripts
- *
- * Revision 1.4  1991/03/06  21:59:34  sac
- * Completed G++ support
- *
- * Revision 1.3  1991/03/06  02:29:52  sac
- * Added support for partial linking.
- *
- * Revision 1.2  1991/02/22  17:15:11  sac
- * Added RCS keywords and copyrights
- *
 */
 
 /* 
@@ -134,7 +87,7 @@ static void perform_relocation(input_bfd,
                               symbols)
 bfd *input_bfd;
 asection *input_section;
-void *data;
+PTR data;
 asymbol **symbols;
 {
   static asymbol *error_symbol = (asymbol *)NULL;
@@ -226,7 +179,7 @@ asymbol **symbols;
                       s);
                  break;
                case bfd_reloc_outofrange:
-                 info("%B:%s relocation address out of range %T (%x)\n",
+                 info("%B:%s relocation address out of range %T (%V)\n",
                       input_bfd,
                       input_section->name,
                       s,
@@ -256,7 +209,7 @@ asymbol **symbols;
 
 
 
-void  *data_area;
+PTR data_area;
 
 static void
 copy_and_relocate(statement)
@@ -264,7 +217,7 @@ lang_statement_union_type *statement;
 {
   switch (statement->header.type) {
   case lang_fill_statement_enum: 
-    {
+      {
 #if 0
       bfd_byte play_area[SHORT_SIZE];
       unsigned int i;
@@ -327,41 +280,46 @@ lang_statement_union_type *statement;
     }
     break;
   case lang_input_section_enum:
-    {
-    
-      asection *i  = statement->input_section.section;
-      asection *output_section = i->output_section;
-      lang_input_statement_type *ifile = statement->input_section.ifile;
-      bfd *inbfd = ifile->the_bfd;
-      if (output_section->flags & SEC_LOAD && i->size != 0) 
-       {
-         if(bfd_get_section_contents(inbfd,
-                                     i,
-                                     data_area,
-                                     0L,
-                                     i->size) == false) 
-           {
-             info("%F%B error reading section contents %E\n",
-                  inbfd);
-           }
-         perform_relocation (inbfd,  i,  data_area, ifile->asymbols);
-
-
-         if(bfd_set_section_contents(output_bfd,
-                                     output_section,
-                                     data_area,
-                                     (file_ptr)i->output_offset,
-                                     i->size) == false) 
-           {
-             info("%F%B error writing section contents of %E\n",
-                  output_bfd);
-           }
+      {
+
+       asection *i  = statement->input_section.section;
+       asection *output_section = i->output_section;
+       lang_input_statement_type *ifile =
+         statement->input_section.ifile;
+       if (ifile->just_syms_flag == false) {
+         bfd *inbfd = ifile->the_bfd;
+
+         if (output_section->flags & SEC_LOAD && i->size != 0) 
+             {
+               if(bfd_get_section_contents(inbfd,
+                                           i,
+                                           data_area,
+                                           0L,
+                                           i->size) == false) 
+                   {
+                     info("%F%B error reading section contents %E\n",
+                          inbfd);
+                   }
+               perform_relocation (inbfd,  i,  data_area, ifile->asymbols);
+
+
+               if(bfd_set_section_contents(output_bfd,
+                                           output_section,
+                                           data_area,
+                                           (file_ptr)i->output_offset,
+                                           i->size) == false) 
+                   {
+                     info("%F%B error writing section contents of %E\n",
+                          output_bfd);
+                   }
 
+             }
        }
-    }
+
+      }
     break;
 
- default:
 default:
     /* All the other ones fall through */
     ;
 
@@ -433,7 +391,7 @@ write_rel()
 void
 ldwrite ()
 {
-  data_area = (void*) ldmalloc(largest_section);
+  data_area = (PTR) ldmalloc(largest_section);
   if (config.relocateable_output == true)
     {
       write_rel();
This page took 0.025923 seconds and 4 git commands to generate.