• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (C) 2002 Red Hat, Inc.
2    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
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 <libelf.h>
19 #include <stdio.h>
20 
21 
22 static int
check(const char * name,unsigned long int expected)23 check (const char *name, unsigned long int expected)
24 {
25   unsigned long int actual = elf_hash (name);
26 
27   return actual != expected;
28 }
29 
30 
31 int
main(void)32 main (void)
33 {
34   int status;
35 
36   /* Check some names.  We know what the expected result is.  */
37   status = check ("_DYNAMIC", 165832675);
38   status |= check ("_GLOBAL_OFFSET_TABLE_", 102264335);
39 
40   return status;
41 }
42