// 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
// RLN.H - Application Header
// Copyright (C) 199x Allan K. Pratt, 2011 Reboot & Friends
-#define MAJOR 1 // Major version number
-#define MINOR 0 // Minor version number
-#define PATCH 1 // Patch release number
+#define MAJOR 1 // Major version number
+#define MINOR 0 // Minor version number
+#define PATCH 2 // Patch release number
// Macro to swap the 16-bit words of a 32-bit integer
#define _SWAPWORD(x) (((unsigned)(x) >> 16) | ((unsigned)(x) << 16))
// Macro to swap the 16-bit words of a 32-bit integer
#define _SWAPWORD(x) (((unsigned)(x) >> 16) | ((unsigned)(x) << 16))
-#define FARGSIZE 1024 // Number of chars in filename argument
-#define FNLEN 1024 // Size of a file name
-#define NHANDLES 256 // Number of open file handles at once
-#define OST_BLOCK 0x400000 // Output symbol table block (4MB)
-#define DSTSEG_D 1 // Include file destination seg (DATA)
-#define DSTSEG_T 2 // Include file destination seg (TEXT)
-#define MAXARGS 256 // Max number of args in a command file
+#define FARGSIZE 1024 // Number of chars in filename argument
+#define FNLEN 1024 // Size of a file name
+#define NHANDLES 256 // Number of open file handles at once
+#define OST_BLOCK 0x400000 // Output symbol table block (4MB)
+#define DSTSEG_D 1 // Include file destination seg (DATA)
+#define DSTSEG_T 2 // Include file destination seg (TEXT)
+#define MAXARGS 256 // Max number of args in a command file
+
+// Headers
-// --- Headers -------------------------------------------------------------------------------------
-// Most of these structures reflect the actual format of the object in question, on a 68000: char
-// means one byte, int means two bytes, long means four. If the host machine doesn't have this
-// same format (like a VAX), you will have to read the file into a buffer and stuff the values into
-// the structure (see slongio.c).
+// Most of these structures reflect the actual format of the object in
+// question, on a 68000: char means one byte, int means two bytes, long means
+// four. If the host machine doesn't have this same format (like a VAX), you
+// will have to read the file into a buffer and stuff the values into the
+// structure (see slongio.c).
- struct { // For .abs
- long stksize; // Unused
- long tstart; // Start of TEXT
- long rbflag; // -1 if no fixups at all
- long dstart; // Start of DATA
- long bstart; // Start of BSS
+ struct { // For .abs
+ long stksize; // Unused
+ long tstart; // Start of TEXT
+ long rbflag; // -1 if no fixups at all
+ long dstart; // Start of DATA
+ long bstart; // Start of BSS
- char *ostbase; // Base of output symbol table
- long fsize; // Length of fixups
- char *fixups; // Start of fixups
+ char * ostbase; // Base of output symbol table
+ long fsize; // Length of fixups
+ char * fixups; // Start of fixups
- char o_name[FNLEN]; // Fixed-length names
- char o_arname[FNLEN]; // Name of archive this is from
- struct OFILE *o_next; // Next object file
- long o_tbase, o_dbase, o_bbase; // Computed bases for this ofile
- int o_symstart; // First sym in image is nth in out
- int o_flags; // Flags (see O_*)
- struct OHEADER o_header; // Header of this file
- char *o_image; // Image of this file
+ char o_name[FNLEN]; // Fixed-length names
+ char o_arname[FNLEN]; // Name of archive this is from
+ struct OFILE *o_next; // Next object file
+ long o_tbase, o_dbase, o_bbase; // Computed bases for this ofile
+ int o_symstart; // First sym in image is nth in out
+ int o_flags; // Flags (see O_*)
+ struct OHEADER o_header; // Header of this file
+ char *o_image; // Image of this file
// 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
// 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
-// SYMREC: Used by builddir for the lists of exports and imports, and by the linker for the output
-// symbol table (that's why there are type and value fields, unused in builddir)
+// SYMREC: Used by builddir for the lists of exports and imports, and by the
+// linker for the output symbol table (that's why there are type and value
+// fields, unused in builddir)
-// HREC: One item in a hash bucket, including a link to the next item. Commons and Globals share a
-// hash table, but their value fields are interpreted differently.
+// HREC: One item in a hash bucket, including a link to the next item. Commons
+// and Globals share a hash table, but their value fields are interpreted
+// differently.
#define ABST_DATA 0x0400 /* data-based relocatable */
#define ABST_TEXT 0x0200 /* text-based relocatable */
#define ABST_BSS 0x0100 /* bss-based relocatable */
#define ABST_DATA 0x0400 /* data-based relocatable */
#define ABST_TEXT 0x0200 /* text-based relocatable */
#define ABST_BSS 0x0100 /* bss-based relocatable */
-#define ABST_FILE 0x0080 // file symbol
-#define ABST_ARCHIVE 0x0040 // only when FILE set: archive file or no
-#define ABST_OST 0x0001 // private: "symbol is in ost": see above
+#define ABST_FILE 0x0080 // file symbol
+#define ABST_ARCHIVE 0x0040 // only when FILE set: archive file or no
+#define ABST_OST 0x0001 // private: "symbol is in ost": see above
// symcopy remaining as it is (copies two longs plus a null)
#define symcmp(a,b) ((*(long *)(a) == *(long *)(b)) && \
// symcopy remaining as it is (copies two longs plus a null)
#define symcmp(a,b) ((*(long *)(a) == *(long *)(b)) && \
int doargs(int, char *[]);
char *make_string(char *);
int doargs(int, char *[]);
char *make_string(char *);