Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/bfd/osf-core.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* BFD back-end for OSF/1 core files.
    2    Copyright 1993, 1994, 1995, 1998, 1999 Free Software Foundation, Inc.
     2   Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002
     3   Free Software Foundation, Inc.
    34
    45This file is part of BFD, the Binary File Descriptor library.
     
    3031/* forward declarations */
    3132
    32 static asection *
    33 make_bfd_asection PARAMS ((bfd *, CONST char *, flagword, bfd_size_type,
    34                            bfd_vma, file_ptr));
    35 static asymbol *
    36 osf_core_make_empty_symbol PARAMS ((bfd *));
    37 static const bfd_target *
    38 osf_core_core_file_p PARAMS ((bfd *));
    39 static char *
    40 osf_core_core_file_failing_command PARAMS ((bfd *));
    41 static int
    42 osf_core_core_file_failing_signal PARAMS ((bfd *));
    43 static boolean
    44 osf_core_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
    45 static void
    46 swap_abort PARAMS ((void));
     33static asection *make_bfd_asection
     34  PARAMS ((bfd *, const char *, flagword, bfd_size_type, bfd_vma, file_ptr));
     35static const bfd_target *osf_core_core_file_p
     36  PARAMS ((bfd *));
     37static char *osf_core_core_file_failing_command
     38  PARAMS ((bfd *));
     39static int osf_core_core_file_failing_signal
     40  PARAMS ((bfd *));
     41static bfd_boolean osf_core_core_file_matches_executable_p
     42  PARAMS ((bfd *, bfd *));
     43static void swap_abort
     44  PARAMS ((void));
    4745
    4846/* These are stored in the bfd's tdata */
    4947
    50 struct osf_core_struct 
     48struct osf_core_struct
    5149{
    5250  int sig;
     
    6159make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
    6260     bfd *abfd;
    63      CONST char *name;
     61      char *name;
    6462     flagword flags;
    6563     bfd_size_type _raw_size;
     
    8280}
    8381
    84 static asymbol *
    85 osf_core_make_empty_symbol (abfd)
    86      bfd *abfd;
    87 {
    88   asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
    89   if (new)
    90     new->the_bfd = abfd;
    91   return new;
    92 }
    93 
    9482static const bfd_target *
    9583osf_core_core_file_p (abfd)
     
    10088  char *secname;
    10189  struct core_filehdr core_header;
    102 
    103   val = bfd_read ((PTR)&core_header, 1, sizeof core_header, abfd);
     90  bfd_size_type amt;
     91
     92  amt = sizeof core_header;
     93  val = bfd_bread ((PTR) &core_header, amt, abfd);
    10494  if (val != sizeof core_header)
    10595    return NULL;
     
    10999
    110100  core_hdr (abfd) = (struct osf_core_struct *)
    111     bfd_zalloc (abfd, sizeof (struct osf_core_struct));
     101    bfd_zalloc (abfd, sizeof (struct osf_core_struct));
    112102  if (!core_hdr (abfd))
    113103    return NULL;
     
    121111      flagword flags;
    122112
    123       val = bfd_read ((PTR)&core_scnhdr, 1, sizeof core_scnhdr, abfd);
     113      amt = sizeof core_scnhdr;
     114      val = bfd_bread ((PTR) &core_scnhdr, amt, abfd);
    124115      if (val != sizeof core_scnhdr)
    125116        break;
     
    153144                              (bfd_vma) core_scnhdr.vaddr,
    154145                              (file_ptr) core_scnhdr.scnptr))
    155         return NULL;
     146        ;
    156147    }
    157148
     
    159150
    160151  return abfd->xvec;
     152
     153
     154
     155
     156
     157
    161158}
    162159
     
    177174
    178175/* ARGSUSED */
    179 static boolean
     176static boolean
    180177osf_core_core_file_matches_executable_p (core_bfd, exec_bfd)
    181      bfd *core_bfd, *exec_bfd;
    182 {
    183   return true;          /* FIXME, We have no way of telling at this point */
    184 }
    185 
    186 
    187 #define osf_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound
    188 #define osf_core_get_symtab _bfd_nosymbols_get_symtab
    189 #define osf_core_print_symbol _bfd_nosymbols_print_symbol
    190 #define osf_core_get_symbol_info _bfd_nosymbols_get_symbol_info
    191 #define osf_core_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
    192 #define osf_core_get_lineno _bfd_nosymbols_get_lineno
    193 #define osf_core_find_nearest_line _bfd_nosymbols_find_nearest_line
    194 #define osf_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
    195 #define osf_core_read_minisymbols _bfd_nosymbols_read_minisymbols
    196 #define osf_core_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol
     178     bfd *core_bfd ATTRIBUTE_UNUSED;
     179     bfd *exec_bfd ATTRIBUTE_UNUSED;
     180{
     181  return TRUE;          /* FIXME, We have no way of telling at this point */
     182}
     183
    197184
    198185/* If somebody calls any byte-swapping routines, shoot them.  */
     
    211198    "osf-core",
    212199    bfd_target_unknown_flavour,
    213     BFD_ENDIAN_BIG,             /* target byte order */
    214     BFD_ENDIAN_BIG,             /* target headers byte order */
     200    BFD_ENDIAN_,          /* target byte order */
     201    BFD_ENDIAN_,          /* target headers byte order */
    215202    (HAS_RELOC | EXEC_P |       /* object flags */
    216203     HAS_LINENO | HAS_DEBUG |
     
    241228     bfd_false, bfd_false
    242229    },
    243    
    244        BFD_JUMP_TABLE_GENERIC (_bfd_generic),
    245        BFD_JUMP_TABLE_COPY (_bfd_generic),
    246        BFD_JUMP_TABLE_CORE (osf_core),
    247        BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
    248        BFD_JUMP_TABLE_SYMBOLS (osf_core),
    249        BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
    250        BFD_JUMP_TABLE_WRITE (_bfd_generic),
    251        BFD_JUMP_TABLE_LINK (_bfd_nolink),
    252        BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
     230
     231    BFD_JUMP_TABLE_GENERIC (_bfd_generic),
     232    BFD_JUMP_TABLE_COPY (_bfd_generic),
     233    BFD_JUMP_TABLE_CORE (osf_core),
     234    BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
     235    ),
     236    BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
     237    BFD_JUMP_TABLE_WRITE (_bfd_generic),
     238    BFD_JUMP_TABLE_LINK (_bfd_nolink),
     239    BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
    253240
    254241    NULL,
    255    
     242
    256243    (PTR) 0                     /* backend_data */
    257244};
Note: See TracChangeset for help on using the changeset viewer.