]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/ia64/readelflib.c
localedata: dz_BT, bo_CN: convert to UTF-8
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / ia64 / readelflib.c
CommitLineData
dff8da6b 1/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
d5efd131
MF
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
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.
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
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
75efb018 15 License along with the GNU C Library; if not, see
5a82c748 16 <https://www.gnu.org/licenses/>. */
d5efd131
MF
17
18
efbbd9c3 19int process_elf32_file (const char *file_name, const char *lib,
c628c229 20 int *flag, unsigned int *isa_level, char **soname,
d5efd131 21 void *file_contents, size_t file_length);
efbbd9c3 22int process_elf64_file (const char *file_name, const char *lib,
c628c229 23 int *flag, unsigned int *isa_level, char **soname,
d5efd131
MF
24 void *file_contents, size_t file_length);
25
26/* Returns 0 if everything is ok, != 0 in case of error. */
27int
28process_elf_file (const char *file_name, const char *lib, int *flag,
c628c229
AZ
29 unsigned int *isa_level, char **soname, void *file_contents,
30 size_t file_length)
d5efd131
MF
31{
32 ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
33 int ret;
34
35 if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
c628c229
AZ
36 return process_elf32_file (file_name, lib, flag, isa_level, soname,
37 file_contents, file_length);
d5efd131
MF
38 else
39 {
c628c229
AZ
40 ret = process_elf64_file (file_name, lib, flag, isa_level, soname,
41 file_contents, file_length);
d5efd131
MF
42 /* Intel 64bit libraries are always libc.so.6+. */
43 if (!ret)
44 *flag = FLAG_IA64_LIB64|FLAG_ELF_LIBC6;
45 return ret;
46 }
47}
48
49#undef __ELF_NATIVE_CLASS
50#undef process_elf_file
51#define process_elf_file process_elf32_file
52#define __ELF_NATIVE_CLASS 32
53#include "elf/readelflib.c"
54
55#undef __ELF_NATIVE_CLASS
56#undef process_elf_file
57#define process_elf_file process_elf64_file
58#define __ELF_NATIVE_CLASS 64
59#include "elf/readelflib.c"