/* This indicates a demand-paged executable with the header in the text.
It is used by 386BSD (and variants) and Linux, at least. */
+#ifndef QMAGIC
#define QMAGIC 0314
+#endif
# ifndef N_BADMAG
# define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
&& N_MAGIC(x) != NMAGIC \
#define N_IS_QMAGIC(x) (0)
#endif
-/* The difference between PAGE_SIZE and N_SEGSIZE is that PAGE_SIZE is
+/* The difference between TARGET_PAGE_SIZE and N_SEGSIZE is that TARGET_PAGE_SIZE is
the finest granularity at which you can page something, thus it
controls the padding (if any) before the text segment of a ZMAGIC
file. N_SEGSIZE is the resolution at which things can be marked as
read-only versus read/write, so it controls the padding between the
text segment and the data segment (in memory; on disk the padding
- between them is PAGE_SIZE). PAGE_SIZE and N_SEGSIZE are the same
+ between them is TARGET_PAGE_SIZE). TARGET_PAGE_SIZE and N_SEGSIZE are the same
for most machines, but different for sun3. */
/* By default, segment size is constant. But some machines override this
* If N_HEADER_IN_TEXT(x) is false (which defaults to being the case when
the entry point is less than EXEC_BYTES_SIZE into a page (e.g. page
aligned)): (padding is needed so that text can start at a page boundary)
- start at TEXT_START_ADDR, offset PAGE_SIZE, size as stated.
+ start at TEXT_START_ADDR, offset TARGET_PAGE_SIZE, size as stated.
Specific configurations may want to hardwire N_HEADER_IN_TEXT,
for efficiency or to allow people to play games with the entry point.
the entry point, perhaps with the ld -e flag.)
* QMAGIC is always like a ZMAGIC for which N_HEADER_IN_TEXT is true,
- and for which the starting address is PAGE_SIZE (or should this be
+ and for which the starting address is TARGET_PAGE_SIZE (or should this be
SEGMENT_SIZE?) (TEXT_START_ADDR only applies to ZMAGIC, not to QMAGIC).
*/
/* This macro is only relevant for ZMAGIC files; QMAGIC always has the header
in the text. */
#ifndef N_HEADER_IN_TEXT
-#define N_HEADER_IN_TEXT(x) (((x).a_entry & (PAGE_SIZE-1)) >= EXEC_BYTES_SIZE)
+#define N_HEADER_IN_TEXT(x) (((x).a_entry & (TARGET_PAGE_SIZE-1)) >= EXEC_BYTES_SIZE)
#endif
/* Sun shared libraries, not linux. This macro is only relevant for ZMAGIC
#define N_TXTADDR(x) \
(/* The address of a QMAGIC file is always one page in, */ \
/* with the header in the text. */ \
- N_IS_QMAGIC (x) ? PAGE_SIZE + EXEC_BYTES_SIZE : \
+ N_IS_QMAGIC (x) ? TARGET_PAGE_SIZE + EXEC_BYTES_SIZE : \
N_MAGIC(x) != ZMAGIC ? 0 : /* object file or NMAGIC */\
N_SHARED_LIB(x) ? 0 : \
N_HEADER_IN_TEXT(x) ? \
/* If N_HEADER_IN_TEXT is not true for ZMAGIC, there is some padding
to make the text segment start at a certain boundary. For most
- systems, this boundary is PAGE_SIZE. But for Linux, in the
+ systems, this boundary is TARGET_PAGE_SIZE. But for Linux, in the
time-honored tradition of crazy ZMAGIC hacks, it is 1024 which is
- not what PAGE_SIZE needs to be for QMAGIC. */
+ not what TARGET_PAGE_SIZE needs to be for QMAGIC. */
#ifndef ZMAGIC_DISK_BLOCK_SIZE
-#define ZMAGIC_DISK_BLOCK_SIZE PAGE_SIZE
+#define ZMAGIC_DISK_BLOCK_SIZE TARGET_PAGE_SIZE
#endif
#define N_DISK_BLOCK_SIZE(x) \
- (N_MAGIC(x) == ZMAGIC ? ZMAGIC_DISK_BLOCK_SIZE : PAGE_SIZE)
+ (N_MAGIC(x) == ZMAGIC ? ZMAGIC_DISK_BLOCK_SIZE : TARGET_PAGE_SIZE)
/* Offset in an a.out of the start of the text section. */
#ifndef N_TXTOFF
RELOC_CONST,
RELOC_CONSTH,
- /* All the new ones I can think of *//*v9*/
+ /* All the new ones I can think of, for sparc v9 */
- RELOC_64, /* data[0:63] = addend + sv *//*v9*/
- RELOC_DISP64, /* data[0:63] = addend - pc + sv *//*v9*/
- RELOC_WDISP21, /* data[0:20] = (addend + sv - pc)>>2 *//*v9*/
- RELOC_DISP21, /* data[0:20] = addend - pc + sv *//*v9*/
- RELOC_DISP14, /* data[0:13] = addend - pc + sv *//*v9*/
+ RELOC_64, /* data[0:63] = addend + sv */
+ RELOC_DISP64, /* data[0:63] = addend - pc + sv */
+ RELOC_WDISP21, /* data[0:20] = (addend + sv - pc)>>2 */
+ RELOC_DISP21, /* data[0:20] = addend - pc + sv */
+ RELOC_DISP14, /* data[0:13] = addend - pc + sv */
/* Q .
What are the other ones,
Since this is a clean slate, can we throw away the ones we dont