Back to index

cell-binutils  2.17cvs20070401
Classes | Defines | Functions
obj-ecoff.h File Reference
#include "targ-cpu.h"
#include "ecoff.h"

Go to the source code of this file.


struct  ecoff_sy_obj


#define OBJ_ECOFF   1
#define OUTPUT_FLAVOR   bfd_target_ecoff_flavour
#define OBJ_SYMFIELD_TYPE   struct ecoff_sy_obj
#define obj_frob_symbol(symp, punt)   ecoff_frob_symbol (symp)
#define obj_frob_file_before_fix()   ecoff_frob_file_before_fix ()
#define obj_frob_file()   ecoff_frob_file ()
#define obj_read_begin_hook   ecoff_read_begin_hook
#define obj_symbol_new_hook   ecoff_symbol_new_hook
#define obj_app_file(name, app)   ecoff_new_file (name, app)
#define OBJ_PROCESS_STAB(seg, what, string, type, other, desc)   ecoff_stab ((seg), (what), (string), (type), (other), (desc))
#define obj_sec_sym_ok_for_reloc(SEC)   1
#define obj_ecoff_set_ext   ecoff_set_ext


void ecoff_frob_file_before_fix (void)
void ecoff_frob_file (void)
void obj_ecoff_set_ext (symbolS *, EXTR *)

Class Documentation

struct ecoff_sy_obj

Definition at line 40 of file obj-ecoff.h.

Class Members
valueT ecoff_extern_size
struct efdr * ecoff_file
struct localsym * ecoff_symbol

Define Documentation


Definition at line 27 of file obj-ecoff.h.


Definition at line 70 of file obj-ecoff.h.

#define obj_app_file (   name,
)    ecoff_new_file (name, app)

Definition at line 64 of file obj-ecoff.h.

#define OBJ_ECOFF   1

Definition at line 24 of file obj-ecoff.h.

#define obj_ecoff_set_ext   ecoff_set_ext

Definition at line 73 of file obj-ecoff.h.

#define obj_frob_file ( )    ecoff_frob_file ()

Definition at line 57 of file obj-ecoff.h.

Definition at line 53 of file obj-ecoff.h.

#define obj_frob_symbol (   symp,
)    ecoff_frob_symbol (symp)

Definition at line 50 of file obj-ecoff.h.

#define OBJ_PROCESS_STAB (   seg,
)    ecoff_stab ((seg), (what), (string), (type), (other), (desc))

Definition at line 67 of file obj-ecoff.h.

#define obj_read_begin_hook   ecoff_read_begin_hook

Definition at line 60 of file obj-ecoff.h.

#define obj_sec_sym_ok_for_reloc (   SEC)    1

Definition at line 71 of file obj-ecoff.h.

#define obj_symbol_new_hook   ecoff_symbol_new_hook

Definition at line 61 of file obj-ecoff.h.

Definition at line 47 of file obj-ecoff.h.

Definition at line 29 of file obj-ecoff.h.

Function Documentation

void ecoff_frob_file ( void  )

Definition at line 139 of file obj-ecoff.c.

  const struct ecoff_debug_swap * const debug_swap
    = &ecoff_backend (stdoutput)->debug_swap;
  bfd_vma addr ATTRIBUTE_UNUSED;
  HDRR *hdr;
  char *buf;
  char *set;

  /* Build the ECOFF debugging information.  */
  assert (ecoff_data (stdoutput) != 0);
  hdr = &ecoff_data (stdoutput)->debug_info.symbolic_header;
  ecoff_build_debug (hdr, &buf, debug_swap);

  /* Finish up the ecoff_tdata structure.  */
  set = buf;
#define SET(ptr, count, type, size) \
  if (hdr->count == 0) \
    ecoff_data (stdoutput)->debug_info.ptr = NULL; \
  else \
    { \
      ecoff_data (stdoutput)->debug_info.ptr = (type) set; \
      set += hdr->count * size; \

  SET (line, cbLine, unsigned char *, sizeof (unsigned char));
  SET (external_dnr, idnMax, void *, debug_swap->external_dnr_size);
  SET (external_pdr, ipdMax, void *, debug_swap->external_pdr_size);
  SET (external_sym, isymMax, void *, debug_swap->external_sym_size);
  SET (external_opt, ioptMax, void *, debug_swap->external_opt_size);
  SET (external_aux, iauxMax, union aux_ext *, sizeof (union aux_ext));
  SET (ss, issMax, char *, sizeof (char));
  SET (ssext, issExtMax, char *, sizeof (char));
  SET (external_rfd, crfd, void *, debug_swap->external_rfd_size);
  SET (external_fdr, ifdMax, void *, debug_swap->external_fdr_size);
  SET (external_ext, iextMax, void *, debug_swap->external_ext_size);
#undef SET
void ecoff_frob_file_before_fix ( void  )

Definition at line 37 of file obj-ecoff.c.

  bfd_vma addr;
  asection *sec;

  /* Set the section VMA values.  We force the .sdata and .sbss
     sections to the end to ensure that their VMA addresses are close
     together so that the GP register can address both of them.  We
     put the .bss section after the .sbss section.

     Also, for the Alpha, we must sort the sections, to make sure they
     appear in the output file in the correct order.  (Actually, maybe
     this is a job for BFD.  But the VMAs computed would be out of
     whack if we computed them given our initial, random ordering.
     It's possible that that wouldn't break things; I could do some
     experimenting sometime and find out.

     This output ordering of sections is magic, on the Alpha, at
     least.  The .lita section must come before .lit8 and .lit4,
     otherwise the OSF/1 linker may silently trash the .lit{4,8}
     section contents.  Also, .text must preceed .rdata.  These differ
     from the order described in some parts of the DEC OSF/1 Assembly
     Language Programmer's Guide, but that order doesn't seem to work
     with their linker.

     I don't know if section ordering on the MIPS is important.  */

  static const char *const names[] =
    /* text segment */
    ".text", ".rdata", ".init", ".fini",
    /* data segment */
    ".data", ".lita", ".lit8", ".lit4", ".sdata", ".got",
    /* bss segment */
    ".sbss", ".bss",
#define n_names ((int) (sizeof (names) / sizeof (names[0])))

  /* Sections that match names, order to be straightened out later.  */
  asection *secs[n_names];
  int i;

  addr = 0;
  for (i = 0; i < n_names; i++)
    secs[i] = NULL;

  for (sec = stdoutput->sections; sec != NULL; sec = sec->next)
      for (i = 0; i < n_names; i++)
       if (!strcmp (sec->name, names[i]))
           secs[i] = sec;
           bfd_section_list_remove (stdoutput, sec);
      if (i == n_names)
         bfd_set_section_vma (stdoutput, sec, addr);
         addr += bfd_section_size (stdoutput, sec);
  for (i = 0; i < n_names; i++)
    if (secs[i])
       bfd_set_section_vma (stdoutput, secs[i], addr);
       addr += bfd_section_size (stdoutput, secs[i]);
  for (i = n_names - 1; i >= 0; i--)
    if (secs[i])
      bfd_section_list_prepend (stdoutput, secs[i]);

  /* Fill in the register masks.  */
    unsigned long gprmask = 0;
    unsigned long fprmask = 0;
    unsigned long *cprmask = NULL;

#ifdef TC_MIPS
    /* Fill in the MIPS register masks.  It's probably not worth
       setting up a generic interface for this.  */
    gprmask = mips_gprmask;
    cprmask = mips_cprmask;

#ifdef TC_ALPHA
    alpha_frob_ecoff_data ();

    if (! bfd_ecoff_set_gp_value (stdoutput, alpha_gp_value))
      as_fatal (_("Can't set GP value"));

    gprmask = alpha_gprmask;
    fprmask = alpha_fprmask;

    if (! bfd_ecoff_set_regmasks (stdoutput, gprmask, fprmask, cprmask))
      as_fatal (_("Can't set register masks"));

Here is the call graph for this function:

void obj_ecoff_set_ext ( symbolS *  ,

Definition at line 183 of file obj-ecoff.c.

  const struct ecoff_debug_swap * const debug_swap
    = &ecoff_backend (stdoutput)->debug_swap;
  ecoff_symbol_type *esym;

  know (bfd_asymbol_flavour (symbol_get_bfdsym (sym))
       == bfd_target_ecoff_flavour);
  esym = ecoffsymbol (symbol_get_bfdsym (sym));
  esym->local = FALSE;
  esym->native = xmalloc (debug_swap->external_ext_size);
  (*debug_swap->swap_ext_out) (stdoutput, ext, esym->native);

Here is the call graph for this function: