]> Shamusworld >> Repos - rln/blobdiff - rln.h
Patch to properly handle WORD sized symbol relocations by SainT.
[rln] / rln.h
diff --git a/rln.h b/rln.h
index c517f69627821f91f744705f4b5415b6713403f8..34e8d6c3a020ffc7cdc6498a8af6d8c593a6d156 100644 (file)
--- a/rln.h
+++ b/rln.h
@@ -1,7 +1,6 @@
 //
-// RLN - Reboot's Linker for the Atari Jaguar Console System
-// RLN.H - Application Header
-// Copyright (C) 199x Allan K. Pratt, 2011 Reboot & Friends
+// RLN - Reboot's Linker for the Atari Jaguar console system
+// Copyright (C) 199x Allan K. Pratt, 2011-2015 Reboot & Friends
 //
 
 #ifndef __RLN_H__
@@ -44,8 +43,8 @@
 #endif
 
 #define MAJOR   1                      // Major version number
-#define MINOR   4                      // Minor version number
-#define PATCH   3                      // Patch release number
+#define MINOR   5                      // Minor version number
+#define PATCH   2                      // Patch release number
 
 #ifdef WIN32
 #define PLATFORM     "Win32"           // Release platform - Windows
@@ -91,22 +90,22 @@ struct OHEADER
        uint32_t bsize;
        uint32_t ssize;
        union {
-               struct {                                        // For .o 
+               struct {                                        // For .o
                        uint32_t tsize;                 // Text relocation size
                        uint32_t dsize;                 // Data relocation size
                        uint8_t reserved[12];
                } reloc;
-               struct {                                        // For .abs 
-                       uint32_t stksize;               // Unused 
-                       uint32_t tstart;                // Start of TEXT 
-                       uint32_t rbflag;                // -1 if no fixups at all 
-                       uint32_t dstart;                // Start of DATA 
+               struct {                                        // For .abs
+                       uint32_t stksize;               // Unused
+                       uint32_t tstart;                // Start of TEXT
+                       uint32_t rbflag;                // -1 if no fixups at all
+                       uint32_t dstart;                // Start of DATA
                        uint32_t bstart;                // Start of BSS
                } abs;
        } absrel;
-       uint8_t * ostbase;                              // Base of output symbol table 
+       uint8_t * ostbase;                              // Base of output symbol table
        uint32_t fsize;                                 // Length of fixups
-       uint8_t * fixups;                               // Start of fixups 
+       uint8_t * fixups;                               // Start of fixups
 };
 
 #define new_oheader()   (struct OHEADER *)malloc(sizeof(struct OHEADER))
@@ -119,7 +118,7 @@ struct ARHEADER
        uint8_t a_gid;
        uint16_t a_fimode;
        uint32_t a_fsize;
-       uint16_t reserved;                              // Two bytes zeroes btwn header & file 
+       uint16_t reserved;                              // Two bytes zeroes btwn header & file
 };
 
 #define new_arheader()  (struct ARHEADER *)malloc(sizeof(struct ARHEADER))
@@ -139,7 +138,10 @@ struct OFILE
        struct OHEADER o_header;                        // Header of this file
        uint8_t * o_image;                                      // Image of this file
        uint8_t isArchiveFile;                          // Temporary extra flag
-       uint32_t segSize[3];                            // Size of TEXT, DATA & BSS
+//These are likely redundant, and can probably be removed with judicious
+//editing of where they are used (in favor of OHEADER vars)
+       uint32_t segSize[3];                            // Size of TEXT, DATA & BSS (aligned)
+       uint32_t segBase[3];                            // Accumulated base address of TDB
 };
 
 #define new_ofile()  (struct OFILE *)malloc(sizeof(struct OFILE))
@@ -147,6 +149,7 @@ struct OFILE
 // Flags in an Object File's o_flags field
 // O_USED: means this ofile is used or is on the command line or in a -x
 #define O_USED       0x0001
+// N.B.: This is *never* set anywhere in the linker code...
 #define O_ARCHIVE    0x0002                    // This is a dummy archive entry
 
 // Symbol Record
@@ -159,7 +162,7 @@ struct OFILE
 
 struct SYMREC
 {
-       uint8_t s_name[SYMLEN];                 // Including null terminator 
+       uint8_t s_name[SYMLEN];                 // Including null terminator
        uint16_t s_type;
        uint32_t s_value;
        struct SYMREC * s_next;