]> Shamusworld >> Repos - rln/commitdiff
Minor dusting.
authorJames Hammons <jlhamm@acm.org>
Mon, 26 Dec 2011 17:59:11 +0000 (17:59 +0000)
committerJames Hammons <jlhamm@acm.org>
Mon, 26 Dec 2011 17:59:11 +0000 (17:59 +0000)
makefile
rln.c

index d49541a062f269417a2e07ac90b2f9baaa38d34f..68a2524fbccd70dbabaaa6fd4612d3cbfb68afbf 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,9 +1,13 @@
+# Makefile for Reboot's Linker for Jaguar
+
 rm=/bin/rm -f 
 CC= cc 
 PROGNAME= rln 
 LIBS= 
 
+# Change this to -DWIN32 for Windows :-)
 CFLAGS= -g -I. -D__GCCUNIX__
+#CFLAGS= -g -I. -DWIN32
 
 SRCS = rln.c 
 
@@ -19,4 +23,4 @@ $(PROGNAME) : $(OBJS)
        $(CC) $(CFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS) 
 
 clean: 
-       $(rm) $(OBJS) $(PROGNAME) core *~ 
+       $(rm) $(OBJS) $(PROGNAME) *~ 
diff --git a/rln.c b/rln.c
index f1d0b9b064974f9e9a888bcdd27a1b6badce485a..7eebe68beda260e7e29b1bfd182b97aa40ff8a12 100644 (file)
--- a/rln.c
+++ b/rln.c
@@ -2381,7 +2381,7 @@ void display_help(void)
        printf("   -s                      output only global symbols\n");
        printf("   -v                      set verbose mode\n");
        printf("   -z                      suppress banner\n");
-       printf("\n\n");
+       printf("\n");
 }
 
 
@@ -2427,121 +2427,122 @@ int get_endianess(void)
 //
 int main(int argc, char * argv[])
 {
-   char * s = NULL;                                          // String pointer for "getenv"
-   struct HREC * utemp;                                      // Temporary hash record pointer 
-   struct OHEADER * header;                                  // Pointer to output header structure
+       char * s = NULL;                                          // String pointer for "getenv"
+       struct HREC * utemp;                                      // Temporary hash record pointer 
+       struct OHEADER * header;                                  // Pointer to output header structure
 
-   endian = get_endianess();                                // Get processor endianess
-   cmdlnexec = argv[0];                                     // Obtain executable name
-   s = getenv("RLNPATH");
+       endian = get_endianess();                                // Get processor endianess
+       cmdlnexec = argv[0];                                     // Obtain executable name
+       s = getenv("RLNPATH");
 
-   if(s)                                                    // Attempt to obtain env variable
-      strcpy(libdir, s);                                    // Store it if found
+       if (s)                                                   // Attempt to obtain env variable
+               strcpy(libdir, s);                                    // Store it if found
 
-   if (doargs(argc, argv))
-   {                                 // Parse the command line
-      errflag = 1;
-          rln_exit();
-   }
+       if (doargs(argc, argv))
+       {                                 // Parse the command line
+               errflag = 1;
+               rln_exit();
+       }
 
-   if (!zflag && !vflag)
-   {
-      display_version();                                    // Display version information
-      versflag = 1;                                           // We've dumped the version banner 
-   }
+       if (!zflag && !vflag)
+       {
+               display_version();                                    // Display version information
+               versflag = 1;                                          // We've dumped the version banner 
+       }
 
-   if (flush_handles())
-   {                                    // Process in specified files/objects
-      errflag = 1;
-      rln_exit();
-   }
+       if (flush_handles())
+       {                                    // Process in specified files/objects
+               errflag = 1;
+               rln_exit();
+       }
 
-   if (dolist())
-   {                                           // Remove elements from unresolved list
-      errflag = 1;
-      rln_exit();
-   }
+       if (dolist())
+       {                                           // Remove elements from unresolved list
+               errflag = 1;
+               rln_exit();
+       }
 
-   if (olist == NULL)
-   {                                      // Check that there is something to link
-      printf("No object files to link.\n\n");
-      errflag = 1;
-      rln_exit();
-   }
+       if (olist == NULL)
+       {                                      // Check that there is something to link
+//             printf("No object files to link.\n\n");
+//             errflag = 1;
+               display_help();
+               rln_exit();
+       }
 
-   if (unresolved != NULL)
-   {                                 // Report unresolved externals
-      printf("UNRESOLVED SYMBOLS\n");
+       if (unresolved != NULL)
+       {                                 // Report unresolved externals
+               printf("UNRESOLVED SYMBOLS\n");
 
-      if (uflag < 2)
-      {                                       // Don't list them if two -u's or more 
-         utemp = unresolved;
+               if (uflag < 2)
+               {                                       // Don't list them if two -u's or more 
+                       utemp = unresolved;
 
-         while (utemp != NULL)
-         {
-            printf("\t%s (",utemp->h_sym);
-            put_name(utemp->h_ofile);
-            printf(")\n");
-            utemp = utemp->h_next;
-         }
-      }
+                       while (utemp != NULL)
+                       {
+                       printf("\t%s (",utemp->h_sym);
+                       put_name(utemp->h_ofile);
+                       printf(")\n");
+                       utemp = utemp->h_next;
+                       }
+               }
 
-      if (!uflag)
-      {
-         errflag = 1;
-         rln_exit();
-      }
-   }
+               if (!uflag)
+               {
+                       errflag = 1;
+                       rln_exit();
+               }
+       }
 
-   if ((header = make_ofile()) == NULL)
-   {                    // Make one output file from input objs
-      errflag = 1;
-      rln_exit();
-   }
+       if ((header = make_ofile()) == NULL)
+       {                    // Make one output file from input objs
+               errflag = 1;
+               rln_exit();
+       }
 
-   if (pflag)
-   {                                              // Partial linking
-      printf("TO DO:Partial linking\n");
-      errflag = 1;
-   }
-   else if (!aflag)
-   {                                     // Relocatable linking
-      printf("TO DO:Relocatable linking\n");
-      errflag = 1;
-   }
-   else
-   {                                                 // Absolute linking
-      if (vflag)
-      {
-         printf("Absolute linking ");
+       if (pflag)
+       {                                              // Partial linking
+               printf("TO DO:Partial linking\n");
+               errflag = 1;
+       }
+       else if (!aflag)
+       {                                     // Relocatable linking
+               printf("TO DO:Relocatable linking\n");
+               errflag = 1;
+       }
+       else
+       {                                                 // Absolute linking
+               if (vflag)
+               {
+                       printf("Absolute linking ");
 
-         if (cflag)
-           printf("(COF)\n"); 
-         else
-           printf("(ABS)\n");
-      }
+                       if (cflag)
+                       printf("(COF)\n"); 
+                       else
+                       printf("(ABS)\n");
+               }
 
-      if (vflag > 1)
-        printf("Header magic is 0x%04X\n", (unsigned int)header->magic);
+               if (vflag > 1)
+               printf("Header magic is 0x%04X\n", (unsigned int)header->magic);
 
-      if (write_ofile(header))
-        errflag = 1;
-   }
+               if (write_ofile(header))
+               errflag = 1;
+       }
 
-   if (mflag)                                                // Display the loaded symbols map
-      if (write_map(header))
-        errflag = 1;
+       if (mflag)                                                // Display the loaded symbols map
+               if (write_map(header))
+                       errflag = 1;
 
-   if (vflag)
-   {                                             // Display segment size summary
-      printf("\n");
-      printf("+---------+----------+----------+----------+\n");
-      printf("| Segment |     TEXT |     DATA |      BSS |\n");
-      printf("| Sizes   |----------+----------+----------|\n");
-      printf("| (Hex)   | %8X | %8X | %8X |\n", (unsigned int)header->tsize, (unsigned int)header->dsize, (unsigned int)header->bsize);
-      printf("+---------+----------+----------+----------+\n\n");
-   }
+       if (vflag)
+       {                                             // Display segment size summary
+               printf("\n");
+               printf("+---------+----------+----------+----------+\n");
+               printf("| Segment |     TEXT |     DATA |      BSS |\n");
+               printf("| Sizes   |----------+----------+----------|\n");
+               printf("| (Hex)   | %8X | %8X | %8X |\n", (unsigned int)header->tsize, (unsigned int)header->dsize, (unsigned int)header->bsize);
+               printf("+---------+----------+----------+----------+\n\n");
+       }
 
-   free(header);                                            // Free allocated memory
-   rln_exit();                                              // Perform application exit
+       free(header);                                            // Free allocated memory
+       rln_exit();                                              // Perform application exit
 }