From 09cc7651e5aaef638472003659356e459688e214 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 18 Sep 2001 10:00:23 +0000 Subject: * aout64.h: Formatting fixes. (N_TXTADDR): Evaluate to a bfd_vma. (N_DATADDR): Avoid negative unsigned warning. * hp300hpux.h: Formatting fixes. (N_DATADDR): As above. --- include/aout/ChangeLog | 8 ++++++ include/aout/aout64.h | 75 ++++++++++++++++++++++++++---------------------- include/aout/hp300hpux.h | 14 ++++----- 3 files changed, 55 insertions(+), 42 deletions(-) diff --git a/include/aout/ChangeLog b/include/aout/ChangeLog index f107b84..d215c59 100644 --- a/include/aout/ChangeLog +++ b/include/aout/ChangeLog @@ -1,3 +1,11 @@ +2001-09-18 Alan Modra + + * aout64.h: Formatting fixes. + (N_TXTADDR): Evaluate to a bfd_vma. + (N_DATADDR): Avoid negative unsigned warning. + * hp300hpux.h: Formatting fixes. + (N_DATADDR): Avoid negative unsigned warning. + Mon Apr 3 13:29:08 2000 Hans-Peter Nilsson * aout64.h (RELOC_EXT_BITS_EXTERN_BIG): Wrap definition in #ifndef. diff --git a/include/aout/aout64.h b/include/aout/aout64.h index a8a8cd1..bc96d2a 100644 --- a/include/aout/aout64.h +++ b/include/aout/aout64.h @@ -131,7 +131,8 @@ struct external_exec /* 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 @@ -151,15 +152,17 @@ struct external_exec #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 @@ -177,14 +180,15 @@ struct external_exec /* 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 @@ -193,25 +197,28 @@ struct external_exec 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. */ @@ -228,21 +235,19 @@ struct external_exec 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 /* Symbols */ diff --git a/include/aout/hp300hpux.h b/include/aout/hp300hpux.h index b4ad093..1174761 100644 --- a/include/aout/hp300hpux.h +++ b/include/aout/hp300hpux.h @@ -1,5 +1,5 @@ /* Special version of 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 { @@ -73,13 +73,13 @@ struct hp300hpux_header_extension #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 \ -- cgit v1.1