Home | History | Annotate | Download | only in libebl
      1 /* Initialization of SPARC specific backend library.
      2    Copyright (C) 2002 Red Hat, Inc.
      3 
      4    This program is Open Source software; you can redistribute it and/or
      5    modify it under the terms of the Open Software License version 1.0 as
      6    published by the Open Source Initiative.
      7 
      8    You should have received a copy of the Open Software License along
      9    with this program; if not, you may obtain a copy of the Open Software
     10    License version 1.0 from http://www.opensource.org/licenses/osl.php or
     11    by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
     12    3001 King Ranch Road, Ukiah, CA 95482.   */
     13 
     14 #ifdef HAVE_CONFIG_H
     15 # include <config.h>
     16 #endif
     17 
     18 #include <libebl_sparc.h>
     19 
     20 
     21 int
     22 sparc_init (elf, machine, eh, ehlen)
     23      Elf *elf;
     24      GElf_Half machine;
     25      Ebl *eh;
     26      size_t ehlen;
     27 {
     28   /* Check whether the Elf_BH object has a sufficent size.  */
     29   if (ehlen < sizeof (Ebl))
     30     return 1;
     31 
     32   /* We handle it.  */
     33   if (machine == EM_SPARCV9)
     34     eh->name = "SPARC v9";
     35   else if (machine == EM_SPARC32PLUS)
     36     eh->name = "SPARC v8+";
     37   else
     38     eh->name = "SPARC";
     39   eh->reloc_type_name = sparc_reloc_type_name;
     40   eh->reloc_type_check = sparc_reloc_type_check;
     41   //eh->core_note = sparc_core_note;
     42   eh->destr = sparc_destr;
     43 
     44   return 0;
     45 }
     46