Re-work previous change.
authorPer Bothner <per@bothner.com>
Wed, 20 Nov 1991 06:01:41 +0000 (06:01 +0000)
committerPer Bothner <per@bothner.com>
Wed, 20 Nov 1991 06:01:41 +0000 (06:01 +0000)
include/aout64.h
include/bfd.h

index 96a29b5d4f053bd285753b862620136741fc76f3..750cde5bec1e4941c9b800ba3442f8f7a5b3f137 100755 (executable)
@@ -46,15 +46,27 @@ struct external_exec
 
 #ifndef N_TXTADDR
 #define N_TXTADDR(x) \
-    (N_MAGIC(x)!=ZMAGIC? 0 \
-     : N_HEADER_IN_TEXT(x) ? TEXT_START_ADDR+EXEC_BYTES_SIZE \
-     : TEXT_START_ADDR)
+    (N_MAGIC(x)!=ZMAGIC? 0 : TEXT_START_ADDR)
 #endif
 
 /* Offset in an a.out of the start of the text section. */
 
 #define N_TXTOFF(x)   ( N_MAGIC(x) != ZMAGIC ? EXEC_BYTES_SIZE \
+                      : N_HEADER_IN_TEXT(x) ? 0 : PAGE_SIZE)
+
+/* These are the same as N_TXTADDR and N_TXTOFF,
+   but never consider the exec header to be includes in the text. */
+
+#define LOGICAL_TXTADDR(x) \
+    (N_MAGIC(x)!=ZMAGIC? 0 \
+     : N_HEADER_IN_TEXT(x) ? TEXT_START_ADDR+EXEC_BYTES_SIZE \
+     : TEXT_START_ADDR)
+#define LOGICAL_TXTOFF(x)   ( N_MAGIC(x) != ZMAGIC ? EXEC_BYTES_SIZE \
                       : N_HEADER_IN_TEXT(x) ? EXEC_BYTES_SIZE : PAGE_SIZE)
+#define LOGICAL_TXTSIZE(x) \
+    ((x).a_text \
+     - (N_HEADER_IN_TEXT(x) && N_MAGIC(x)==ZMAGIC ? EXEC_BYTES_SIZE : 0))
+
 #if ARCH_SIZE==64
 #define OMAGIC 0x1001          /* Code indicating object file  */
 #define ZMAGIC 0x1002          /* Code indicating demand-paged executable.  */
index 345e8e03619a47eedc0aa9a3636a1245c904a0be..d85694afebd0663bf6f90e8f8b0651d92873056c 100644 (file)
@@ -293,7 +293,7 @@ extern CONST short _bfd_host_big_endian;
 #define bfd_get_file_flags(abfd) ((abfd)->flags)
 #define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
 #define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
-#define bfd_my_archive(abfd) ((abfd)->my_archive);
+#define bfd_my_archive(abfd) ((abfd)->my_archive)
 #define bfd_has_map(abfd) ((abfd)->has_armap)
 #define bfd_header_twiddle_required(abfd) \
         ((((abfd)->xvec->header_byteorder_big_p)               \