alpha_init.c revision f47ba53e758a954c72f820e169079aa767d9f96c
1b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper/* Initialization of Alpha specific backend library.
2b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper   Copyright (C) 2002, 2005 Red Hat, Inc.
3b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
4b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
5b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper   This program is Open Source software; you can redistribute it and/or
6b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper   modify it under the terms of the Open Software License version 1.0 as
7b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper   published by the Open Source Initiative.
8b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
9b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper   You should have received a copy of the Open Software License along
10b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper   with this program; if not, you may obtain a copy of the Open Software
11b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper   License version 1.0 from http://www.opensource.org/licenses/osl.php or
12b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper   by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
13b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper   3001 King Ranch Road, Ukiah, CA 95482.   */
14b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
15b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper#ifdef HAVE_CONFIG_H
16b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper# include <config.h>
17b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper#endif
18b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
19cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath#define BACKEND		alpha_
20cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath#define RELOC_PREFIX	R_ALPHA_
21cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath#include "libebl_CPU.h"
22cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath
23cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath/* This defines the common reloc hooks based on alpha_reloc.def.  */
24cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath#include "common-reloc.c"
25b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
26b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
27b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepperconst char *
28b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepperalpha_init (elf, machine, eh, ehlen)
29b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper     Elf *elf __attribute__ ((unused));
30b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper     GElf_Half machine __attribute__ ((unused));
31b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper     Ebl *eh;
32b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper     size_t ehlen;
33b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper{
34b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper  /* Check whether the Elf_BH object has a sufficent size.  */
35b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper  if (ehlen < sizeof (Ebl))
36b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper    return NULL;
37b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
38b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper  /* We handle it.  */
39b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper  eh->name = "Alpha";
40cd60ea83050d9fb48c3204005f475df460f433b6Roland McGrath  alpha_init_reloc (eh);
41f47ba53e758a954c72f820e169079aa767d9f96cRoland McGrath  HOOK (eh, dynamic_tag_name);
42f47ba53e758a954c72f820e169079aa767d9f96cRoland McGrath  HOOK (eh, dynamic_tag_check);
43f47ba53e758a954c72f820e169079aa767d9f96cRoland McGrath  HOOK (eh, reloc_simple_type);
44f47ba53e758a954c72f820e169079aa767d9f96cRoland McGrath  HOOK (eh, return_value_location);
45b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper
46b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper  return MODVERSION;
47b08d5a8fb42f4586d756068065186b5af7e48daUlrich Drepper}
48