The base file @code{aoutx.h} defines general mechanisms for reading
and writing records to and from disk, and various other methods which
-bfd requires. It is included by @code{aout32.c} and @code{aout64.c} to
+BFD requires. It is included by @code{aout32.c} and @code{aout64.c} to
form the names aout_32_swap_exec_header_in,
aout_64_swap_exec_header_in, etc.
sunos_big_vec
@end example
+The file host-aout.c is a special case. It is for a large set of hosts
+that use ``more or less standard'' a.out files, and for which cross-debugging
+is not interesting. It uses the standard 32-bit a.out support routines,
+but determines the file offsets and addresses of the text, data,
+and BSS sections, the machine architecture and machine type,
+and the entry point address, in a host-dependent manner. Once these
+values have been determined, generic code is used to handle the
+object file.
+
+When porting it to run on a new system, you must supply:
+
+ HOST_PAGE_SIZE
+ HOST_SEGMENT_SIZE
+ HOST_MACHINE_ARCH (optional)
+ HOST_MACHINE_MACHINE (optional)
+ HOST_TEXT_START_ADDR
+ HOST_STACK_END_ADDR
+
+in the file ../include/sys/h-XXX.h (for your host). These values, plus
+the structures and macros defined in <a.out.h> on your host system, will
+produce a BFD target that will access ordinary a.out files on your host.
+
+To configure a new machine to use host-aout.c, specify:
+
+TDEFINES = -DDEFAULT_VECTOR=host_aout_big_vec
+TDEPFILES= host-aout.o trad-core.o
+
+in the config/t-XXX file, and modify configure.in to use the
+t-XXX file (by setting "bfd_target=XXX") when your configuration is
+selected.
+
*/
#define KEEPIT flags
return bfd_reloc_ok;
}
-static r64()
+static bfd_reloc_status_enum_type
+r64()
{
abort();
}
/*doc*
*i aout_<size>_mkobject
-This routine initializes a bfd for use with a.out files.
+This routine initializes a BFD for use with a.out files.
*; PROTO(boolean, aout_<size>_mkobject, (bfd *));
*/
/*doc*
*i aout_<size>_set_arch_mach
-Sets the architecture and the machine of the bfd to those values
+Sets the architecture and the machine of the BFD to those values
supplied. Verifies that the format can support the architecture
required.
/*doc*
*i aout_<size>new_section_hook
-Called by the bfd in response to a @code{bfd_make_section} request.
+Called by the BFD in response to a @code{bfd_make_section} request.
*; PROTO(boolean, aout_<size>_new_section_hook,
(bfd *abfd,
asection *newsect));
bfd_size_type count)
{
if (abfd->output_has_begun == false)
- { /* set by bfd.c handler */
- if ((obj_textsec (abfd) == NULL) || (obj_datasec (abfd) == NULL))
- {
- bfd_error = invalid_operation;
- return false;
+ { /* set by bfd.c handler */
+ switch (abfd->direction)
+ {
+ case read_direction:
+ case no_direction:
+ bfd_error = invalid_operation;
+ return false;
+
+ case both_direction:
+ break;
+
+ case write_direction:
+ if ((obj_textsec (abfd) == NULL) || (obj_datasec (abfd) == NULL))
+ {
+ bfd_error = invalid_operation;
+ return false;
+ }
+ /*if (abfd->flags & D_PAGED) {
+ obj_textsec(abfd)->filepos = 0;
}
-/* if (abfd->flags & D_PAGED) {
- obj_textsec(abfd)->filepos = 0;
- }
- else*/ {
- obj_textsec(abfd)->filepos = EXEC_BYTES_SIZE;
+ else*/ {
+ obj_textsec(abfd)->filepos = EXEC_BYTES_SIZE;
+ }
+ obj_textsec(abfd)->size = align_power(obj_textsec(abfd)->size,
+ obj_textsec(abfd)->alignment_power);
+ obj_datasec(abfd)->filepos = obj_textsec (abfd)->size + EXEC_BYTES_SIZE;
+ obj_datasec(abfd)->size = align_power(obj_datasec(abfd)->size,
+ obj_datasec(abfd)->alignment_power);
}
- obj_textsec(abfd)->size = align_power(obj_textsec(abfd)->size,
- obj_textsec(abfd)->alignment_power);
- obj_datasec(abfd)->filepos = obj_textsec (abfd)->size + EXEC_BYTES_SIZE;
- obj_datasec(abfd)->size = align_power(obj_datasec(abfd)->size,
- obj_datasec(abfd)->alignment_power);
-
-
- }
+ }
+
/* regardless, once we know what we're doing, we might as well get going */
if (section != obj_bsssec(abfd))
{
- translate_to_native_sym_flags (&nsp, (PTR)g, abfd);
+ translate_to_native_sym_flags (&nsp, g, abfd);
bfd_write((PTR)&nsp,1,EXTERNAL_LIST_SIZE, abfd);
}
}
/*
- provided a bfd, a section and an offset into the section, calculate
+ provided a BFD, a section and an offset into the section, calculate
and return the name of the source file and the line nearest to the
wanted location.
*/