glibc/sysdeps/unix/sysv/linux/arm/readelflib.c
Siddhesh Poyarekar 30891f35fa Remove "Contributed by" lines
We stopped adding "Contributed by" or similar lines in sources in 2012
in favour of git logs and keeping the Contributors section of the
glibc manual up to date.  Removing these lines makes the license
header a bit more consistent across files and also removes the
possibility of error in attribution when license blocks or files are
copied across since the contributed-by lines don't actually reflect
reality in those cases.

Move all "Contributed by" and similar lines (Written by, Test by,
etc.) into a new file CONTRIBUTED-BY to retain record of these
contributions.  These contributors are also mentioned in
manual/contrib.texi, so we just maintain this additional record as a
courtesy to the earlier developers.

The following scripts were used to filter a list of files to edit in
place and to clean up the CONTRIBUTED-BY file respectively.  These
were not added to the glibc sources because they're not expected to be
of any use in future given that this is a one time task:

https://gist.github.com/siddhesh/b5ecac94eabfd72ed2916d6d8157e7dc
https://gist.github.com/siddhesh/15ea1f5e435ace9774f485030695ee02

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-09-03 22:06:44 +05:30

80 lines
2.8 KiB
C

/* Copyright (C) 1999-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
int process_elf32_file (const char *file_name, const char *lib,
int *flag, unsigned int *osversion,
unsigned int *isa_level, char **soname,
void *file_contents, size_t file_length);
int process_elf64_file (const char *file_name, const char *lib,
int *flag, unsigned int *osversion,
unsigned int *isa_level, char **soname,
void *file_contents, size_t file_length);
/* Returns 0 if everything is ok, != 0 in case of error. */
int
process_elf_file (const char *file_name, const char *lib, int *flag,
unsigned int *osversion, unsigned int *isa_level,
char **soname, void *file_contents, size_t file_length)
{
ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
int ret;
if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
{
Elf32_Ehdr *elf32_header = (Elf32_Ehdr *) elf_header;
ret = process_elf32_file (file_name, lib, flag, osversion, isa_level,
soname, file_contents, file_length);
if (!ret && EF_ARM_EABI_VERSION (elf32_header->e_flags) == EF_ARM_EABI_VER5)
{
if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD)
*flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6;
else if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_SOFT)
*flag = FLAG_ARM_LIBSF|FLAG_ELF_LIBC6;
else
/* We must assume the unmarked objects are compatible
with all ABI variants. Such objects may have been
generated in a transitional period when the ABI
tags were not added to all objects. */
*flag = FLAG_ELF_LIBC6;
}
}
else
{
ret = process_elf64_file (file_name, lib, flag, osversion, isa_level,
soname, file_contents, file_length);
/* AArch64 libraries are always libc.so.6+. */
if (!ret)
*flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
}
return ret;
}
#undef __ELF_NATIVE_CLASS
#undef process_elf_file
#define process_elf_file process_elf32_file
#define __ELF_NATIVE_CLASS 32
#include "elf/readelflib.c"
#undef __ELF_NATIVE_CLASS
#undef process_elf_file
#define process_elf_file process_elf64_file
#define __ELF_NATIVE_CLASS 64
#include "elf/readelflib.c"