/* 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 & (TARGET_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
#ifndef N_TXTADDR
#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) ? 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) ? \
- TEXT_START_ADDR + EXEC_BYTES_SIZE : /* no padding */\
- TEXT_START_ADDR /* a page of padding */\
- )
+ (/* The address of a QMAGIC file is always one page in, */ \
+ /* with the header in the text. */ \
+ N_IS_QMAGIC (x) \
+ ? (bfd_vma) TARGET_PAGE_SIZE + EXEC_BYTES_SIZE \
+ : (N_MAGIC (x) != ZMAGIC \
+ ? (bfd_vma) 0 /* object file or NMAGIC */ \
+ : (N_SHARED_LIB (x) \
+ ? (bfd_vma) 0 \
+ : (N_HEADER_IN_TEXT (x) \
+ ? (bfd_vma) TEXT_START_ADDR + EXEC_BYTES_SIZE \
+ : (bfd_vma) TEXT_START_ADDR))))
#endif
/* If N_HEADER_IN_TEXT is not true for ZMAGIC, there is some padding
/* Offset in an a.out of the start of the text section. */
#ifndef N_TXTOFF
-#define N_TXTOFF(x) \
- (/* For {O,N,Q}MAGIC, no padding. */ \
- N_MAGIC(x) != ZMAGIC ? EXEC_BYTES_SIZE : \
- N_SHARED_LIB(x) ? 0 : \
- N_HEADER_IN_TEXT(x) ? \
- EXEC_BYTES_SIZE : /* no padding */\
- ZMAGIC_DISK_BLOCK_SIZE /* a page of padding */\
- )
+#define N_TXTOFF(x) \
+ (/* For {O,N,Q}MAGIC, no padding. */ \
+ N_MAGIC (x) != ZMAGIC \
+ ? EXEC_BYTES_SIZE \
+ : (N_SHARED_LIB (x) \
+ ? 0 \
+ : (N_HEADER_IN_TEXT (x) \
+ ? EXEC_BYTES_SIZE /* no padding */ \
+ : ZMAGIC_DISK_BLOCK_SIZE /* a page of padding */)))
#endif
/* Size of the text section. It's always as stated, except that we
offset it to `undo' the adjustment to N_TXTADDR and N_TXTOFF
exec header to be part of the text segment.) */
#ifndef N_TXTSIZE
#define N_TXTSIZE(x) \
- (/* For QMAGIC, we don't consider the header part of the text section. */\
- N_IS_QMAGIC (x) ? (x).a_text - EXEC_BYTES_SIZE : \
- (N_MAGIC(x) != ZMAGIC || N_SHARED_LIB(x)) ? (x).a_text : \
- N_HEADER_IN_TEXT(x) ? \
- (x).a_text - EXEC_BYTES_SIZE: /* no padding */\
- (x).a_text /* a page of padding */\
- )
+ (/* For QMAGIC, we don't consider the header part of the text section. */\
+ N_IS_QMAGIC (x) \
+ ? (x).a_text - EXEC_BYTES_SIZE \
+ : ((N_MAGIC (x) != ZMAGIC || N_SHARED_LIB (x)) \
+ ? (x).a_text \
+ : (N_HEADER_IN_TEXT (x) \
+ ? (x).a_text - EXEC_BYTES_SIZE /* no padding */ \
+ : (x).a_text /* a page of padding */ )))
#endif
/* The address of the data segment in virtual memory.
It is the text segment address, plus text segment size, rounded
up to a N_SEGSIZE boundary for pure or pageable files. */
#ifndef N_DATADDR
#define N_DATADDR(x) \
- (N_MAGIC(x)==OMAGIC? (N_TXTADDR(x)+N_TXTSIZE(x)) \
- : (N_SEGSIZE(x) + ((N_TXTADDR(x)+N_TXTSIZE(x)-1) & ~(N_SEGSIZE(x)-1))))
+ (N_MAGIC (x) == OMAGIC \
+ ? (N_TXTADDR (x) + N_TXTSIZE (x)) \
+ : (N_SEGSIZE (x) + ((N_TXTADDR (x) + N_TXTSIZE (x) - 1) \
+ & ~ (bfd_vma) (N_SEGSIZE (x) - 1))))
#endif
/* The address of the BSS segment -- immediately after the data segment. */
-#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
+#define N_BSSADDR(x) (N_DATADDR (x) + (x).a_data)
/* Offsets of the various portions of the file after the text segment. */
for NMAGIC. */
#ifndef N_DATOFF
-#define N_DATOFF(x) \
- (N_TXTOFF(x) + N_TXTSIZE(x))
+#define N_DATOFF(x) ( N_TXTOFF (x) + N_TXTSIZE (x) )
#endif
-
#ifndef N_TRELOFF
-#define N_TRELOFF(x) ( N_DATOFF(x) + (x).a_data )
+#define N_TRELOFF(x) ( N_DATOFF (x) + (x).a_data )
#endif
#ifndef N_DRELOFF
-#define N_DRELOFF(x) ( N_TRELOFF(x) + (x).a_trsize )
+#define N_DRELOFF(x) ( N_TRELOFF (x) + (x).a_trsize )
#endif
#ifndef N_SYMOFF
-#define N_SYMOFF(x) ( N_DRELOFF(x) + (x).a_drsize )
+#define N_SYMOFF(x) ( N_DRELOFF (x) + (x).a_drsize )
#endif
#ifndef N_STROFF
-#define N_STROFF(x) ( N_SYMOFF(x) + (x).a_syms )
+#define N_STROFF(x) ( N_SYMOFF (x) + (x).a_syms )
#endif
\f
/* Symbols */
/* Special version of <a.out.h> for use under hp-ux.
- Copyright 1988, 1993, 1995 Free Software Foundation, Inc. */
+ Copyright 1988, 1993, 1995, 2001 Free Software Foundation, Inc. */
struct hp300hpux_exec_bytes
{
#define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x)))
#define N_DATADDR(x) \
- ((N_MAGIC(x)==OMAGIC || N_MAGIC(x)==HPUX_DOT_O_MAGIC) ? \
- (N_TXTADDR(x)+N_TXTSIZE(x)) \
- : (N_SEGSIZE(x) + ((N_TXTADDR(x)+N_TXTSIZE(x)-1) & ~(N_SEGSIZE(x)-1))))
+ ((N_MAGIC (x) == OMAGIC || N_MAGIC (x) == HPUX_DOT_O_MAGIC) \
+ ? (N_TXTADDR (x) + N_TXTSIZE (x)) \
+ : (N_SEGSIZE (x) + ((N_TXTADDR (x) + N_TXTSIZE (x) - 1) \
+ & ~ (bfd_vma) (N_SEGSIZE (x) - 1))))
-#define _N_BADMACH(x) \
-(((N_MACHTYPE (x)) != HP9000S200_ID) && \
- ((N_MACHTYPE (x)) != HP98x6_ID))
+#define _N_BADMACH(x) \
+ (((N_MACHTYPE (x)) != HP9000S200_ID) && ((N_MACHTYPE (x)) != HP98x6_ID))
#define _N_BADMAG(x) (N_MAGIC(x) != HPUX_DOT_O_MAGIC \
&& N_MAGIC(x) != OMAGIC \