Back to index

cell-binutils  2.17cvs20070401
Defines | Functions | Variables
aout-target.h File Reference
#include "aout/aout64.h"
#include "aout/stab_gnu.h"
#include "aout/ar.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define SEGMENT_SIZE   TARGET_PAGE_SIZE
#define MY_object_p   MY (object_p)
#define MY_mkobject   MY (mkobject)
#define MY_write_object_contents   MY (write_object_contents)
#define MY_set_sizes   MY (set_sizes)
#define MY_exec_hdr_flags   0
#define MY_zmagic_contiguous   0
#define MY_text_includes_header   0
#define MY_entry_is_text_address   0
#define MY_exec_header_not_counted   0
#define MY_add_dynamic_symbols   0
#define MY_add_one_symbol   0
#define MY_link_dynamic_object   0
#define MY_write_dynamic_symbol   0
#define MY_check_dynamic_reloc   0
#define MY_finish_dynamic_link   0
#define MY_backend_data   &MY (backend_data)
#define MY_openr_next_archived_file   bfd_generic_openr_next_archived_file
#define MY_get_elt_at_index   _bfd_generic_get_elt_at_index
#define MY_generic_stat_arch_elt   bfd_generic_stat_arch_elt
#define MY_slurp_armap   bfd_slurp_bsd_armap
#define MY_slurp_extended_name_table   _bfd_slurp_extended_name_table
#define MY_construct_extended_name_table   _bfd_archive_bsd_construct_extended_name_table
#define MY_write_armap   bsd_write_armap
#define MY_read_ar_hdr   _bfd_generic_read_ar_hdr
#define MY_truncate_arname   bfd_bsd_truncate_arname
#define MY_update_armap_timestamp   _bfd_archive_bsd_update_armap_timestamp
#define MY_core_file_failing_command   _bfd_nocore_core_file_failing_command
#define MY_core_file_failing_signal   _bfd_nocore_core_file_failing_signal
#define MY_core_file_matches_executable_p   _bfd_nocore_core_file_matches_executable_p
#define MY_core_file_p   _bfd_dummy_target
#define MY_bfd_debug_info_start   bfd_void
#define MY_bfd_debug_info_end   bfd_void
#define MY_bfd_debug_info_accumulate   (void (*) (bfd *, struct bfd_section *)) bfd_void
#define MY_set_section_contents   NAME (aout, set_section_contents)
#define MY_get_section_contents   NAME (aout, get_section_contents)
#define MY_get_section_contents_in_window   _bfd_generic_get_section_contents_in_window
#define MY_new_section_hook   NAME (aout, new_section_hook)
#define MY_get_symtab_upper_bound   NAME (aout, get_symtab_upper_bound)
#define MY_canonicalize_symtab   NAME (aout, canonicalize_symtab)
#define MY_get_reloc_upper_bound   NAME (aout,get_reloc_upper_bound)
#define MY_canonicalize_reloc   NAME (aout, canonicalize_reloc)
#define MY_make_empty_symbol   NAME (aout, make_empty_symbol)
#define MY_print_symbol   NAME (aout, print_symbol)
#define MY_get_symbol_info   NAME (aout, get_symbol_info)
#define MY_get_lineno   NAME (aout, get_lineno)
#define MY_set_arch_mach   NAME (aout, set_arch_mach)
#define MY_find_nearest_line   NAME (aout, find_nearest_line)
#define MY_find_inliner_info   _bfd_nosymbols_find_inliner_info
#define MY_sizeof_headers   NAME (aout, sizeof_headers)
#define MY_bfd_get_relocated_section_contents   bfd_generic_get_relocated_section_contents
#define MY_bfd_relax_section   bfd_generic_relax_section
#define MY_bfd_gc_sections   bfd_generic_gc_sections
#define MY_bfd_merge_sections   bfd_generic_merge_sections
#define MY_bfd_is_group_section   bfd_generic_is_group_section
#define MY_bfd_discard_group   bfd_generic_discard_group
#define MY_section_already_linked   _bfd_generic_section_already_linked
#define MY_bfd_reloc_type_lookup   NAME (aout, reloc_type_lookup)
#define MY_bfd_reloc_name_lookup   NAME (aout, reloc_name_lookup)
#define MY_bfd_make_debug_symbol   0
#define MY_read_minisymbols   NAME (aout, read_minisymbols)
#define MY_minisymbol_to_symbol   NAME (aout, minisymbol_to_symbol)
#define MY_bfd_link_hash_table_create   NAME (aout, link_hash_table_create)
#define MY_bfd_link_hash_table_free   _bfd_generic_link_hash_table_free
#define MY_bfd_link_add_symbols   NAME (aout, link_add_symbols)
#define MY_bfd_link_just_syms   _bfd_generic_link_just_syms
#define MY_bfd_link_split_section   _bfd_generic_link_split_section
#define MY_bfd_copy_private_bfd_data   _bfd_generic_bfd_copy_private_bfd_data
#define MY_bfd_merge_private_bfd_data   _bfd_generic_bfd_merge_private_bfd_data
#define MY_bfd_copy_private_symbol_data   _bfd_generic_bfd_copy_private_symbol_data
#define MY_bfd_copy_private_header_data   _bfd_generic_bfd_copy_private_header_data
#define MY_bfd_print_private_bfd_data   _bfd_generic_bfd_print_private_bfd_data
#define MY_bfd_set_private_flags   _bfd_generic_bfd_set_private_flags
#define MY_bfd_is_local_label_name   bfd_generic_is_local_label_name
#define MY_bfd_is_target_special_symbol   ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
#define MY_bfd_free_cached_info   NAME (aout, bfd_free_cached_info)
#define MY_close_and_cleanup   MY_bfd_free_cached_info
#define MY_get_dynamic_symtab_upper_bound   _bfd_nodynamic_get_dynamic_symtab_upper_bound
#define MY_canonicalize_dynamic_symtab   _bfd_nodynamic_canonicalize_dynamic_symtab
#define MY_get_synthetic_symtab   _bfd_nodynamic_get_synthetic_symtab
#define MY_get_dynamic_reloc_upper_bound   _bfd_nodynamic_get_dynamic_reloc_upper_bound
#define MY_canonicalize_dynamic_reloc   _bfd_nodynamic_canonicalize_dynamic_reloc
#define MY_symbol_leading_char   '_'
#define AR_PAD_CHAR   ' '

Functions

reloc_howto_type * NAME (aout, reloc_type_lookup)(bfd *
reloc_howto_type * NAME (aout, reloc_name_lookup)(bfd *
reloc_howto_type const char
*static const bfd_target *MY() 
callback (bfd *abfd)
static const bfd_target *MY() object_p (bfd *abfd)
static bfd_boolean MY() mkobject (bfd *abfd)
static bfd_boolean MY_bfd_copy_private_section_data (bfd *ibfd, asection *isec ATTRIBUTE_UNUSED, bfd *obfd, asection *osec ATTRIBUTE_UNUSED)
static bfd_boolean MY() write_object_contents (bfd *abfd)
static bfd_boolean MY() set_sizes (bfd *abfd)
static struct aout_backend_data MY (backend_data)
static void MY_final_link_callback (bfd *abfd, file_ptr *ptreloff, file_ptr *pdreloff, file_ptr *psymoff)
static bfd_boolean MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
const bfd_target MY (vec)

Variables

reloc_howto_type bfd_reloc_code_real_type

Define Documentation

#define AR_PAD_CHAR   ' '

Definition at line 594 of file aout-target.h.

#define MY_add_dynamic_symbols   0

Definition at line 287 of file aout-target.h.

#define MY_add_one_symbol   0

Definition at line 290 of file aout-target.h.

#define MY_backend_data   &MY (backend_data)

Definition at line 321 of file aout-target.h.

Definition at line 527 of file aout-target.h.

Definition at line 539 of file aout-target.h.

Definition at line 535 of file aout-target.h.

Definition at line 411 of file aout-target.h.

Definition at line 408 of file aout-target.h.

Definition at line 405 of file aout-target.h.

Definition at line 489 of file aout-target.h.

Definition at line 559 of file aout-target.h.

Definition at line 480 of file aout-target.h.

Definition at line 473 of file aout-target.h.

Definition at line 486 of file aout-target.h.

Definition at line 551 of file aout-target.h.

Definition at line 555 of file aout-target.h.

#define MY_bfd_link_add_symbols   NAME (aout, link_add_symbols)

Definition at line 517 of file aout-target.h.

#define MY_bfd_link_hash_table_create   NAME (aout, link_hash_table_create)

Definition at line 511 of file aout-target.h.

Definition at line 514 of file aout-target.h.

Definition at line 520 of file aout-target.h.

Definition at line 523 of file aout-target.h.

#define MY_bfd_make_debug_symbol   0

Definition at line 502 of file aout-target.h.

Definition at line 531 of file aout-target.h.

Definition at line 483 of file aout-target.h.

Definition at line 543 of file aout-target.h.

Definition at line 477 of file aout-target.h.

Definition at line 499 of file aout-target.h.

Definition at line 496 of file aout-target.h.

Definition at line 547 of file aout-target.h.

Definition at line 583 of file aout-target.h.

Definition at line 571 of file aout-target.h.

Definition at line 446 of file aout-target.h.

Definition at line 440 of file aout-target.h.

#define MY_check_dynamic_reloc   0

Definition at line 299 of file aout-target.h.

Definition at line 563 of file aout-target.h.

Definition at line 373 of file aout-target.h.

Definition at line 391 of file aout-target.h.

Definition at line 394 of file aout-target.h.

Definition at line 397 of file aout-target.h.

Definition at line 401 of file aout-target.h.

#define MY_entry_is_text_address   0

Definition at line 281 of file aout-target.h.

#define MY_exec_hdr_flags   0

Definition at line 269 of file aout-target.h.

Definition at line 284 of file aout-target.h.

Definition at line 467 of file aout-target.h.

#define MY_find_nearest_line   NAME (aout, find_nearest_line)

Definition at line 464 of file aout-target.h.

#define MY_finish_dynamic_link   0

Definition at line 302 of file aout-target.h.

Definition at line 364 of file aout-target.h.

Definition at line 579 of file aout-target.h.

Definition at line 567 of file aout-target.h.

Definition at line 361 of file aout-target.h.

#define MY_get_lineno   NAME (aout, get_lineno)

Definition at line 458 of file aout-target.h.

Definition at line 443 of file aout-target.h.

#define MY_get_section_contents   NAME (aout, get_section_contents)

Definition at line 428 of file aout-target.h.

Definition at line 431 of file aout-target.h.

#define MY_get_symbol_info   NAME (aout, get_symbol_info)

Definition at line 455 of file aout-target.h.

Definition at line 437 of file aout-target.h.

Definition at line 575 of file aout-target.h.

#define MY_link_dynamic_object   0

Definition at line 293 of file aout-target.h.

Definition at line 449 of file aout-target.h.

#define MY_minisymbol_to_symbol   NAME (aout, minisymbol_to_symbol)

Definition at line 508 of file aout-target.h.

#define MY_mkobject   MY (mkobject)

Definition at line 202 of file aout-target.h.

#define MY_new_section_hook   NAME (aout, new_section_hook)

Definition at line 434 of file aout-target.h.

#define MY_object_p   MY (object_p)

Definition at line 191 of file aout-target.h.

Definition at line 358 of file aout-target.h.

#define MY_print_symbol   NAME (aout, print_symbol)

Definition at line 452 of file aout-target.h.

Definition at line 380 of file aout-target.h.

#define MY_read_minisymbols   NAME (aout, read_minisymbols)

Definition at line 505 of file aout-target.h.

Definition at line 492 of file aout-target.h.

#define MY_set_arch_mach   NAME (aout, set_arch_mach)

Definition at line 461 of file aout-target.h.

Definition at line 425 of file aout-target.h.

#define MY_set_sizes   MY (set_sizes)

Definition at line 265 of file aout-target.h.

#define MY_sizeof_headers   NAME (aout, sizeof_headers)

Definition at line 470 of file aout-target.h.

Definition at line 367 of file aout-target.h.

Definition at line 370 of file aout-target.h.

#define MY_symbol_leading_char   '_'

Definition at line 589 of file aout-target.h.

#define MY_text_includes_header   0

Definition at line 278 of file aout-target.h.

Definition at line 383 of file aout-target.h.

Definition at line 386 of file aout-target.h.

Definition at line 377 of file aout-target.h.

#define MY_write_dynamic_symbol   0

Definition at line 296 of file aout-target.h.

Definition at line 245 of file aout-target.h.

#define MY_zmagic_contiguous   0

Definition at line 275 of file aout-target.h.

Definition at line 28 of file aout-target.h.


Function Documentation

reloc_howto_type const char* static const bfd_target* MY() callback ( bfd abfd) [static]

Definition at line 39 of file aout-target.h.

{
  struct internal_exec *execp = exec_hdr (abfd);
  unsigned int arch_align_power;
  unsigned long arch_align;

  /* Calculate the file positions of the parts of a newly read aout header.  */
  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);

  /* 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.
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
  if (aout_backend_info (abfd)->entry_is_text_address
      && execp->a_entry > obj_textsec (abfd)->vma)
    {
      bfd_vma adjust;

      adjust = execp->a_entry - obj_textsec (abfd)->vma;
      /* Adjust only by whole pages.  */
      adjust &= ~(TARGET_PAGE_SIZE - 1);
      obj_textsec (abfd)->vma += adjust;
      obj_datasec (abfd)->vma += adjust;
      obj_bsssec (abfd)->vma += adjust;
    }

  /* Set the load addresses to be the same as the virtual addresses.  */
  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);

  /* The file offsets of the relocation info.  */
  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);

  /* Determine the architecture and machine type of the object file.  */
#ifdef SET_ARCH_MACH
  SET_ARCH_MACH (abfd, *execp);
#else
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
#endif

  /* The number of relocation records.  This must be called after
     SET_ARCH_MACH.  It assumes that SET_ARCH_MACH will set
     obj_reloc_entry_size correctly, if the reloc size is not
     RELOC_STD_SIZE.  */
  obj_textsec (abfd)->reloc_count =
    execp->a_trsize / obj_reloc_entry_size (abfd);
  obj_datasec (abfd)->reloc_count =
    execp->a_drsize / obj_reloc_entry_size (abfd);

  /* Now that we know the architecture, set the alignments of the
     sections.  This is normally done by NAME (aout,new_section_hook),
     but when the initial sections were created the architecture had
     not yet been set.  However, for backward compatibility, we don't
     set the alignment power any higher than as required by the size
     of the section.  */
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
  arch_align = 1 << arch_align_power;
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
       == obj_textsec (abfd)->size)
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
         == obj_datasec (abfd)->size)
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
         == obj_bsssec (abfd)->size))
    {
      obj_textsec (abfd)->alignment_power = arch_align_power;
      obj_datasec (abfd)->alignment_power = arch_align_power;
      obj_bsssec (abfd)->alignment_power = arch_align_power;
    }

  /* Don't set sizes now -- can't be sure until we know arch & mach.
     Sizes get set in set_sizes callback, later.  */

  return abfd->xvec;
}

Here is the call graph for this function:

static bfd_boolean MY() mkobject ( bfd abfd) [static]

Definition at line 197 of file aout-target.h.

{
  return NAME (aout, mkobject (abfd));
}
static struct aout_backend_data MY ( backend_data  ) [static, read]
const bfd_target MY ( vec  )
static bfd_boolean MY_bfd_copy_private_section_data ( bfd ibfd,
asection *isec  ATTRIBUTE_UNUSED,
bfd obfd,
asection *osec  ATTRIBUTE_UNUSED 
) [static]

Definition at line 214 of file aout-target.h.

static bfd_boolean MY_bfd_final_link ( bfd abfd,
struct bfd_link_info info 
) [static]

Definition at line 349 of file aout-target.h.

{
  return NAME (aout, final_link) (abfd, info, MY_final_link_callback);
}

Here is the call graph for this function:

static void MY_final_link_callback ( bfd abfd,
file_ptr ptreloff,
file_ptr pdreloff,
file_ptr psymoff 
) [static]

Definition at line 329 of file aout-target.h.

{
  struct internal_exec *execp = exec_hdr (abfd);

  *ptreloff = N_TRELOFF (*execp);
  *pdreloff = N_DRELOFF (*execp);
  *psymoff = N_SYMOFF (*execp);
}

Here is the caller graph for this function:

reloc_howto_type* NAME ( aout  ,
reloc_type_lookup   
)
reloc_howto_type* NAME ( aout  ,
reloc_name_lookup   
)
static const bfd_target* MY() object_p ( bfd abfd) [static]

Definition at line 133 of file aout-target.h.

{
  struct external_exec exec_bytes; /* Raw exec header from file.  */
  struct internal_exec exec;              /* Cleaned-up exec header.  */
  const bfd_target *target;
  bfd_size_type amt = EXEC_BYTES_SIZE;

  if (bfd_bread ((void *) &exec_bytes, amt, abfd) != amt)
    {
      if (bfd_get_error () != bfd_error_system_call)
       bfd_set_error (bfd_error_wrong_format);
      return 0;
    }

#ifdef SWAP_MAGIC
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
#else
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
#endif

  if (N_BADMAG (exec))
    return 0;

#ifdef MACHTYPE_OK
  if (!(MACHTYPE_OK (N_MACHTYPE (exec))))
    return 0;
#endif

  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);

#ifdef SWAP_MAGIC
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
#endif

  target = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));

#ifdef ENTRY_CAN_BE_ZERO
  /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
     means that it isn't obvious if EXEC_P should be set.
     All of the following must be true for an executable:
     There must be no relocations, the bfd can be neither an
     archive nor an archive element, and the file must be executable.  */

  if (exec.a_trsize + exec.a_drsize == 0
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
    {
      struct stat buf;
#ifndef S_IXUSR
#define S_IXUSR 0100 /* Execute by owner.  */
#endif
      if (stat(abfd->filename, &buf) == 0 && (buf.st_mode & S_IXUSR))
       abfd->flags |= EXEC_P;
    }
#endif /* ENTRY_CAN_BE_ZERO */

  return target;
}

Here is the call graph for this function:

static bfd_boolean MY() set_sizes ( bfd abfd) [static]

Definition at line 251 of file aout-target.h.

{
  adata(abfd).page_size = TARGET_PAGE_SIZE;
  adata(abfd).segment_size = SEGMENT_SIZE;

#ifdef ZMAGIC_DISK_BLOCK_SIZE
  adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
#else
  adata(abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
#endif

  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
  return TRUE;
}
static bfd_boolean MY() write_object_contents ( bfd abfd) [static]

Definition at line 234 of file aout-target.h.

{
  struct external_exec exec_bytes;
  struct internal_exec *execp = exec_hdr (abfd);

  obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;

  WRITE_HEADERS (abfd, execp);

  return TRUE;
}

Variable Documentation

reloc_howto_type bfd_reloc_code_real_type

Definition at line 31 of file aout-target.h.