Back to index

cell-binutils  2.17cvs20070401
Defines | Functions | Variables
output-file.c File Reference
#include "as.h"
#include "output-file.h"

Go to the source code of this file.

Defines

#define TARGET_MACH   0

Functions

void output_file_create (char *name)
void output_file_close (char *filename)

Variables

bfdstdoutput

Define Documentation

#define TARGET_MACH   0

Definition at line 26 of file output-file.c.


Function Documentation

void output_file_close ( char *  filename)

Definition at line 54 of file output-file.c.

{
  bfd_boolean res;

  if (stdoutput == NULL)
    return;
    
  /* Close the bfd.  */
  res = bfd_close (stdoutput);

  /* Prevent an infinite loop - if the close failed we will call as_fatal
     which will call xexit() which may call this function again...  */
  stdoutput = NULL;

  if (! res)
    as_fatal (_("can't close %s: %s"), filename,
             bfd_errmsg (bfd_get_error ()));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void output_file_create ( char *  name)

Definition at line 32 of file output-file.c.

{
  if (name[0] == '-' && name[1] == '\0')
    as_fatal (_("can't open a bfd on stdout %s"), name);

  else if (!(stdoutput = bfd_openw (name, TARGET_FORMAT)))
    {
      bfd_error_type err = bfd_get_error ();

      if (err == bfd_error_invalid_target)
       as_fatal (_("selected target format '%s' unknown"), TARGET_FORMAT);
      else
       as_fatal (_("can't create %s: %s"), name, bfd_errmsg (err));
    }

  bfd_set_format (stdoutput, bfd_object);
  bfd_set_arch_mach (stdoutput, TARGET_ARCH, TARGET_MACH);
  if (flag_traditional_format)
    stdoutput->flags |= BFD_TRADITIONAL_FORMAT;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 29 of file output-file.c.