]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/s390/readelflib.c
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / s390 / readelflib.c
CommitLineData
a334319f 1/* Copyright (C) 2001 Free Software Foundation, Inc.
96c0d65d
UD
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
96c0d65d
UD
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 12 Lesser General Public License for more details.
96c0d65d 13
41bdb6e2
AJ
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
96c0d65d
UD
18
19
20int process_elf32_file (const char *file_name, const char *lib, int *flag,
21 unsigned int *osversion, char **soname,
22 void *file_contents, size_t file_length);
23int process_elf64_file (const char *file_name, const char *lib, int *flag,
24 unsigned int *osversion, char **soname,
25 void *file_contents, size_t file_length);
26
27/* Returns 0 if everything is ok, != 0 in case of error. */
28int
29process_elf_file (const char *file_name, const char *lib, int *flag,
30 unsigned int *osversion, char **soname, void *file_contents,
31 size_t file_length)
32{
33 ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
34 int ret;
35
36 if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
37 return process_elf32_file (file_name, lib, flag, osversion, soname,
38 file_contents, file_length);
39 else
40 {
41 ret = process_elf64_file (file_name, lib, flag, osversion, soname,
42 file_contents, file_length);
43 /* S/390 64bit libraries are always libc.so.6+. */
44 if (!ret)
45 *flag = FLAG_S390_LIB64|FLAG_ELF_LIBC6;
46 return ret;
47 }
48}
49
50#undef __ELF_NATIVE_CLASS
51#undef process_elf_file
52#define process_elf_file process_elf32_file
53#define __ELF_NATIVE_CLASS 32
a334319f 54#include "sysdeps/generic/readelflib.c"
96c0d65d
UD
55
56#undef __ELF_NATIVE_CLASS
57#undef process_elf_file
58#define process_elf_file process_elf64_file
59#define __ELF_NATIVE_CLASS 64
a334319f 60#include "sysdeps/generic/readelflib.c"