aboutsummaryrefslogtreecommitdiff
path: root/include/a.out.sun4.h
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-05-10 23:41:14 +0000
committerJohn Gilmore <gnu@cygnus>1991-05-10 23:41:14 +0000
commit66d4e1bb88997032a543574f69f57c284181b39d (patch)
treea003a120dbdc5dcc6e264baadb918f829381105f /include/a.out.sun4.h
parentdf77307a2acd29c32e82587211a9742db40b35c9 (diff)
downloadgdb-66d4e1bb88997032a543574f69f57c284181b39d.zip
gdb-66d4e1bb88997032a543574f69f57c284181b39d.tar.gz
gdb-66d4e1bb88997032a543574f69f57c284181b39d.tar.bz2
Update for Sony News port and split of a.out into several variants.
Add write_contents to format-dependent vector.
Diffstat (limited to 'include/a.out.sun4.h')
-rwxr-xr-xinclude/a.out.sun4.h28
1 files changed, 17 insertions, 11 deletions
diff --git a/include/a.out.sun4.h b/include/a.out.sun4.h
index 0c89c2a..3ba363d 100755
--- a/include/a.out.sun4.h
+++ b/include/a.out.sun4.h
@@ -1,19 +1,25 @@
/* SPARC-specific values for a.out files */
-#define PAGE_SIZE 0x02000 /* 8K. aka NBPG in <sys/param.h> */
+#define PAGE_SIZE 0x2000 /* 8K. aka NBPG in <sys/param.h> */
/* Note that some SPARCs have 4K pages, some 8K, some others. */
-#define SEGMENT_SIZE PAGE_SIZE
-#define TEXT_START_ADDR PAGE_SIZE /* Location 0 is not accessible */
+#define SEGMENT_SIZE PAGE_SIZE
+#define TEXT_START_ADDR PAGE_SIZE /* Location 0 is not accessible */
-#define N_BADMAG(x) \
- (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \
- && N_MAGIC(x) != ZMAGIC)
+/* Non-default definitions of the accessor macros... */
+/* Offset in a.out file of the text section. For ZMAGIC, the text section
+ actually includes the a.out header. */
#define N_TXTOFF(x) ( (N_MAGIC((x)) == ZMAGIC) ? 0 : sizeof(struct exec) )
-#define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text )
-#define N_TRELOFF(x) ( N_DATOFF(x) + (x).a_data )
-#define N_DRELOFF(x) ( N_TRELOFF(x) + (x).a_trsize )
-#define N_SYMOFF(x) ( N_DRELOFF(x) + (x).a_drsize )
-#define N_STROFF(x) ( N_SYMOFF(x) + (x).a_syms )
+/* Virtual Address of text segment from the a.out file. For OMAGIC,
+ (almost always "unlinked .o's" these days), should be zero.
+ Sun added a kludge so that shared libraries linked ZMAGIC get
+ an address of zero if a_entry (!!!) is lower than the otherwise
+ expected text address. These kludges have gotta go!
+ For linked files, should reflect reality if we know it. */
+
+#define N_TXTADDR(x) \
+ (N_MAGIC(x)==OMAGIC? 0 \
+ : (N_MAGIC(x) == ZMAGIC && (x).a_entry < TEXT_START_ADDR)? 0 \
+ : TEXT_START_ADDR)