aboutsummaryrefslogtreecommitdiff
path: root/bfd/aoutx.h
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1994-07-05 21:50:43 +0000
committerStan Shebs <shebs@codesourcery.com>1994-07-05 21:50:43 +0000
commit11676adc147c73e8034629e386f9c28066eed561 (patch)
tree53b9cfa5a682155641c2dffc2e7546afc91d4e9a /bfd/aoutx.h
parent10f67315f93ce4aa1957d66b97124143431904a1 (diff)
downloadgdb-11676adc147c73e8034629e386f9c28066eed561.zip
gdb-11676adc147c73e8034629e386f9c28066eed561.tar.gz
gdb-11676adc147c73e8034629e386f9c28066eed561.tar.bz2
Mach 3 support.
* config.bfd (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*): New targets. * configure.host (i[34]86-*-mach3*, ns32k-*-mach3*): Recognize "mach3" instead of "mach". (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*): New hosts. * targets.c (m88kmach3_vec): New target vector. (bfd_target_vector): Add i386mach3_vec and m88kmach3_vec, but inside #if 0. * aoutx.h (some_aout_object_p) [MACH]: Recognize executables by checking for execute permission, instead of looking at entry point. * i386mach3.c: Update, define MACH, N_TXTOFF, N_TXTADDR, N_SHARED_LIB, don't include aout/*.h files, etc. * m88kmach3.c: New file, m88k Mach 3 target. * config/m88k-mach3.mt, config/mips-mach3.mt: New files, target makefile fragments. * config/i386mach3.mh, config/m88kmach3.mh, config/mipsmach3.mh: New files, host makefile fragments. * hosts/m88kmach3.h, hosts/mipsmach3.h: New files, host definitions.
Diffstat (limited to 'bfd/aoutx.h')
-rw-r--r--bfd/aoutx.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 42ec797..c53b446 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -481,15 +481,12 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p)
obj_datasec (abfd)->_raw_size = execp->a_data;
obj_bsssec (abfd)->_raw_size = execp->a_bss;
- /* If this object is dynamically linked, we assume that both
- sections have relocs. This does no real harm, even though it may
- not be true. */
obj_textsec (abfd)->flags =
- (execp->a_trsize != 0 || (abfd->flags & DYNAMIC) != 0
+ (execp->a_trsize != 0
? (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS | SEC_RELOC)
: (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS));
obj_datasec (abfd)->flags =
- (execp->a_drsize != 0 || (abfd->flags & DYNAMIC) != 0
+ (execp->a_drsize != 0
? (SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS | SEC_RELOC)
: (SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS));
obj_bsssec (abfd)->flags = SEC_ALLOC;
@@ -553,6 +550,19 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p)
result = (*callback_to_real_object_p)(abfd);
+#ifdef MACH
+ /* Stat the file to decide whether or not it's executable.
+ Many Mach programs use text at very unconventional addresses,
+ including the emulator, so the standard heuristic is incorrect. */
+ {
+ struct stat st;
+
+ stat (abfd->filename, &st);
+ /* Are any exec 'x' bits on? */
+ if (st.st_mode & 0111)
+ abfd->flags |= EXEC_P;
+ }
+#else /* ! MACH */
/* Now that the segment addresses have been worked out, take a better
guess at whether the file is executable. If the entry point
is within the text segment, assume it is. (This makes files
@@ -564,6 +574,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p)
if ((execp->a_entry >= obj_textsec(abfd)->vma) &&
(execp->a_entry < obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size))
abfd->flags |= EXEC_P;
+#endif /* MACH */
if (result)
{
#if 0 /* These should be set correctly anyways. */