aboutsummaryrefslogtreecommitdiff
path: root/bfd/aout-target.h
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1992-10-08 16:02:09 +0000
committerSteve Chamberlain <sac@cygnus>1992-10-08 16:02:09 +0000
commit294eaca479e9ced9a87b958c37feb2c570aa1595 (patch)
treebb7a6bb0ac1df535df9c7fe230c1a0bc81b85ab3 /bfd/aout-target.h
parent0da7012441eaccf157dc44c8cc110fbf2d3f8376 (diff)
downloadgdb-294eaca479e9ced9a87b958c37feb2c570aa1595.zip
gdb-294eaca479e9ced9a87b958c37feb2c570aa1595.tar.gz
gdb-294eaca479e9ced9a87b958c37feb2c570aa1595.tar.bz2
Some of these are guesses, if you know different, just yell.
Thu Oct 8 08:52:48 1992 Steve Chamberlain (sac@thepub.cygnus.com) Now a bfd knows whether underscores are normally prepended to symbols in its file format. Helps with error messages. * aout-adobe.c, aout-target.h, bout.c, coff-a29k.c, coff-h8300.c, coff-z8k.c: targets set so they have leading underscore * coff-i386.c, coff-i960.c, coff-m68k.c, coff-mips.c, coff-m88k.c, coff-rs6000.c, coff-we32k.c, elf.c, ieee.c, srec.c: targets set without leading underscore flag * targets.c: add symbol leading char to xvec description * bfd-in.h (bfd_get_symbol_leading_char): new macro.
Diffstat (limited to 'bfd/aout-target.h')
-rw-r--r--bfd/aout-target.h45
1 files changed, 41 insertions, 4 deletions
diff --git a/bfd/aout-target.h b/bfd/aout-target.h
index 46d1cbf..3dec207 100644
--- a/bfd/aout-target.h
+++ b/bfd/aout-target.h
@@ -29,8 +29,9 @@ DEFUN(MY(callback),(abfd),
bfd *abfd)
{
struct internal_exec *execp = exec_hdr (abfd);
-
-/* Calculate the file positions of the parts of a newly read aout header */
+ struct aout_backend_data *abdp;
+
+ /* Calculate the file positions of the parts of a newly read aout header */
obj_textsec (abfd)->_raw_size = N_TXTSIZE(*execp);
/* The virtual memory addresses of the sections */
@@ -57,6 +58,9 @@ DEFUN(MY(callback),(abfd),
bfd_default_set_arch_mach(abfd, DEFAULT_ARCH, 0);
#endif
+ /* Don't set sizes now -- can't be sure until we know arch & mach.
+ Sizes get set in set_sizes callback, later. */
+#if 0
adata(abfd).page_size = PAGE_SIZE;
#ifdef SEGMENT_SIZE
adata(abfd).segment_size = SEGMENT_SIZE;
@@ -64,6 +68,7 @@ DEFUN(MY(callback),(abfd),
adata(abfd).segment_size = PAGE_SIZE;
#endif
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
+#endif
return abfd->xvec;
}
@@ -124,6 +129,8 @@ DEFUN(MY(mkobject),(abfd),
{
if (NAME(aout,mkobject)(abfd) == false)
return false;
+#if 0 /* Sizes get set in set_sizes callback, later, after we know
+ the architecture and machine. */
adata(abfd).page_size = PAGE_SIZE;
#ifdef SEGMENT_SIZE
adata(abfd).segment_size = SEGMENT_SIZE;
@@ -131,6 +138,7 @@ DEFUN(MY(mkobject),(abfd),
adata(abfd).segment_size = PAGE_SIZE;
#endif
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
+#endif
return true;
}
#define MY_mkobject MY(mkobject)
@@ -162,6 +170,32 @@ DEFUN(MY(write_object_contents),(abfd),
#define MY_write_object_contents MY(write_object_contents)
#endif
+#ifndef MY_set_sizes
+static boolean
+DEFUN(MY(set_sizes),(abfd), bfd *abfd)
+{
+ adata(abfd).page_size = PAGE_SIZE;
+#ifdef SEGMENT_SIZE
+ adata(abfd).segment_size = SEGMENT_SIZE;
+#else
+ adata(abfd).segment_size = PAGE_SIZE;
+#endif
+ adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
+ return true;
+}
+#define MY_set_sizes MY(set_sizes)
+#endif
+
+#ifndef MY_backend_data
+static CONST struct aout_backend_data MY(backend_data) = {
+ 0, /* zmagic contiguous */
+ 0, /* text incl header */
+ 0, /* text vma? */
+ MY_set_sizes,
+};
+#define MY_backend_data &MY(backend_data)
+#endif
+
/* We assume BFD generic archive files. */
#ifndef MY_openr_next_archived_file
#define MY_openr_next_archived_file bfd_generic_openr_next_archived_file
@@ -291,8 +325,10 @@ DEFUN(MY(write_object_contents),(abfd),
#ifndef MY_make_debug_symbol
#define MY_make_debug_symbol 0
#endif
-#ifndef MY_backend_data
-#define MY_backend_data (PTR) 0
+
+/* Aout symbols normally have leading underscores */
+#ifndef MY_symbol_leading_char
+#define MY_symbol_leading_char '_'
#endif
bfd_target MY(vec) =
@@ -310,6 +346,7 @@ bfd_target MY(vec) =
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ MY_symbol_leading_char,
' ', /* ar_pad_char */
15, /* ar_max_namelen */
1, /* minimum alignment */