alpha_init.c revision 28ed895fdc303b2a793506bb1fcdd35d5fd14e70
1b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper/* Initialization of Alpha specific backend library.
228ed895fdc303b2a793506bb1fcdd35d5fd14e70Ulrich Drepper   Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
3361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   This file is part of Red Hat elfutils.
4b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
5b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
6361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   Red Hat elfutils is free software; you can redistribute it and/or modify
7361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   it under the terms of the GNU General Public License as published by the
8361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   Free Software Foundation; version 2 of the License.
9361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper
10361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   Red Hat elfutils is distributed in the hope that it will be useful, but
11361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   WITHOUT ANY WARRANTY; without even the implied warranty of
12361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   General Public License for more details.
14361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper
15361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   You should have received a copy of the GNU General Public License along
16361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   with Red Hat elfutils; if not, write to the Free Software Foundation,
171e9ef50681e20ef14c2ba38aef37a71ff148be08Ulrich Drepper   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
18361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper
19361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   Red Hat elfutils is an included package of the Open Invention Network.
20361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   An included package of the Open Invention Network is a package for which
21361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   Open Invention Network licensees cross-license their patents.  No patent
22361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   license is granted, either expressly or impliedly, by designation as an
23361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   included package.  Should you wish to participate in the Open Invention
24361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   Network licensing program, please visit www.openinventionnetwork.com
25361df7da6dfecd817b27e62b91752ac316d7cdd4Ulrich Drepper   <http://www.openinventionnetwork.com>.  */
26b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
27b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper#ifdef HAVE_CONFIG_H
28b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper# include <config.h>
29b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper#endif
30b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
31cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath#define BACKEND		alpha_
32cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath#define RELOC_PREFIX	R_ALPHA_
33cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath#include "libebl_CPU.h"
34cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath
35cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath/* This defines the common reloc hooks based on alpha_reloc.def.  */
36cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath#include "common-reloc.c"
37b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
38b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
39b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepperconst char *
40b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepperalpha_init (elf, machine, eh, ehlen)
41b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper     Elf *elf __attribute__ ((unused));
42b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper     GElf_Half machine __attribute__ ((unused));
43b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper     Ebl *eh;
44b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper     size_t ehlen;
45b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper{
46b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper  /* Check whether the Elf_BH object has a sufficent size.  */
47b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper  if (ehlen < sizeof (Ebl))
48b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper    return NULL;
49b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
50b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper  /* We handle it.  */
51b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper  eh->name = "Alpha";
52cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath  alpha_init_reloc (eh);
53f47ba53e758a954c72f820e169079aa767d9f96cRoland McGrath  HOOK (eh, dynamic_tag_name);
54f47ba53e758a954c72f820e169079aa767d9f96cRoland McGrath  HOOK (eh, dynamic_tag_check);
55f47ba53e758a954c72f820e169079aa767d9f96cRoland McGrath  HOOK (eh, reloc_simple_type);
56f47ba53e758a954c72f820e169079aa767d9f96cRoland McGrath  HOOK (eh, return_value_location);
5728ed895fdc303b2a793506bb1fcdd35d5fd14e70Ulrich Drepper  eh->sysvhash_entrysize = sizeof (Elf64_Xword);
58b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
59b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper  return MODVERSION;
60b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper}
61