No functional changes here.
BTW, some of these headers don't seem to be used anywhere:
include/aout/dynix3.h, include/aout/encap.h, include/aout/hp.h,
gas/config/aout_gnu.h
bfd/
* aout-adobe.c: Invoke aout N_* macros with pointer to
struct internal_exec.
* aout-arm.c: Likewise.
* aout-cris.c: Likewise.
* aout-target.h: Likewise.
* aout-tic30.c: Likewise.
* aoutf1.h: Likewise.
* aoutx.h: Likewise.
* bout.c: Likewise.
* freebsd.h: Likewise.
* gen-aout.c: Likewise.
* hp300hpux.c: Likewise.
* i386aout.c: Likewise.
* i386linux.c: Likewise.
* i386lynx.c: Likewise.
* i386mach3.c: Likewise.
* i386os9k.c: Likewise.
* libaout.h: Likewise.
* m68klinux.c: Likewise.
* m88kmach3.c: Likewise.
* mipsbsd.c: Likewise.
* netbsd.h: Likewise.
* pc532-mach.c: Likewise.
* pdp11.c: Likewise.
* riscix.c: Likewise.
* sparclinux.c: Likewise.
* sparclynx.c: Likewise.
gas/
* config/aout_gnu.h: Invoke aout N_* macros with pointer to
struct internal_exec.
include/
* bout.h: Invoke aout N_* macros with pointer to
struct internal_exec.
* os9k.h: Likewise.
include/aout/
* adobe.h: Invoke aout N_* macros with pointer to
struct internal_exec.
* aout64.h: Likewise.
* dynix3.h: Likewise.
* encap.h: Likewise.
* hp.h: Likewise.
* hp300hpux.h: Likewise.
* sun4.h: Likewise.
+2015-12-01 Alan Modra <amodra@gmail.com>
+
+ * aout-adobe.c: Invoke aout N_* macros with pointer to
+ struct internal_exec.
+ * aout-arm.c: Likewise.
+ * aout-cris.c: Likewise.
+ * aout-target.h: Likewise.
+ * aout-tic30.c: Likewise.
+ * aoutf1.h: Likewise.
+ * aoutx.h: Likewise.
+ * bout.c: Likewise.
+ * freebsd.h: Likewise.
+ * gen-aout.c: Likewise.
+ * hp300hpux.c: Likewise.
+ * i386aout.c: Likewise.
+ * i386linux.c: Likewise.
+ * i386lynx.c: Likewise.
+ * i386mach3.c: Likewise.
+ * i386os9k.c: Likewise.
+ * libaout.h: Likewise.
+ * m68klinux.c: Likewise.
+ * m88kmach3.c: Likewise.
+ * mipsbsd.c: Likewise.
+ * netbsd.h: Likewise.
+ * pc532-mach.c: Likewise.
+ * pdp11.c: Likewise.
+ * riscix.c: Likewise.
+ * sparclinux.c: Likewise.
+ * sparclynx.c: Likewise.
+
2015-12-01 Alan Modra <amodra@gmail.com>
* coff-rs6000.c (_bfd_xcoff_put_symbol_name): Replace abfd param
bfd_set_arch_mach (abfd, bfd_arch_unknown, 0L);
/* The positions of the string table and symbol table. */
- obj_str_filepos (abfd) = N_STROFF (*execp);
- obj_sym_filepos (abfd) = N_SYMOFF (*execp);
+ obj_str_filepos (abfd) = N_STROFF (execp);
+ obj_sym_filepos (abfd) = N_SYMOFF (execp);
/* Suck up the section information from the file, one section at a time. */
for (;;)
switch (ext->e_type[0])
{
case N_TEXT:
- sect->rel_filepos = N_TRELOFF (*execp);
+ sect->rel_filepos = N_TRELOFF (execp);
sect->reloc_count = execp->a_trsize;
break;
case N_DATA:
- sect->rel_filepos = N_DRELOFF (*execp);
+ sect->rel_filepos = N_DRELOFF (execp);
sect->reloc_count = execp->a_drsize;
break;
If the environment variable GNUTARGET is set to "a.out.adobe", we will
take just about any a.out file as an Adobe a.out file. FIXME! */
- if (N_BADMAG (anexec))
+ if (N_BADMAG (&anexec))
{
targ = getenv ("GNUTARGET");
if (targ && !strcmp (targ, aout_adobe_vec.name))
/* Now write out reloc info, followed by syms and strings. */
if (bfd_get_symcount (abfd) != 0)
{
- if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*exec_hdr (abfd))), SEEK_SET)
+ if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (exec_hdr (abfd))), SEEK_SET)
!= 0)
return FALSE;
if (! aout_32_write_syms (abfd))
return FALSE;
- if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*exec_hdr (abfd))), SEEK_SET)
+ if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (exec_hdr (abfd))), SEEK_SET)
!= 0)
return FALSE;
if (!aout_32_squirt_out_relocs (abfd, sect))
return FALSE;
- if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*exec_hdr (abfd))), SEEK_SET)
+ if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (exec_hdr (abfd))), SEEK_SET)
!= 0)
return FALSE;
{
/* Assign file offsets to sections. Text sections are first, and
are contiguous. Then data sections. Everything else at the end. */
- section_start = N_TXTOFF (ignore<-->me);
+ section_start = N_TXTOFF (0);
for (sect = abfd->sections; sect; sect = sect->next)
{
: ((N_MAGIC (x) != ZMAGIC) \
? (bfd_vma) 0 \
: ((N_SHARED_LIB (x)) \
- ? ((x).a_entry & ~(bfd_vma) (TARGET_PAGE_SIZE - 1)) \
+ ? ((x)->a_entry & ~(bfd_vma) (TARGET_PAGE_SIZE - 1)) \
: (bfd_vma) TEXT_START_ADDR)))
#define TEXT_START_ADDR 0x8000
#define DEFAULT_ARCH bfd_arch_arm
#define MY(OP) CONCAT2 (arm_aout_,OP)
-#define N_BADMAG(x) ((((x).a_info & ~007200) != ZMAGIC) && \
- (((x).a_info & ~006000) != OMAGIC) && \
- ((x).a_info != NMAGIC))
-#define N_MAGIC(x) ((x).a_info & ~07200)
+#define N_BADMAG(x) ((((x)->a_info & ~007200) != ZMAGIC) && \
+ (((x)->a_info & ~006000) != OMAGIC) && \
+ ((x)->a_info != NMAGIC))
+#define N_MAGIC(x) ((x)->a_info & ~07200)
#define MY_bfd_reloc_type_lookup arm_aout_bfd_reloc_type_lookup
#define MY_bfd_reloc_name_lookup arm_aout_bfd_reloc_name_lookup
after text, but with those, we don't have any choice besides reading
symbol info, and luckily there's no pressing need for correctness for
those vma:s at this time. */
-#define N_TXTADDR(x) ((x).a_entry & ~(bfd_vma) 0xffff)
+#define N_TXTADDR(x) ((x)->a_entry & ~(bfd_vma) 0xffff)
/* If you change this to 4, you can not link to an address N*4+2. */
#define SEGMENT_SIZE 2
not call set_sizes. */
#define MY_set_arch_mach NAME (aout, set_arch_mach)
-#define SET_ARCH_MACH(BFD, EXEC) \
- MY_set_arch_mach (BFD, DEFAULT_ARCH, N_MACHTYPE (EXEC))
+#define SET_ARCH_MACH(BFD, EXECP) \
+ MY_set_arch_mach (BFD, DEFAULT_ARCH, N_MACHTYPE (EXECP))
/* These macros describe the binary layout of the reloc information we
use in a file. */
/* Setting N_SET_MACHTYPE and using N_SET_FLAGS is not performed by
the default definition. */
if (bfd_get_arch (abfd) == bfd_arch_cris)
- N_SET_MACHTYPE (*execp, M_CRIS);
+ N_SET_MACHTYPE (execp, M_CRIS);
- N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags);
+ N_SET_FLAGS (execp, aout_backend_info (abfd)->exec_hdr_flags);
WRITE_HEADERS (abfd, execp);
unsigned long arch_align;
/* Calculate the file positions of the parts of a newly read aout header. */
- obj_textsec (abfd)->size = N_TXTSIZE (*execp);
+ obj_textsec (abfd)->size = N_TXTSIZE (execp);
/* The virtual memory addresses of the sections. */
- obj_textsec (abfd)->vma = N_TXTADDR (*execp);
- obj_datasec (abfd)->vma = N_DATADDR (*execp);
- obj_bsssec (abfd)->vma = N_BSSADDR (*execp);
+ obj_textsec (abfd)->vma = N_TXTADDR (execp);
+ obj_datasec (abfd)->vma = N_DATADDR (execp);
+ obj_bsssec (abfd)->vma = N_BSSADDR (execp);
/* For some targets, if the entry point is not in the same page
as the start of the text, then adjust the VMA so that it is.
obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
/* The file offsets of the sections. */
- obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
- obj_datasec (abfd)->filepos = N_DATOFF (*execp);
+ obj_textsec (abfd)->filepos = N_TXTOFF (execp);
+ obj_datasec (abfd)->filepos = N_DATOFF (execp);
/* The file offsets of the relocation info. */
- obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
- obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
+ obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
+ obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
/* The file offsets of the string table and symbol table. */
- obj_sym_filepos (abfd) = N_SYMOFF (*execp);
- obj_str_filepos (abfd) = N_STROFF (*execp);
+ obj_sym_filepos (abfd) = N_SYMOFF (execp);
+ obj_str_filepos (abfd) = N_STROFF (execp);
/* Determine the architecture and machine type of the object file. */
#ifdef SET_ARCH_MACH
- SET_ARCH_MACH (abfd, *execp);
+ SET_ARCH_MACH (abfd, execp);
#else
bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
#endif
exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
#endif
- if (N_BADMAG (exec))
+ if (N_BADMAG (&exec))
return 0;
#ifdef MACHTYPE_OK
- if (!(MACHTYPE_OK (N_MACHTYPE (exec))))
+ if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
return 0;
#endif
{
struct internal_exec *execp = exec_hdr (abfd);
- *ptreloff = N_TRELOFF (*execp);
- *pdreloff = N_DRELOFF (*execp);
- *psymoff = N_SYMOFF (*execp);
+ *ptreloff = N_TRELOFF (execp);
+ *pdreloff = N_DRELOFF (execp);
+ *psymoff = N_SYMOFF (execp);
}
#endif
unsigned long arch_align;
/* Calculate the file positions of the parts of a newly read aout header. */
- obj_textsec (abfd)->size = N_TXTSIZE (*execp);
+ obj_textsec (abfd)->size = N_TXTSIZE (execp);
/* The virtual memory addresses of the sections. */
- obj_textsec (abfd)->vma = N_TXTADDR (*execp);
- obj_datasec (abfd)->vma = N_DATADDR (*execp);
- obj_bsssec (abfd)->vma = N_BSSADDR (*execp);
+ obj_textsec (abfd)->vma = N_TXTADDR (execp);
+ obj_datasec (abfd)->vma = N_DATADDR (execp);
+ obj_bsssec (abfd)->vma = N_BSSADDR (execp);
obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
/* The file offsets of the sections. */
- obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
- obj_datasec (abfd)->filepos = N_DATOFF (*execp);
+ obj_textsec (abfd)->filepos = N_TXTOFF (execp);
+ obj_datasec (abfd)->filepos = N_DATOFF (execp);
/* The file offsets of the relocation info. */
- obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
- obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
+ obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
+ obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
/* The file offsets of the string table and symbol table. */
- obj_sym_filepos (abfd) = N_SYMOFF (*execp);
- obj_str_filepos (abfd) = N_STROFF (*execp);
+ obj_sym_filepos (abfd) = N_SYMOFF (execp);
+ obj_str_filepos (abfd) = N_STROFF (execp);
/* Determine the architecture and machine type of the object file. */
#ifdef SET_ARCH_MACH
- SET_ARCH_MACH (abfd, *execp);
+ SET_ARCH_MACH (abfd, execp);
#else
bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0L);
#endif
exec.a_info = H_GET_32 (abfd, exec_bytes.e_info);
#endif /* SWAP_MAGIC */
- if (N_BADMAG (exec))
+ if (N_BADMAG (&exec))
return 0;
#ifdef MACHTYPE_OK
- if (!(MACHTYPE_OK (N_MACHTYPE (exec))))
+ if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
return 0;
#endif
if (bfd_get_outsymbols (abfd) != (asymbol **) NULL
&& bfd_get_symcount (abfd) != 0)
{
- if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*execp)), SEEK_SET) != 0)
+ if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) != 0)
return FALSE;
if (!NAME (aout, write_syms) (abfd))
return FALSE;
}
- if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*execp)), SEEK_SET) != 0)
+ if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (execp)), SEEK_SET) != 0)
return FALSE;
if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd)))
return FALSE;
- if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*execp)), SEEK_SET) != 0)
+ if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp)), SEEK_SET) != 0)
return FALSE;
if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd)))
return FALSE;
bfd_set_arch_mach (abfd, arch, machine);
}
-#define SET_ARCH_MACH(ABFD, EXEC) \
- NAME(sunos,set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \
+#define SET_ARCH_MACH(ABFD, EXECP) \
+ NAME(sunos,set_arch_mach) (ABFD, N_MACHTYPE (EXECP)); \
choose_reloc_size(ABFD);
/* Determine the size of a relocation entry, based on the architecture. */
switch (bfd_get_mach (abfd))
{
case bfd_mach_m68000:
- N_SET_MACHTYPE (*execp, M_UNKNOWN);
+ N_SET_MACHTYPE (execp, M_UNKNOWN);
break;
case bfd_mach_m68010:
- N_SET_MACHTYPE (*execp, M_68010);
+ N_SET_MACHTYPE (execp, M_68010);
break;
default:
case bfd_mach_m68020:
- N_SET_MACHTYPE (*execp, M_68020);
+ N_SET_MACHTYPE (execp, M_68020);
break;
}
break;
switch (bfd_get_mach (abfd))
{
case bfd_mach_sparc_sparclet:
- N_SET_MACHTYPE (*execp, M_SPARCLET);
+ N_SET_MACHTYPE (execp, M_SPARCLET);
break;
case bfd_mach_sparc_sparclite_le:
- N_SET_MACHTYPE (*execp, M_SPARCLITE_LE);
+ N_SET_MACHTYPE (execp, M_SPARCLITE_LE);
break;
default:
- N_SET_MACHTYPE (*execp, M_SPARC);
+ N_SET_MACHTYPE (execp, M_SPARC);
break;
}
break;
case bfd_arch_i386:
- N_SET_MACHTYPE (*execp, M_386);
+ N_SET_MACHTYPE (execp, M_386);
break;
default:
- N_SET_MACHTYPE (*execp, M_UNKNOWN);
+ N_SET_MACHTYPE (execp, M_UNKNOWN);
}
choose_reloc_size (abfd);
- N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags);
+ N_SET_FLAGS (execp, aout_backend_info (abfd)->exec_hdr_flags);
- N_SET_DYNAMIC (*execp, (long)(bfd_get_file_flags (abfd) & DYNAMIC));
+ N_SET_DYNAMIC (execp, (long)(bfd_get_file_flags (abfd) & DYNAMIC));
WRITE_HEADERS (abfd, execp);
intcore->c_signo = H_GET_32 (abfd, &extcore->c_signo);
intcore->c_tsize = H_GET_32 (abfd, &extcore->c_tsize);
intcore->c_dsize = H_GET_32 (abfd, &extcore->c_dsize);
- intcore->c_data_addr = N_DATADDR (intcore->c_aouthdr);
+ intcore->c_data_addr = N_DATADDR (&intcore->c_aouthdr);
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
intcore->fp_stuff_pos = offsetof (struct external_sun3_core, fp_stuff);
intcore->c_signo = H_GET_32 (abfd, &extcore->c_signo);
intcore->c_tsize = H_GET_32 (abfd, &extcore->c_tsize);
intcore->c_dsize = H_GET_32 (abfd, &extcore->c_dsize);
- intcore->c_data_addr = N_DATADDR (intcore->c_aouthdr);
+ intcore->c_data_addr = N_DATADDR (&intcore->c_aouthdr);
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
intcore->fp_stuff_pos = offsetof (struct external_sparc_core, fp_stuff);
/* Setting of EXEC_P has been deferred to the bottom of this function. */
if (execp->a_syms)
abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
- if (N_DYNAMIC (*execp))
+ if (N_DYNAMIC (execp))
abfd->flags |= DYNAMIC;
- if (N_MAGIC (*execp) == ZMAGIC)
+ if (N_MAGIC (execp) == ZMAGIC)
{
abfd->flags |= D_PAGED | WP_TEXT;
adata (abfd).magic = z_magic;
}
- else if (N_MAGIC (*execp) == QMAGIC)
+ else if (N_MAGIC (execp) == QMAGIC)
{
abfd->flags |= D_PAGED | WP_TEXT;
adata (abfd).magic = z_magic;
adata (abfd).subformat = q_magic_format;
}
- else if (N_MAGIC (*execp) == NMAGIC)
+ else if (N_MAGIC (execp) == NMAGIC)
{
abfd->flags |= WP_TEXT;
adata (abfd).magic = n_magic;
}
- else if (N_MAGIC (*execp) == OMAGIC
- || N_MAGIC (*execp) == BMAGIC)
+ else if (N_MAGIC (execp) == OMAGIC
+ || N_MAGIC (execp) == BMAGIC)
adata (abfd).magic = o_magic;
else
/* Should have been checked with N_BADMAG before this routine
struct exec *execp = exec_hdr (abfd);
- obj_textsec (abfd)->size = N_TXTSIZE (*execp);
+ obj_textsec (abfd)->size = N_TXTSIZE (execp);
/* Data and bss are already filled in since they're so standard. */
/* The virtual memory addresses of the sections. */
- obj_textsec (abfd)->vma = N_TXTADDR (*execp);
- obj_datasec (abfd)->vma = N_DATADDR (*execp);
- obj_bsssec (abfd)->vma = N_BSSADDR (*execp);
+ obj_textsec (abfd)->vma = N_TXTADDR (execp);
+ obj_datasec (abfd)->vma = N_DATADDR (execp);
+ obj_bsssec (abfd)->vma = N_BSSADDR (execp);
/* The file offsets of the sections. */
- obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
- obj_datasec (abfd)->filepos = N_DATOFF (*execp);
+ obj_textsec (abfd)->filepos = N_TXTOFF (execp);
+ obj_datasec (abfd)->filepos = N_DATOFF (execp);
/* The file offsets of the relocation info. */
- obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
- obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
+ obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
+ obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
/* The file offsets of the string table and symbol table. */
- obj_str_filepos (abfd) = N_STROFF (*execp);
- obj_sym_filepos (abfd) = N_SYMOFF (*execp);
+ obj_str_filepos (abfd) = N_STROFF (execp);
+ obj_sym_filepos (abfd) = N_SYMOFF (execp);
/* Determine the architecture and machine type of the object file. */
- switch (N_MACHTYPE (*exec_hdr (abfd)))
+ switch (N_MACHTYPE (exec_hdr (abfd)))
{
default:
abfd->obj_arch = bfd_arch_obscure;
execp->a_text = obj_textsec (abfd)->size;
execp->a_data = obj_datasec (abfd)->size;
execp->a_bss = obj_bsssec (abfd)->size;
- N_SET_MAGIC (*execp, OMAGIC);
+ N_SET_MAGIC (execp, OMAGIC);
}
static void
if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
execp->a_text += adata (abfd).exec_bytes_size;
if (obj_aout_subformat (abfd) == q_magic_format)
- N_SET_MAGIC (*execp, QMAGIC);
+ N_SET_MAGIC (execp, QMAGIC);
else
- N_SET_MAGIC (*execp, ZMAGIC);
+ N_SET_MAGIC (execp, ZMAGIC);
/* Spec says data section should be rounded up to page boundary. */
obj_datasec (abfd)->size
execp->a_text = obj_textsec (abfd)->size;
execp->a_data = obj_datasec (abfd)->size;
execp->a_bss = obj_bsssec (abfd)->size;
- N_SET_MAGIC (*execp, NMAGIC);
+ N_SET_MAGIC (execp, NMAGIC);
}
bfd_boolean
);
/* The positions of the string table and symbol table. */
- obj_str_filepos (abfd) = N_STROFF (*execp);
- obj_sym_filepos (abfd) = N_SYMOFF (*execp);
+ obj_str_filepos (abfd) = N_STROFF (execp);
+ obj_sym_filepos (abfd) = N_SYMOFF (execp);
/* The alignments of the sections. */
obj_textsec (abfd)->alignment_power = execp->a_talign;
obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
/* The file positions of the sections. */
- obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
- obj_datasec (abfd)->filepos = N_DATOFF (*execp);
+ obj_textsec (abfd)->filepos = N_TXTOFF (execp);
+ obj_datasec (abfd)->filepos = N_DATOFF (execp);
/* The file positions of the relocation info. */
- obj_textsec (abfd)->rel_filepos = N_TROFF (*execp);
- obj_datasec (abfd)->rel_filepos = N_DROFF (*execp);
+ obj_textsec (abfd)->rel_filepos = N_TROFF (execp);
+ obj_datasec (abfd)->rel_filepos = N_DROFF (execp);
adata (abfd).page_size = 1; /* Not applicable. */
adata (abfd).segment_size = 1; /* Not applicable. */
anexec.a_info = H_GET_32 (abfd, exec_bytes.e_info);
- if (N_BADMAG (anexec))
+ if (N_BADMAG (&anexec))
{
bfd_set_error (bfd_error_wrong_format);
return 0;
b_out_symbol_cmp);
/* Back to your regularly scheduled program. */
- if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*exec_hdr (abfd))), SEEK_SET)
+ if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (exec_hdr (abfd))), SEEK_SET)
!= 0)
return FALSE;
if (! aout_32_write_syms (abfd))
return FALSE;
- if (bfd_seek (abfd, (file_ptr) (N_TROFF (*exec_hdr (abfd))), SEEK_SET)
+ if (bfd_seek (abfd, (file_ptr) (N_TROFF (exec_hdr (abfd))), SEEK_SET)
!= 0)
return FALSE;
if (!b_out_squirt_out_relocs (abfd, obj_textsec (abfd)))
return FALSE;
- if (bfd_seek (abfd, (file_ptr) (N_DROFF (*exec_hdr (abfd))), SEEK_SET)
+ if (bfd_seek (abfd, (file_ptr) (N_DROFF (exec_hdr (abfd))), SEEK_SET)
!= 0)
return FALSE;
/* ZMAGIC files start at offset 0. Does not apply to QMAGIC files. */
#define TEXT_START_ADDR 0
-#define N_GETMAGIC_NET(exec) \
- ((exec).a_info & 0xffff)
-#define N_GETMID_NET(exec) \
- (((exec).a_info >> 16) & 0x3ff)
-#define N_GETFLAG_NET(ex) \
- (((exec).a_info >> 26) & 0x3f)
-
-#define N_MACHTYPE(exec) \
+#define N_GETMAGIC_NET(execp) \
+ ((execp)->a_info & 0xffff)
+#define N_GETMID_NET(execp) \
+ (((execp)->a_info >> 16) & 0x3ff)
+#define N_GETFLAG_NET(exexp) \
+ (((execp)->a_info >> 26) & 0x3f)
+
+#define N_MACHTYPE(execp) \
((enum machine_type) \
- ((N_GETMAGIC_NET (exec) == ZMAGIC) ? N_GETMID_NET (exec) : \
- ((exec).a_info >> 16) & 0x3ff))
-#define N_FLAGS(exec) \
- ((N_GETMAGIC_NET (exec) == ZMAGIC) ? N_GETFLAG_NET (exec) : \
- ((exec).a_info >> 26) & 0x3f)
-
-#define N_SET_INFO(exec, magic, type, flags) \
- ((exec).a_info = ((magic) & 0xffff) \
+ ((N_GETMAGIC_NET (execp) == ZMAGIC) ? N_GETMID_NET (execp) : \
+ ((execp)->a_info >> 16) & 0x3ff))
+#define N_FLAGS(execp) \
+ ((N_GETMAGIC_NET (execp) == ZMAGIC) ? N_GETFLAG_NET (execp) : \
+ ((execp)->a_info >> 26) & 0x3f)
+
+#define N_SET_INFO(execp, magic, type, flags) \
+ ((execp)->a_info = ((magic) & 0xffff) \
| (((int)(type) & 0x3ff) << 16) \
| (((flags) & 0x3f) << 26))
-#define N_SET_MACHTYPE(exec, machtype) \
- ((exec).a_info = \
- ((exec).a_info & 0xfb00ffff) | ((((int) (machtype)) & 0x3ff) << 16))
-#define N_SET_FLAGS(exec, flags) \
- ((exec).a_info = \
- ((exec).a_info & 0x03ffffff) | ((flags & 0x03f) << 26))
+#define N_SET_MACHTYPE(execp, machtype) \
+ ((execp)->a_info = \
+ ((execp)->a_info & 0xfb00ffff) | ((((int) (machtype)) & 0x3ff) << 16))
+#define N_SET_FLAGS(execp, flags) \
+ ((execp)->a_info = \
+ ((execp)->a_info & 0x03ffffff) | ((flags & 0x03f) << 26))
#include "sysdep.h"
#include "bfd.h"
{
case bfd_arch_m68k:
if (strcmp (abfd->xvec->name, "a.out-m68k4k-netbsd") == 0)
- N_SET_MACHTYPE (*execp, M_68K4K_NETBSD);
+ N_SET_MACHTYPE (execp, M_68K4K_NETBSD);
else
- N_SET_MACHTYPE (*execp, M_68K_NETBSD);
+ N_SET_MACHTYPE (execp, M_68K_NETBSD);
break;
case bfd_arch_sparc:
- N_SET_MACHTYPE (*execp, M_SPARC_NETBSD);
+ N_SET_MACHTYPE (execp, M_SPARC_NETBSD);
break;
case bfd_arch_i386:
- N_SET_MACHTYPE (*execp, M_386_NETBSD);
+ N_SET_MACHTYPE (execp, M_386_NETBSD);
break;
case bfd_arch_ns32k:
- N_SET_MACHTYPE (*execp, M_532_NETBSD);
+ N_SET_MACHTYPE (execp, M_532_NETBSD);
break;
default:
- N_SET_MACHTYPE (*execp, M_UNKNOWN);
+ N_SET_MACHTYPE (execp, M_UNKNOWN);
break;
}
- WRITE_HEADERS(abfd, execp);
+ WRITE_HEADERS (abfd, execp);
return TRUE;
}
fclose (file);
#ifdef N_TXTOFF
- page_size = N_TXTOFF(my_exec);
+ page_size = N_TXTOFF (&my_exec);
if (page_size == 0)
printf ("#define N_HEADER_IN_TEXT(x) 1\n");
else
struct internal_exec *execp = exec_hdr (abfd);
/* Calculate the file positions of the parts of a newly read aout header */
- obj_textsec (abfd)->size = N_TXTSIZE (*execp);
+ obj_textsec (abfd)->size = N_TXTSIZE (execp);
/* The virtual memory addresses of the sections */
- obj_textsec (abfd)->vma = N_TXTADDR (*execp);
- obj_datasec (abfd)->vma = N_DATADDR (*execp);
- obj_bsssec (abfd)->vma = N_BSSADDR (*execp);
+ obj_textsec (abfd)->vma = N_TXTADDR (execp);
+ obj_datasec (abfd)->vma = N_DATADDR (execp);
+ obj_bsssec (abfd)->vma = N_BSSADDR (execp);
obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
/* The file offsets of the sections */
- obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
- obj_datasec (abfd)->filepos = N_DATOFF (*execp);
+ obj_textsec (abfd)->filepos = N_TXTOFF (execp);
+ obj_datasec (abfd)->filepos = N_DATOFF (execp);
/* The file offsets of the relocation info */
- obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
- obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
+ obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
+ obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
/* The file offsets of the string table and symbol table. */
- obj_sym_filepos (abfd) = N_SYMOFF (*execp);
- obj_str_filepos (abfd) = N_STROFF (*execp);
+ obj_sym_filepos (abfd) = N_SYMOFF (execp);
+ obj_str_filepos (abfd) = N_STROFF (execp);
/* Determine the architecture and machine type of the object file. */
#ifdef SET_ARCH_MACH
- SET_ARCH_MACH (abfd, *execp);
+ SET_ARCH_MACH (abfd, execp);
#else
bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
#endif
if (obj_aout_subformat (abfd) == gnu_encap_format)
{
/* The file offsets of the relocation info */
- obj_textsec (abfd)->rel_filepos = N_GNU_TRELOFF (*execp);
- obj_datasec (abfd)->rel_filepos = N_GNU_DRELOFF (*execp);
+ obj_textsec (abfd)->rel_filepos = N_GNU_TRELOFF (execp);
+ obj_datasec (abfd)->rel_filepos = N_GNU_DRELOFF (execp);
/* The file offsets of the string table and symbol table. */
- obj_sym_filepos (abfd) = N_GNU_SYMOFF (*execp);
+ obj_sym_filepos (abfd) = N_GNU_SYMOFF (execp);
obj_str_filepos (abfd) = (obj_sym_filepos (abfd) + execp->a_syms);
abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
execp->a_drsize = ((obj_datasec (abfd)->reloc_count) *
obj_reloc_entry_size (abfd));
- N_SET_MACHTYPE (*execp, 0xc);
- N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags);
+ N_SET_MACHTYPE (execp, 0xc);
+ N_SET_FLAGS (execp, aout_backend_info (abfd)->exec_hdr_flags);
NAME (aout,swap_exec_header_out) (abfd, execp, &exec_bytes);
if (bfd_get_symcount (abfd) != 0)
{
/* Skip the relocs to where we want to put the symbols. */
- if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*execp) + execp->a_drsize),
+ if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp) + execp->a_drsize),
SEEK_SET) != 0)
return FALSE;
}
if (bfd_get_symcount (abfd) != 0)
{
- if (bfd_seek (abfd, (file_ptr) N_TRELOFF (*execp), SEEK_CUR) != 0)
+ if (bfd_seek (abfd, (file_ptr) N_TRELOFF (execp), SEEK_CUR) != 0)
return FALSE;
if (!NAME (aout,squirt_out_relocs) (abfd, obj_textsec (abfd)))
return FALSE;
- if (bfd_seek (abfd, (file_ptr) N_DRELOFF (*execp), SEEK_CUR) != 0)
+ if (bfd_seek (abfd, (file_ptr) N_DRELOFF (execp), SEEK_CUR) != 0)
return FALSE;
if (!NAME (aout,squirt_out_relocs) (abfd, obj_datasec (abfd)))
return FALSE;
#define N_HEADER_IN_TEXT(x) 0
#define N_TXTOFF(x) 0x20
#define N_TXTADDR(x) (N_MAGIC (x) == ZMAGIC ? 0x1020 : 0)
-#define N_TXTSIZE(x) ((x).a_text)
+#define N_TXTSIZE(x) ((x)->a_text)
#define TARGET_PAGE_SIZE 4096
#define SEGMENT_SIZE 0x400000
#define DEFAULT_ARCH bfd_arch_i386
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
- N_SET_MACHTYPE (*execp, M_386);
+ N_SET_MACHTYPE (execp, M_386);
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
- N_SET_MACHTYPE (*execp, M_386);
+ N_SET_MACHTYPE (execp, M_386);
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
- WRITE_HEADERS(abfd, execp);
+ WRITE_HEADERS (abfd, execp);
return TRUE;
}
\
if (bfd_get_symcount (abfd) != 0) \
{ \
- if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*execp)), SEEK_SET) \
+ if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) \
!= 0) \
return FALSE; \
\
if (! NAME(aout,write_syms) (abfd)) return FALSE; \
\
- if (bfd_seek (abfd, (file_ptr) (N_TRELOFF(*execp)), SEEK_SET) \
+ if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (execp)), SEEK_SET) \
!= 0) \
return FALSE; \
\
if (!NAME(lynx,squirt_out_relocs) (abfd, obj_textsec (abfd))) \
return FALSE; \
- if (bfd_seek (abfd, (file_ptr) (N_DRELOFF(*execp)), SEEK_SET) \
+ if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp)), SEEK_SET) \
!= 0) \
return 0; \
\
/* This macro is only relevant when N_MAGIC(x) == ZMAGIC. */
#define N_HEADER_IN_TEXT(x) 1
-#define N_TXTSIZE(x) ((x).a_text)
+#define N_TXTSIZE(x) ((x)->a_text)
#include "sysdep.h"
#include "bfd.h"
obj_datasec (abfd)->filepos = execp->a_dload;
/* The file positions of the relocation info ***
- obj_textsec (abfd)->rel_filepos = N_TROFF(*execp);
- obj_datasec (abfd)->rel_filepos = N_DROFF(*execp); */
+ obj_textsec (abfd)->rel_filepos = N_TROFF (execp);
+ obj_datasec (abfd)->rel_filepos = N_DROFF (execp); */
adata (abfd).page_size = 1; /* Not applicable. */
adata (abfd).segment_size = 1;/* Not applicable. */
}
anexec.a_info = H_GET_16 (abfd, exec_bytes.m_sync);
- if (N_BADMAG (anexec))
+ if (N_BADMAG (&anexec))
{
bfd_set_error (bfd_error_wrong_format);
return 0;
M_CRIS = 255 /* Axis CRIS binary. */
};
-#define N_DYNAMIC(exec) ((exec).a_info & 0x80000000)
+#define N_DYNAMIC(execp) ((execp)->a_info & 0x80000000)
#ifndef N_MAGIC
-# define N_MAGIC(exec) ((exec).a_info & 0xffff)
+# define N_MAGIC(execp) ((execp)->a_info & 0xffff)
#endif
#ifndef N_MACHTYPE
-# define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
+# define N_MACHTYPE(execp) ((enum machine_type)(((execp)->a_info >> 16) & 0xff))
#endif
#ifndef N_FLAGS
-# define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
+# define N_FLAGS(execp) (((execp)->a_info >> 24) & 0xff)
#endif
#ifndef N_SET_INFO
-# define N_SET_INFO(exec, magic, type, flags) \
-((exec).a_info = ((magic) & 0xffff) \
+# define N_SET_INFO(execp, magic, type, flags) \
+((execp)->a_info = ((magic) & 0xffff) \
| (((int)(type) & 0xff) << 16) \
| (((flags) & 0xff) << 24))
#endif
#ifndef N_SET_DYNAMIC
-# define N_SET_DYNAMIC(exec, dynamic) \
-((exec).a_info = (dynamic) ? (long) ((exec).a_info | 0x80000000) : \
-((exec).a_info & 0x7fffffff))
+# define N_SET_DYNAMIC(execp, dynamic) \
+((execp)->a_info = (dynamic) ? (long) ((execp)->a_info | 0x80000000) : \
+((execp)->a_info & 0x7fffffff))
#endif
#ifndef N_SET_MAGIC
-# define N_SET_MAGIC(exec, magic) \
-((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
+# define N_SET_MAGIC(execp, magic) \
+((execp)->a_info = (((execp)->a_info & 0xffff0000) | ((magic) & 0xffff)))
#endif
#ifndef N_SET_MACHTYPE
-# define N_SET_MACHTYPE(exec, machtype) \
-((exec).a_info = \
- ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
+# define N_SET_MACHTYPE(execp, machtype) \
+((execp)->a_info = \
+ ((execp)->a_info & 0xff00ffff) | ((((int) (machtype)) &0xff) << 16))
#endif
#ifndef N_SET_FLAGS
-# define N_SET_FLAGS(exec, flags) \
-((exec).a_info = \
- ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
+# define N_SET_FLAGS(execp, flags) \
+((execp)->a_info = \
+ ((execp)->a_info & 0x00ffffff) | (((flags) & 0xff) << 24))
#endif
typedef struct aout_symbol
if (bfd_get_outsymbols (abfd) != NULL \
&& bfd_get_symcount (abfd) != 0) \
{ \
- if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*execp)), SEEK_SET) != 0)\
+ if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) != 0)\
return FALSE; \
\
if (! NAME (aout, write_syms) (abfd)) \
return FALSE; \
} \
\
- if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*execp)), SEEK_SET) != 0) \
+ if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (execp)), SEEK_SET) != 0) \
return FALSE; \
if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd))) \
return FALSE; \
\
- if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*execp)), SEEK_SET) != 0) \
+ if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp)), SEEK_SET) != 0) \
return FALSE; \
if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd))) \
return FALSE; \
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
- N_SET_MACHTYPE (*execp, M_68020);
+ N_SET_MACHTYPE (execp, M_68020);
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
- WRITE_HEADERS(abfd, execp);
+ WRITE_HEADERS (abfd, execp);
return TRUE;
}
#define TEXT_START_ADDR 0
#define N_HEADER_IN_TEXT(x) 1 /* (N_MAGIG(x) == ZMAGIC) */
-#define N_TXTSIZE(x) ((x).a_text)
+#define N_TXTSIZE(x) ((x)->a_text)
#include "sysdep.h"
#include "bfd.h"
/* #define ENTRY_CAN_BE_ZERO */
#define N_HEADER_IN_TEXT(x) 1
#define N_TXTADDR(x) \
- (N_MAGIC(x) != ZMAGIC ? (x).a_entry : /* object file or NMAGIC */\
+ (N_MAGIC(x) != ZMAGIC ? (x)->a_entry : /* object file or NMAGIC */\
TEXT_START_ADDR + EXEC_BYTES_SIZE /* no padding */\
)
#define N_DATADDR(x) (N_TXTADDR(x)+N_TXTSIZE(x))
#include "libbfd.h"
#include "libaout.h"
-#define SET_ARCH_MACH(ABFD, EXEC) \
- MY(set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \
+#define SET_ARCH_MACH(ABFD, EXECP) \
+ MY(set_arch_mach) (ABFD, N_MACHTYPE (EXECP)); \
MY(choose_reloc_size) (ABFD);
static void MY(set_arch_mach) (bfd *, unsigned long);
static void MY(choose_reloc_size) (bfd *);
switch (bfd_get_mach (abfd))
{
case bfd_mach_m68010:
- N_SET_MACHTYPE (*execp, M_68010);
+ N_SET_MACHTYPE (execp, M_68010);
break;
default:
case bfd_mach_m68020:
- N_SET_MACHTYPE (*execp, M_68020);
+ N_SET_MACHTYPE (execp, M_68020);
break;
}
break;
case bfd_arch_sparc:
- N_SET_MACHTYPE (*execp, M_SPARC);
+ N_SET_MACHTYPE (execp, M_SPARC);
break;
case bfd_arch_i386:
- N_SET_MACHTYPE (*execp, M_386);
+ N_SET_MACHTYPE (execp, M_386);
break;
case bfd_arch_mips:
switch (bfd_get_mach (abfd))
{
case bfd_mach_mips4000:
case bfd_mach_mips6000:
- N_SET_MACHTYPE (*execp, M_MIPS2);
+ N_SET_MACHTYPE (execp, M_MIPS2);
break;
default:
- N_SET_MACHTYPE (*execp, M_MIPS1);
+ N_SET_MACHTYPE (execp, M_MIPS1);
break;
}
break;
default:
- N_SET_MACHTYPE (*execp, M_UNKNOWN);
+ N_SET_MACHTYPE (execp, M_UNKNOWN);
}
MY (choose_reloc_size) (abfd);
#define N_SHARED_LIB(x) (N_DYNAMIC (x))
/* We have 6 bits of flags and 10 bits of machine ID. */
-#define N_MACHTYPE(exec) \
- ((enum machine_type) (((exec).a_info >> 16) & 0x03ff))
-#define N_FLAGS(exec) \
- (((exec).a_info >> 26) & 0x3f)
+#define N_MACHTYPE(execp) \
+ ((enum machine_type) (((execp)->a_info >> 16) & 0x03ff))
+#define N_FLAGS(execp) \
+ (((execp)->a_info >> 26) & 0x3f)
-#define N_SET_INFO(exec, magic, type, flags) \
- ((exec).a_info = ((magic) & 0xffff) \
+#define N_SET_INFO(execp, magic, type, flags) \
+ ((execp)->a_info = ((magic) & 0xffff) \
| (((int) (type) & 0x3ff) << 16) \
| (((flags) & 0x3f) << 24))
-#define N_SET_MACHTYPE(exec, machtype) \
- ((exec).a_info = \
- ((exec).a_info & 0xfb00ffff) | ((((int) (machtype)) & 0x3ff) << 16))
-#define N_SET_FLAGS(exec, flags) \
- ((exec).a_info = \
- ((exec).a_info & 0x03ffffff) | ((flags & 0x03f) << 26))
+#define N_SET_MACHTYPE(execp, machtype) \
+ ((execp)->a_info = \
+ ((execp)->a_info & 0xfb00ffff) | ((((int) (machtype)) & 0x3ff) << 16))
+#define N_SET_FLAGS(execp, flags) \
+ ((execp)->a_info = \
+ ((execp)->a_info & 0x03ffffff) | ((flags & 0x03f) << 26))
#include "sysdep.h"
#include "bfd.h"
switch (bfd_get_arch(abfd))
{
case DEFAULT_ARCH:
- N_SET_MACHTYPE(*execp, DEFAULT_MID);
+ N_SET_MACHTYPE (execp, DEFAULT_MID);
break;
default:
- N_SET_MACHTYPE(*execp, M_UNKNOWN);
+ N_SET_MACHTYPE (execp, M_UNKNOWN);
break;
}
1 and specially define our own N_TXTSIZE. */
#define N_HEADER_IN_TEXT(x) 1
-#define N_TXTSIZE(x) ((x).a_text)
+#define N_TXTSIZE(x) ((x)->a_text)
#define TEXT_START_ADDR 0x10000 /* from old ld */
#define TARGET_PAGE_SIZE 0x1000 /* from old ld, 032 & 532 are really 512/4k */
/* Use a_entry of 0 to distinguish object files from OMAGIC executables */
#define N_TXTADDR(x) \
(N_MAGIC(x) == OMAGIC ? \
- ((x).a_entry < TEXT_START_ADDR? 0: TEXT_START_ADDR): \
+ ((x)->a_entry < TEXT_START_ADDR? 0: TEXT_START_ADDR): \
(N_MAGIC(x) == NMAGIC? TEXT_START_ADDR: \
TEXT_START_ADDR + EXEC_BYTES_SIZE))
switch (bfd_get_mach (abfd))
{
case 32032:
- N_SET_MACHTYPE (*execp, M_NS32032);
+ N_SET_MACHTYPE (execp, M_NS32032);
break;
case 32532:
default:
- N_SET_MACHTYPE (*execp, M_NS32532);
+ N_SET_MACHTYPE (execp, M_NS32532);
break;
}
- N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags);
+ N_SET_FLAGS (execp, aout_backend_info (abfd)->exec_hdr_flags);
- WRITE_HEADERS(abfd, execp);
+ WRITE_HEADERS (abfd, execp);
return TRUE;
}
#define N_HEADER_IN_TEXT(x) 0
/* There is no flags field. */
-#define N_FLAGS(exec) 0
+#define N_FLAGS(execp) 0
-#define N_SET_FLAGS(exec, flags) do { } while (0)
+#define N_SET_FLAGS(execp, flags) do { } while (0)
#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
&& N_MAGIC(x) != NMAGIC \
&& N_MAGIC(x) != ZMAGIC)
#define EXTERNAL_NLIST_SIZE 8
#define N_TXTOFF(x) (EXEC_BYTES_SIZE)
-#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)
+#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)
#define WRITE_HEADERS(abfd, execp) pdp11_aout_write_headers (abfd, execp)
if (bfd_get_outsymbols (abfd) != NULL
&& bfd_get_symcount (abfd) != 0)
{
- if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*execp)), SEEK_SET) != 0)
+ if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) != 0)
return FALSE;
if (! NAME (aout, write_syms) (abfd))
if (obj_textsec (abfd)->reloc_count > 0
|| obj_datasec (abfd)->reloc_count > 0)
{
- if (bfd_seek (abfd, (file_ptr) (N_TRELOFF(*execp)), SEEK_SET) != 0
+ if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (execp)), SEEK_SET) != 0
|| !NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd))
- || bfd_seek (abfd, (file_ptr) (N_DRELOFF(*execp)), SEEK_SET) != 0
+ || bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp)), SEEK_SET) != 0
|| !NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd)))
return FALSE;
}
/* Setting of EXEC_P has been deferred to the bottom of this function. */
if (execp->a_syms)
abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
- if (N_DYNAMIC(*execp))
+ if (N_DYNAMIC (execp))
abfd->flags |= DYNAMIC;
- if (N_MAGIC (*execp) == ZMAGIC)
+ if (N_MAGIC (execp) == ZMAGIC)
{
abfd->flags |= D_PAGED | WP_TEXT;
adata (abfd).magic = z_magic;
}
- else if (N_MAGIC (*execp) == NMAGIC)
+ else if (N_MAGIC (execp) == NMAGIC)
{
abfd->flags |= WP_TEXT;
adata (abfd).magic = n_magic;
}
- else if (N_MAGIC (*execp) == OMAGIC)
+ else if (N_MAGIC (execp) == OMAGIC)
adata (abfd).magic = o_magic;
else
{
in by the callback: */
struct exec *execp = exec_hdr (abfd);
- obj_textsec (abfd)->size = N_TXTSIZE(*execp);
+ obj_textsec (abfd)->size = N_TXTSIZE (execp);
/* Data and bss are already filled in since they're so standard. */
/* The virtual memory addresses of the sections. */
- obj_textsec (abfd)->vma = N_TXTADDR(*execp);
- obj_datasec (abfd)->vma = N_DATADDR(*execp);
- obj_bsssec (abfd)->vma = N_BSSADDR(*execp);
+ obj_textsec (abfd)->vma = N_TXTADDR (execp);
+ obj_datasec (abfd)->vma = N_DATADDR (execp);
+ obj_bsssec (abfd)->vma = N_BSSADDR (execp);
/* The file offsets of the sections. */
- obj_textsec (abfd)->filepos = N_TXTOFF(*execp);
- obj_datasec (abfd)->filepos = N_DATOFF(*execp);
+ obj_textsec (abfd)->filepos = N_TXTOFF (execp);
+ obj_datasec (abfd)->filepos = N_DATOFF (execp);
/* The file offsets of the relocation info. */
- obj_textsec (abfd)->rel_filepos = N_TRELOFF(*execp);
- obj_datasec (abfd)->rel_filepos = N_DRELOFF(*execp);
+ obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
+ obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
/* The file offsets of the string table and symbol table. */
- obj_str_filepos (abfd) = N_STROFF (*execp);
- obj_sym_filepos (abfd) = N_SYMOFF (*execp);
+ obj_str_filepos (abfd) = N_STROFF (execp);
+ obj_sym_filepos (abfd) = N_SYMOFF (execp);
/* Determine the architecture and machine type of the object file. */
abfd->obj_arch = bfd_arch_obscure;
execp->a_text = obj_textsec (abfd)->size;
execp->a_data = obj_datasec (abfd)->size;
execp->a_bss = obj_bsssec (abfd)->size;
- N_SET_MAGIC (*execp, OMAGIC);
+ N_SET_MAGIC (execp, OMAGIC);
}
static void
execp->a_text = obj_textsec(abfd)->size;
if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
execp->a_text += adata(abfd).exec_bytes_size;
- N_SET_MAGIC (*execp, ZMAGIC);
+ N_SET_MAGIC (execp, ZMAGIC);
/* Spec says data section should be rounded up to page boundary. */
obj_datasec(abfd)->size
execp->a_text = obj_textsec(abfd)->size;
execp->a_data = obj_datasec(abfd)->size;
execp->a_bss = obj_bsssec(abfd)->size;
- N_SET_MAGIC (*execp, NMAGIC);
+ N_SET_MAGIC (execp, NMAGIC);
}
bfd_boolean
/* Sl which uses another. */
#define SLPZMAGIC (MF_USES_SL | SLZMAGIC)
-#define N_SHARED_LIB(x) ((x).a_info & MF_USES_SL)
+#define N_SHARED_LIB(x) ((x)->a_info & MF_USES_SL)
/* Only a pure OMAGIC file has the minimal header. */
#define N_TXTOFF(x) \
- ((x).a_info == OMAGIC \
+ ((x)->a_info == OMAGIC \
? 32 \
: (N_MAGIC(x) == ZMAGIC \
? TARGET_PAGE_SIZE \
up we can't know exactly what the address will be. A reasonable guess \
is that a_entry will be in the first page of the executable. */ \
: (N_SHARED_LIB(x) \
- ? ((x).a_entry & ~(bfd_vma) (TARGET_PAGE_SIZE - 1)) \
+ ? ((x)->a_entry & ~(bfd_vma) (TARGET_PAGE_SIZE - 1)) \
: (bfd_vma) TEXT_START_ADDR))
#define N_SYMOFF(x) \
- (N_TXTOFF (x) + (x).a_text + (x).a_data + (x).a_trsize + (x).a_drsize)
+ (N_TXTOFF (x) + (x)->a_text + (x)->a_data + (x)->a_trsize + (x)->a_drsize)
-#define N_STROFF(x) (N_SYMOFF (x) + (x).a_syms)
+#define N_STROFF(x) (N_SYMOFF (x) + (x)->a_syms)
#define TEXT_START_ADDR 32768
#define TARGET_PAGE_SIZE 32768
the tokens. */
#define MY(OP) CONCAT2 (arm_aout_riscix_,OP)
#define TARGETNAME "a.out-riscix"
-#define N_BADMAG(x) ((((x).a_info & ~007200) != ZMAGIC) \
- && (((x).a_info & ~006000) != OMAGIC) \
- && ((x).a_info != NMAGIC))
-#define N_MAGIC(x) ((x).a_info & ~07200)
+#define N_BADMAG(x) ((((x)->a_info & ~007200) != ZMAGIC) \
+ && (((x)->a_info & ~006000) != OMAGIC) \
+ && ((x)->a_info != NMAGIC))
+#define N_MAGIC(x) ((x)->a_info & ~07200)
#include "sysdep.h"
#include "bfd.h"
if (bfd_get_outsymbols (abfd) != NULL \
&& bfd_get_symcount (abfd) != 0) \
{ \
- if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (* execp)), SEEK_SET) != 0)\
+ if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) != 0) \
return FALSE; \
\
if (! NAME (aout, write_syms) (abfd)) \
return FALSE; \
\
- if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (* execp)), SEEK_SET) != 0)\
+ if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (execp)), SEEK_SET) != 0) \
return FALSE; \
\
if (! riscix_squirt_out_relocs (abfd, obj_textsec (abfd))) \
return FALSE; \
- if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (* execp)), SEEK_SET) != 0)\
+ if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp)), SEEK_SET) != 0) \
return FALSE; \
\
if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd))) \
/* Setting of EXEC_P has been deferred to the bottom of this function. */
if (execp->a_syms)
abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
- if (N_DYNAMIC(*execp))
+ if (N_DYNAMIC (execp))
abfd->flags |= DYNAMIC;
/* Squeezed files aren't supported (yet)! */
bfd_set_error (bfd_error_wrong_format);
return NULL;
}
- else if (N_MAGIC (*execp) == ZMAGIC)
+ else if (N_MAGIC (execp) == ZMAGIC)
{
abfd->flags |= D_PAGED | WP_TEXT;
adata (abfd).magic = z_magic;
}
- else if (N_MAGIC (*execp) == NMAGIC)
+ else if (N_MAGIC (execp) == NMAGIC)
{
abfd->flags |= WP_TEXT;
adata (abfd).magic = n_magic;
}
- else if (N_MAGIC (*execp) == OMAGIC)
+ else if (N_MAGIC (execp) == OMAGIC)
adata (abfd).magic = o_magic;
else
/* Should have been checked with N_BADMAG before this routine
exec.a_info = H_GET_32 (abfd, exec_bytes.e_info);
- if (N_BADMAG (exec))
+ if (N_BADMAG (&exec))
return NULL;
#ifdef MACHTYPE_OK
- if (!(MACHTYPE_OK (N_MACHTYPE (exec))))
+ if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
return NULL;
#endif
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
- N_SET_MACHTYPE (*execp, M_SPARC);
+ N_SET_MACHTYPE (execp, M_SPARC);
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
- WRITE_HEADERS(abfd, execp);
+ WRITE_HEADERS (abfd, execp);
return TRUE;
}
bfd_set_arch_mach (abfd, arch, machine);
}
-#define SET_ARCH_MACH(ABFD, EXEC) \
- NAME(lynx,set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \
+#define SET_ARCH_MACH(ABFD, EXECP) \
+ NAME(lynx,set_arch_mach) (ABFD, N_MACHTYPE (EXECP)); \
choose_reloc_size(ABFD);
/* Determine the size of a relocation entry, based on the architecture. */
switch (bfd_get_mach (abfd))
{
case bfd_mach_m68010:
- N_SET_MACHTYPE (*execp, M_68010);
+ N_SET_MACHTYPE (execp, M_68010);
break;
default:
case bfd_mach_m68020:
- N_SET_MACHTYPE (*execp, M_68020);
+ N_SET_MACHTYPE (execp, M_68020);
break;
}
break;
case bfd_arch_sparc:
- N_SET_MACHTYPE (*execp, M_SPARC);
+ N_SET_MACHTYPE (execp, M_SPARC);
break;
case bfd_arch_i386:
- N_SET_MACHTYPE (*execp, M_386);
+ N_SET_MACHTYPE (execp, M_386);
break;
default:
- N_SET_MACHTYPE (*execp, M_UNKNOWN);
+ N_SET_MACHTYPE (execp, M_UNKNOWN);
}
choose_reloc_size (abfd);
- N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags);
+ N_SET_FLAGS (execp, aout_backend_info (abfd)->exec_hdr_flags);
WRITE_HEADERS (abfd, execp);
+2015-12-01 Alan Modra <amodra@gmail.com>
+
+ * config/aout_gnu.h: Invoke aout N_* macros with pointer to
+ struct internal_exec.
+
2015-11-27 Matthew Wahab <matthew.wahab@arm.com>
* config/tc-aarch64.c (aarch64_features): Add "fp16".
M_HPUX23 = 0x020C /* hp200/300 HPUX binary */
};
-#define N_MAGIC(exec) ((exec).a_info & 0xffff)
-#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
-#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
-#define N_SET_INFO(exec, magic, type, flags) \
- ((exec).a_info = ((magic) & 0xffff) \
+#define N_MAGIC(execp) ((execp)->a_info & 0xffff)
+#define N_MACHTYPE(execp) ((enum machine_type)(((execp)->a_info >> 16) & 0xff))
+#define N_FLAGS(execp) (((execp)->a_info >> 24) & 0xff)
+#define N_SET_INFO(execp, magic, type, flags) \
+ ((execp)->a_info = ((magic) & 0xffff) \
| (((int)(type) & 0xff) << 16) \
| (((flags) & 0xff) << 24))
-#define N_SET_MAGIC(exec, magic) \
- ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
+#define N_SET_MAGIC(execp, magic) \
+ ((execp)->a_info = (((execp)->a_info & 0xffff0000) | ((magic) & 0xffff)))
-#define N_SET_MACHTYPE(exec, machtype) \
- ((exec).a_info = \
- ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
+#define N_SET_MACHTYPE(execp, machtype) \
+ ((execp)->a_info = \
+ ((execp)->a_info & 0xff00ffff) | ((((int) (machtype)) & 0xff) << 16))
-#define N_SET_FLAGS(exec, flags) \
- ((exec).a_info = \
- ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
+#define N_SET_FLAGS(execp, flags) \
+ ((execp)->a_info = \
+ ((execp)->a_info & 0x00ffffff) | (((flags) & 0xff) << 24))
/* Code indicating object file or impure executable. */
#ifndef OMAGIC
#endif
#ifndef N_DATOFF
-#define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text )
+#define N_DATOFF(x) ( N_TXTOFF(x) + (x)->a_text )
#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
/* Address of text segment in memory after it is loaded. */
#ifndef N_DATADDR
#define N_DATADDR(x) \
- (N_MAGIC(x)==OMAGIC? (N_TXTADDR(x)+(x).a_text) \
- : (N_SEGSIZE(x) + ((N_TXTADDR(x)+(x).a_text-1) & ~(N_SEGSIZE(x)-1))))
+ (N_MAGIC(x)==OMAGIC? (N_TXTADDR(x)+(x)->a_text) \
+ : (N_SEGSIZE(x) + ((N_TXTADDR(x)+(x)->a_text-1) & ~(N_SEGSIZE(x)-1))))
#endif
/* Address of bss segment in memory after it is loaded. */
-#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
+#define N_BSSADDR(x) (N_DATADDR(x) + (x)->a_data)
\f
struct nlist
{
+2015-12-01 Alan Modra <amodra@gmail.com>
+
+ * bout.h: Invoke aout N_* macros with pointer to
+ struct internal_exec.
+ * os9k.h: Likewise.
+
2015-11-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* vtv-change-permission.h (VTV_PAGE_SIZE) [__sun__ && __svr4__ &&
+2015-12-01 Alan Modra <amodra@gmail.com>
+
+ * adobe.h: Invoke aout N_* macros with pointer to
+ struct internal_exec.
+ * aout64.h: Likewise.
+ * dynix3.h: Likewise.
+ * encap.h: Likewise.
+ * hp.h: Likewise.
+ * hp300hpux.h: Likewise.
+ * sun4.h: Likewise.
+
2015-01-01 Alan Modra <amodra@gmail.com>
Update year range in copyright notice of all files.
#undef OMAGIC
#undef NMAGIC
-#define N_BADMAG(x) ((x).a_info != ZMAGIC)
+#define N_BADMAG(x) ((x)->a_info != ZMAGIC)
/* By default, segment size is constant. But some machines override this
to be a function of the a.out header (e.g. machine type). */
unsigned int a_filebase; /* Base address in object file */
};
-#define N_TXTADDR(x) \
+#define N_TXTADDR(x) is_this_really_unused?
/* This is documented to be at 1024, but appears to really be at 2048.
FIXME?! */
#define N_TXTOFF(x) 2048
-#define N_TXTSIZE(x) ((x).a_text)
+#define N_TXTSIZE(x) ((x)->a_text)
-#define N_DATADDR(x)
+#define N_DATADDR(x) is_this_really_unused?
-#define N_BSSADDR(x)
+#define N_BSSADDR(x) is_this_really_unused?
/* Offsets of the various portions of the file after the text segment. */
#define N_DATOFF(x) ( N_TXTOFF(x) + N_TXTSIZE(x) )
-#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 )
+#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 )
\f
/* Symbols */
struct external_nlist {
in the text. */
#ifndef N_HEADER_IN_TEXT
#define N_HEADER_IN_TEXT(x) \
- (((x).a_entry & (TARGET_PAGE_SIZE-1)) >= EXEC_BYTES_SIZE)
+ (((x)->a_entry & (TARGET_PAGE_SIZE-1)) >= EXEC_BYTES_SIZE)
#endif
/* Sun shared libraries, not linux. This macro is only relevant for ZMAGIC
#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 \
+ ? (x)->a_text - EXEC_BYTES_SIZE \
: ((N_MAGIC (x) != ZMAGIC || N_SHARED_LIB (x)) \
- ? (x).a_text \
+ ? (x)->a_text \
: (N_HEADER_IN_TEXT (x) \
- ? (x).a_text - EXEC_BYTES_SIZE /* No padding. */ \
- : (x).a_text /* A page of padding. */ )))
+ ? (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
#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. */
#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
\f
/* Symbols */
#define N_TXTOFF(x) (EXEC_BYTES_SIZE)
#define N_DATOFF(x) (N_TXTOFF(x) + N_TXTSIZE(x))
-#define N_SHDATOFF(x) (N_DATOFF(x) + (x).a_data)
-#define N_TRELOFF(x) (N_SHDATOFF(x) + (x).a_shdata)
-#define N_DRELOFF(x) (N_TRELOFF(x) + (x).a_trsize)
-#define N_SHDRELOFF(x) (N_DRELOFF(x) + (x).a_drsize)
-#define N_SYMOFF(x) (N_SHDRELOFF(x) + (x).a_shdrsize)
-#define N_STROFF(x) (N_SYMOFF(x) + (x).a_syms)
+#define N_SHDATOFF(x) (N_DATOFF(x) + (x)->a_data)
+#define N_TRELOFF(x) (N_SHDATOFF(x) + (x)->a_shdata)
+#define N_DRELOFF(x) (N_TRELOFF(x) + (x)->a_trsize)
+#define N_SHDRELOFF(x) (N_DRELOFF(x) + (x)->a_drsize)
+#define N_SYMOFF(x) (N_SHDRELOFF(x) + (x)->a_shdrsize)
+#define N_STROFF(x) (N_SYMOFF(x) + (x)->a_syms)
#define N_TXTADDR(x) \
(((OMAGIC == N_MAGIC(x)) || (SMAGIC == N_MAGIC(x))) ? 0 \
: TEXT_START_ADDR + EXEC_BYTES_SIZE)
#define N_TXTSIZE(x) \
- (((OMAGIC == N_MAGIC(x)) || (SMAGIC == N_MAGIC(x))) ? ((x).a_text) \
- : ((x).a_text - N_ADDRADJ(x) - EXEC_BYTES_SIZE))
+ (((OMAGIC == N_MAGIC(x)) || (SMAGIC == N_MAGIC(x))) ? ((x)->a_text) \
+ : ((x)->a_text - N_ADDRADJ(x) - EXEC_BYTES_SIZE))
#endif /* A_OUT_DYNIX3_H */
#define N_DATADDR(x) \
((N_FLAGS(x) & N_FLAGS_COFF_ENCAPSULATE) ? \
- (SEGMENT_SIZE + ((N_TXTADDR(x)+(x).a_text-1) & ~(SEGMENT_SIZE-1))) : \
- (N_TXTADDR(x)+(x).a_text))
+ (SEGMENT_SIZE + ((N_TXTADDR(x)+(x)->a_text-1) & ~(SEGMENT_SIZE-1))) : \
+ (N_TXTADDR(x)+(x)->a_text))
#undef N_SET_MACHTYPE
#undef N_SET_FLAGS
-#define N_MAGIC(exec) ((exec) . a_magic)
-#define N_MACHTYPE(exec) ((exec) . a_machtype)
-#define N_SET_MAGIC(exec, magic) (((exec) . a_magic) = (magic))
-#define N_SET_MACHTYPE(exec, machtype) (((exec) . a_machtype) = (machtype))
+#define N_MAGIC(execp) ((execp)->a_magic)
+#define N_MACHTYPE(execp) ((execp)->a_machtype)
+#define N_SET_MAGIC(execp, magic) (((execp)->a_magic) = (magic))
+#define N_SET_MACHTYPE(execp, machtype) (((execp)->a_machtype) = (machtype))
#undef N_BADMAG
#define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x)))
#undef N_STROFF
#define N_DATOFF(x) ( N_TXTOFF(x) + N_TXTSIZE(x) )
-#define N_PASOFF(x) ( N_DATOFF(x) + (x).a_data)
-#define N_SYMOFF(x) ( N_PASOFF(x) /* + (x).a_passize*/ )
-#define N_SUPOFF(x) ( N_SYMOFF(x) + (x).a_syms )
-#define N_TRELOFF(x) ( N_SUPOFF(x) /* + 0 (x).a_supsize*/ )
-#define N_DRELOFF(x) ( N_TRELOFF(x) + (x).a_trsize )
-#define N_EXTHOFF(x) ( N_DRELOFF(x) /* + 0 (x).a_drsize */)
+#define N_PASOFF(x) ( N_DATOFF(x) + (x)->a_data)
+#define N_SYMOFF(x) ( N_PASOFF(x) /* + (x)->a_passize*/ )
+#define N_SUPOFF(x) ( N_SYMOFF(x) + (x)->a_syms )
+#define N_TRELOFF(x) ( N_SUPOFF(x) /* + (x)->a_supsize*/ )
+#define N_DRELOFF(x) ( N_TRELOFF(x) + (x)->a_trsize )
+#define N_EXTHOFF(x) ( N_DRELOFF(x) /* + (x)->a_drsize */)
#define N_STROFF(x) ( 0 /* no string table */ )
/* use these when the file has gnu symbol tables */
-#define N_GNU_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
-#define N_GNU_DRELOFF(x) (N_GNU_TRELOFF(x) + (x).a_trsize)
-#define N_GNU_SYMOFF(x) (N_GNU_DRELOFF(x) + (x).a_drsize)
+#define N_GNU_TRELOFF(x) (N_DATOFF(x) + (x)->a_data)
+#define N_GNU_DRELOFF(x) (N_GNU_TRELOFF(x) + (x)->a_trsize)
+#define N_GNU_SYMOFF(x) (N_GNU_DRELOFF(x) + (x)->a_drsize)
#define TARGET_PAGE_SIZE 0x1000
#define SEGMENT_SIZE 0x1000
expected text address. These kludges have gotta go!
For linked files, should reflect reality if we know it. */
-#define N_SHARED_LIB(x) ((x).a_entry < TEXT_START_ADDR \
- && (x).a_text >= EXEC_BYTES_SIZE)
+#define N_SHARED_LIB(x) ((x)->a_entry < TEXT_START_ADDR \
+ && (x)->a_text >= EXEC_BYTES_SIZE)
/* This differs from the version in aout64.h (which we override by defining
it here) only for NMAGIC (we return TEXT_START_ADDR+EXEC_BYTES_SIZE;
#define N_TXTADDR(x) \
(N_MAGIC(x)==OMAGIC? 0 \
- : (N_MAGIC(x) == ZMAGIC && (x).a_entry < TEXT_START_ADDR)? 0 \
+ : (N_MAGIC(x) == ZMAGIC && (x)->a_entry < TEXT_START_ADDR)? 0 \
: TEXT_START_ADDR+EXEC_BYTES_SIZE)
/* When a file is linked against a shared library on SunOS 4, the
/* These macros use the a_xxx field names, since they operate on the exec
structure after it's been byte-swapped and realigned on the host machine. */
-#define N_BADMAG(x) (((x).a_info)!=BMAGIC)
+#define N_BADMAG(x) (((x)->a_info)!=BMAGIC)
#define N_TXTOFF(x) EXEC_BYTES_SIZE
-#define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text )
-#define N_TROFF(x) ( N_DATOFF(x) + (x).a_data )
+#define N_DATOFF(x) ( N_TXTOFF(x) + (x)->a_text )
+#define N_TROFF(x) ( N_DATOFF(x) + (x)->a_data )
#define N_TRELOFF N_TROFF
-#define N_DROFF(x) ( N_TROFF(x) + (x).a_trsize )
+#define N_DROFF(x) ( N_TROFF(x) + (x)->a_trsize )
#define N_DRELOFF N_DROFF
-#define N_SYMOFF(x) ( N_DROFF(x) + (x).a_drsize )
-#define N_STROFF(x) ( N_SYMOFF(x) + (x).a_syms )
-#define N_DATADDR(x) ( (x).a_dload )
+#define N_SYMOFF(x) ( N_DROFF(x) + (x)->a_drsize )
+#define N_STROFF(x) ( N_SYMOFF(x) + (x)->a_syms )
+#define N_DATADDR(x) ( (x)->a_dload )
/* Address of text segment in memory after it is loaded. */
#if !defined (N_TXTADDR)
#define MODSIZE(mod) ((u_int32)((Mh_com)mod)->m_size)
#endif /* 0 */
#define MHCOM_BYTES_SIZE 80
-#define N_BADMAG(a) (((a).a_info) != MODSYNC)
+#define N_BADMAG(a) (((a)->a_info) != MODSYNC)
typedef struct mh_com
{