OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [utils/] [readsoname.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/* adapted from Eric Youngdale's readelf program */
2
 
3
#include <stdio.h>
4
#include <string.h>
5
#include <sys/stat.h>
6
#include <sys/mman.h>
7
#include <link.h>
8
#include <unistd.h>
9
#include <sys/types.h>
10
#include <ld_elf.h>
11
#include "readsoname.h"
12
 
13
void warn(char *fmt, ...);
14
char *xstrdup(char *);
15
 
16
struct needed_tab
17
{
18
  char *soname;
19
  int type;
20
};
21
 
22
struct needed_tab needed_tab[] = {
23
  { "libc.so.0",    LIB_ELF_LIBC0 },
24
  { "libm.so.0",    LIB_ELF_LIBC0 },
25
  { "libdl.so.0",   LIB_ELF_LIBC0 },
26
  { "libc.so.5",    LIB_ELF_LIBC5 },
27
  { "libm.so.5",    LIB_ELF_LIBC5 },
28
  { "libdl.so.1",   LIB_ELF_LIBC5 },
29
  { "libc.so.6",    LIB_ELF_LIBC6 },
30
  { "libm.so.6",    LIB_ELF_LIBC6 },
31
  { "libdl.so.2",   LIB_ELF_LIBC6 },
32
  { NULL,           LIB_ELF }
33
};
34
 
35
char *readsoname(char *name, FILE *infile, int expected_type,
36
                 int *type, int elfclass)
37
{
38
  char *res;
39
 
40
  if (elfclass == ELFCLASS32)
41
    res = readsoname32(name, infile, expected_type, type);
42
  else
43
  {
44
    res = readsoname64(name, infile, expected_type, type);
45
#if 0
46
    *type |= LIB_ELF64;
47
#endif
48
  }
49
 
50
  return res;
51
}
52
 
53
#undef __ELF_NATIVE_CLASS
54
#undef readsonameXX
55
#define readsonameXX readsoname32
56
#define __ELF_NATIVE_CLASS 32
57
#include "readsoname2.c"
58
 
59
#undef __ELF_NATIVE_CLASS
60
#undef readsonameXX
61
#define readsonameXX readsoname64
62
#define __ELF_NATIVE_CLASS 64
63
#include "readsoname2.c"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.