From patchwork Fri Mar 4 13:38:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 51572 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BB76C3857C63 for ; Fri, 4 Mar 2022 13:43:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB76C3857C63 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1646401411; bh=QPEkopsHZCpFQi1kFYcNJQVqYaadyrHjorIxp0pnDVc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=fpERM9kA/GhVlVJeni/sNTpAhV45Jgrfx4VdgUJnw8ya02nRT532Gx+Om1XlSlrUQ AaOfD5Uelp4UGHPfAIkfpGDM+Kplkn4E1OS8gBHoqhsWjw+tYOmHLuI7QVEcjkQuIc 42IQo+WimR843xQNwhh0qKAkluXfPlcErLqaCUDQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by sourceware.org (Postfix) with ESMTPS id 44CE0385801B for ; Fri, 4 Mar 2022 13:38:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 44CE0385801B Received: by mail-oi1-x234.google.com with SMTP id x193so7878894oix.0 for ; Fri, 04 Mar 2022 05:38:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QPEkopsHZCpFQi1kFYcNJQVqYaadyrHjorIxp0pnDVc=; b=E7ueynSlTIZZ2vVDtfD4YNn3xdQETfn6deEBgDDNEiHjDq7ehmkAeTH0Y4bR+JKJci Re/XjqP3/QHo/1oYiJNamGV10wKxGWIAy7oY0dy1u3PLlWLiyYZVHIMQRK35auNCPQxD Sjai6rLuKU6HNgtx/ixzt67SOL9sYWP7lVwKtIwNfJpp6gtxjuyYkbCFmWs/Duac9pKi ESPJY3kto0Bt+v85KFGW4i+KwakcGpyf94ylfknGqo2DqKaTU/+tpom13/B9npEOttoB cKx/xYtNJh+L/zznLx+ZbbWLV64VlX15I+9P+ke1XFXQp38Iy+17b894rlmAVp1P32M/ 2/Ag== X-Gm-Message-State: AOAM532U9YojvL58kjBzdRzeqQXh4oX8Lfn1q2NDBawmIoqpriSzuEmv RvqC7vz5pKcljHJrg2EnUwu986Glr2B7qA== X-Google-Smtp-Source: ABdhPJyhnH4qQDtAZHGIzhVBFICQGPep207hmktsoVf6oBrve/zyWHANyRBAVnRMBW6AlGXdCXP+gA== X-Received: by 2002:a05:6808:1645:b0:2d4:377e:eb92 with SMTP id az5-20020a056808164500b002d4377eeb92mr9640436oib.166.1646401088857; Fri, 04 Mar 2022 05:38:08 -0800 (PST) Received: from birita.. ([2804:431:c7ca:2dcb:a992:742c:8048:43bc]) by smtp.gmail.com with ESMTPSA id i11-20020a056830402b00b005af1411565bsm2270240ots.78.2022.03.04.05.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 05:38:08 -0800 (PST) To: libc-alpha@sourceware.org, Florian Weimer Subject: [PATCH v2 2/3] elf: Remove ldconfig kernel version check Date: Fri, 4 Mar 2022 10:38:00 -0300 Message-Id: <20220304133801.1868553-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220304133801.1868553-1-adhemerval.zanella@linaro.org> References: <20220304133801.1868553-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Now that it was removed on libc.so. --- elf/cache.c | 55 +++----------------- elf/ldconfig.c | 22 +++----- elf/readelflib.c | 51 +----------------- elf/readlib.c | 9 ++-- sysdeps/generic/dl-cache.h | 1 - sysdeps/generic/ldconfig.h | 14 ++--- sysdeps/unix/sysv/linux/arm/readelflib.c | 18 +++---- sysdeps/unix/sysv/linux/ia64/readelflib.c | 18 +++---- sysdeps/unix/sysv/linux/mips/readelflib.c | 18 +++---- sysdeps/unix/sysv/linux/powerpc/readelflib.c | 18 +++---- sysdeps/unix/sysv/linux/riscv/readelflib.c | 18 +++---- sysdeps/unix/sysv/linux/s390/readelflib.c | 18 +++---- sysdeps/unix/sysv/linux/sparc/readelflib.c | 18 +++---- sysdeps/unix/sysv/linux/x86/readelflib.c | 18 +++---- 14 files changed, 89 insertions(+), 207 deletions(-) diff --git a/elf/cache.c b/elf/cache.c index dbf4c83a7a..e7d751280d 100644 --- a/elf/cache.c +++ b/elf/cache.c @@ -144,7 +144,6 @@ struct cache_entry struct stringtable_entry *lib; /* Library name. */ struct stringtable_entry *path; /* Path to find library. */ int flags; /* Flags to indicate kind of library. */ - unsigned int osversion; /* Required OS version. */ unsigned int isa_level; /* Required ISA level. */ uint64_t hwcap; /* Important hardware capabilities. */ int bits_hwcap; /* Number of bits set in hwcap. */ @@ -163,8 +162,8 @@ static const char *flag_descr[] = /* Print a single entry. */ static void -print_entry (const char *lib, int flag, unsigned int osversion, - uint64_t hwcap, const char *hwcap_string, const char *key) +print_entry (const char *lib, int flag, uint64_t hwcap, + const char *hwcap_string, const char *key) { printf ("\t%s (", lib); switch (flag & FLAG_TYPE_MASK) @@ -240,27 +239,6 @@ print_entry (const char *lib, int flag, unsigned int osversion, printf (", hwcap: \"%s\"", hwcap_string); else if (hwcap != 0) printf (", hwcap: %#.16" PRIx64, hwcap); - if (osversion != 0) - { - static const char *const abi_tag_os[] = - { - [0] = "Linux", - [1] = "Hurd", - [2] = "Solaris", - [3] = "FreeBSD", - [4] = "kNetBSD", - [5] = "Syllable", - [6] = N_("Unknown OS") - }; -#define MAXTAG (sizeof abi_tag_os / sizeof abi_tag_os[0] - 1) - unsigned int os = osversion >> 24; - - printf (_(", OS ABI: %s %d.%d.%d"), - _(abi_tag_os[os > MAXTAG ? MAXTAG : os]), - (osversion >> 16) & 0xff, - (osversion >> 8) & 0xff, - osversion & 0xff); - } printf (") => %s\n", key); } @@ -393,7 +371,7 @@ print_cache (const char *cache_name) /* Print everything. */ for (unsigned int i = 0; i < cache->nlibs; i++) print_entry (cache_data + cache->libs[i].key, - cache->libs[i].flags, 0, 0, NULL, + cache->libs[i].flags, 0, NULL, cache_data + cache->libs[i].value); } else if (format == 1) @@ -414,7 +392,6 @@ print_cache (const char *cache_name) &cache_new->libs[i]); print_entry (cache_data + cache_new->libs[i].key, cache_new->libs[i].flags, - cache_new->libs[i].osversion, cache_new->libs[i].hwcap, hwcaps_string, cache_data + cache_new->libs[i].value); } @@ -467,10 +444,6 @@ compare (const struct cache_entry *e1, const struct cache_entry *e2) return 1; else if (e2->hwcap < e1->hwcap) return -1; - if (e2->osversion > e1->osversion) - return 1; - if (e2->osversion < e1->osversion) - return -1; } return res; } @@ -671,7 +644,6 @@ save_cache (const char *cache_name) always begins at the beginning of the new cache struct. */ file_entries_new->libs[idx_new].flags = entry->flags; - file_entries_new->libs[idx_new].osversion = entry->osversion; if (entry->hwcaps == NULL) file_entries_new->libs[idx_new].hwcap = entry->hwcap; else @@ -792,8 +764,7 @@ save_cache (const char *cache_name) /* Add one library to the cache. */ void add_to_cache (const char *path, const char *filename, const char *soname, - int flags, unsigned int osversion, - unsigned int isa_level, uint64_t hwcap, + int flags, unsigned int isa_level, uint64_t hwcap, struct glibc_hwcaps_subdirectory *hwcaps) { struct cache_entry *new_entry = xmalloc (sizeof (*new_entry)); @@ -810,7 +781,6 @@ add_to_cache (const char *path, const char *filename, const char *soname, new_entry->lib = stringtable_add (&strings, soname); new_entry->path = path_interned; new_entry->flags = flags; - new_entry->osversion = osversion; new_entry->isa_level = isa_level; new_entry->hwcap = hwcap; new_entry->hwcaps = hwcaps; @@ -867,7 +837,6 @@ struct aux_cache_entry { struct aux_cache_entry_id id; int flags; - unsigned int osversion; unsigned int isa_level; int used; char *soname; @@ -881,7 +850,6 @@ struct aux_cache_file_entry struct aux_cache_entry_id id; /* Unique id of entry. */ int32_t flags; /* This is 1 for an ELF library. */ uint32_t soname; /* String table indice. */ - uint32_t osversion; /* Required OS version. */ uint32_t isa_level; /* Required ISA level. */ }; @@ -932,8 +900,7 @@ init_aux_cache (void) } int -search_aux_cache (struct stat *stat_buf, int *flags, - unsigned int *osversion, unsigned int *isa_level, +search_aux_cache (struct stat *stat_buf, int *flags, unsigned int *isa_level, char **soname) { struct aux_cache_entry_id id; @@ -951,7 +918,6 @@ search_aux_cache (struct stat *stat_buf, int *flags, && id.dev == entry->id.dev) { *flags = entry->flags; - *osversion = entry->osversion; *isa_level = entry->isa_level; if (entry->soname != NULL) *soname = xstrdup (entry->soname); @@ -966,8 +932,7 @@ search_aux_cache (struct stat *stat_buf, int *flags, static void insert_to_aux_cache (struct aux_cache_entry_id *id, int flags, - unsigned int osversion, unsigned int isa_level, - const char *soname, int used) + unsigned int isa_level, const char *soname, int used) { size_t hash = aux_cache_entry_id_hash (id) % aux_hash_size; struct aux_cache_entry *entry; @@ -982,7 +947,6 @@ insert_to_aux_cache (struct aux_cache_entry_id *id, int flags, entry = xmalloc (sizeof (struct aux_cache_entry) + len); entry->id = *id; entry->flags = flags; - entry->osversion = osversion; entry->isa_level = isa_level; entry->used = used; if (soname != NULL) @@ -994,8 +958,7 @@ insert_to_aux_cache (struct aux_cache_entry_id *id, int flags, } void -add_to_aux_cache (struct stat *stat_buf, int flags, - unsigned int osversion, unsigned int isa_level, +add_to_aux_cache (struct stat *stat_buf, int flags, unsigned int isa_level, const char *soname) { struct aux_cache_entry_id id; @@ -1003,7 +966,7 @@ add_to_aux_cache (struct stat *stat_buf, int flags, id.ctime = (uint64_t) stat_buf->st_ctime; id.size = (uint64_t) stat_buf->st_size; id.dev = (uint64_t) stat_buf->st_dev; - insert_to_aux_cache (&id, flags, osversion, isa_level, soname, 1); + insert_to_aux_cache (&id, flags, isa_level, soname, 1); } /* Load auxiliary cache to search for unchanged entries. */ @@ -1051,7 +1014,6 @@ load_aux_cache (const char *aux_cache_name) for (unsigned int i = 0; i < aux_cache->nlibs; ++i) insert_to_aux_cache (&aux_cache->libs[i].id, aux_cache->libs[i].flags, - aux_cache->libs[i].osversion, aux_cache->libs[i].isa_level, aux_cache->libs[i].soname == 0 ? NULL : aux_cache_data + aux_cache->libs[i].soname, @@ -1120,7 +1082,6 @@ save_aux_cache (const char *aux_cache_name) str = mempcpy (str, entry->soname, len); str_offset += len; } - file_entries->libs[idx].osversion = entry->osversion; file_entries->libs[idx++].isa_level = entry->isa_level; } diff --git a/elf/ldconfig.c b/elf/ldconfig.c index 57bb95ebc3..9394ac6438 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c @@ -658,7 +658,6 @@ manual_link (char *library) char *soname; struct stat stat_buf; int flag; - unsigned int osversion; unsigned int isa_level; /* Prepare arguments for create_links call. Split library name in @@ -723,8 +722,8 @@ manual_link (char *library) goto out; } - if (process_file (real_library, library, libname, &flag, &osversion, - &isa_level, &soname, 0, &stat_buf)) + if (process_file (real_library, library, libname, &flag, &isa_level, &soname, + 0, &stat_buf)) { error (0, 0, _("No link created since soname could not be found for %s"), library); @@ -772,7 +771,6 @@ struct dlib_entry char *soname; int flag; int is_link; - unsigned int osversion; unsigned int isa_level; struct dlib_entry *next; }; @@ -991,22 +989,18 @@ search_dir (const struct dir_entry *entry) /* First search whether the auxiliary cache contains this library already and it's not changed. */ char *soname; - unsigned int osversion; unsigned int isa_level; - if (!search_aux_cache (&lstat_buf, &flag, &osversion, &isa_level, - &soname)) + if (!search_aux_cache (&lstat_buf, &flag, &isa_level, &soname)) { if (process_file (real_name, file_name, direntry->d_name, &flag, - &osversion, &isa_level, &soname, is_link, - &lstat_buf)) + &isa_level, &soname, is_link, &lstat_buf)) { if (real_name != real_file_name) free (real_name); continue; } else if (opt_build_cache) - add_to_aux_cache (&lstat_buf, flag, osversion, isa_level, - soname); + add_to_aux_cache (&lstat_buf, flag, isa_level, soname); } if (soname == NULL) @@ -1111,7 +1105,6 @@ search_dir (const struct dir_entry *entry) free (dlib_ptr->name); dlib_ptr->name = xstrdup (direntry->d_name); dlib_ptr->is_link = is_link; - dlib_ptr->osversion = osversion; dlib_ptr->isa_level = isa_level; } /* Don't add this library, abort loop. */ @@ -1128,7 +1121,6 @@ search_dir (const struct dir_entry *entry) dlib_ptr->soname = soname; dlib_ptr->flag = flag; dlib_ptr->is_link = is_link; - dlib_ptr->osversion = osversion; dlib_ptr->isa_level = isa_level; /* Add at head of list. */ dlib_ptr->next = dlibs; @@ -1166,8 +1158,8 @@ search_dir (const struct dir_entry *entry) } if (opt_build_cache) add_to_cache (entry->path, filename, dlib_ptr->soname, - dlib_ptr->flag, dlib_ptr->osversion, - dlib_ptr->isa_level, hwcap, entry->hwcaps); + dlib_ptr->flag, dlib_ptr->isa_level, hwcap, + entry->hwcaps); } /* Free all resources. */ diff --git a/elf/readelflib.c b/elf/readelflib.c index e147416363..771182b5d0 100644 --- a/elf/readelflib.c +++ b/elf/readelflib.c @@ -40,8 +40,8 @@ do \ /* 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) + unsigned int *isa_level, char **soname, void *file_contents, + size_t file_length) { int i; unsigned int j; @@ -55,7 +55,6 @@ process_elf_file (const char *file_name, const char *lib, int *flag, char *dynamic_strings; elf_header = (ElfW(Ehdr) *) file_contents; - *osversion = 0; if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS)) { @@ -121,52 +120,6 @@ process_elf_file (const char *file_name, const char *lib, int *flag, } break; - case PT_NOTE: - if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4) - { - ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents - + segment->p_offset); - ElfW(Addr) size = segment->p_filesz; - /* NB: Some PT_NOTE segment may have alignment value of 0 - or 1. gABI specifies that PT_NOTE segments should be - aligned to 4 bytes in 32-bit objects and to 8 bytes in - 64-bit objects. As a Linux extension, we also support - 4 byte alignment in 64-bit objects. If p_align is less - than 4, we treate alignment as 4 bytes since some note - segments have 0 or 1 byte alignment. */ - ElfW(Addr) align = segment->p_align; - if (align < 4) - align = 4; - else if (align != 4 && align != 8) - continue; - - while (abi_note [0] != 4 || abi_note [1] != 16 - || abi_note [2] != 1 - || memcmp (abi_note + 3, "GNU", 4) != 0) - { - ElfW(Addr) note_size - = ELF_NOTE_NEXT_OFFSET (abi_note[0], abi_note[1], - align); - - if (size - 32 < note_size || note_size == 0) - { - size = 0; - break; - } - size -= note_size; - abi_note = (void *) abi_note + note_size; - } - - if (size == 0) - break; - - *osversion = ((abi_note [4] << 24) - | ((abi_note [5] & 0xff) << 16) - | ((abi_note [6] & 0xff) << 8) - | (abi_note [7] & 0xff)); - } - break; - case PT_GNU_PROPERTY: /* The NT_GNU_PROPERTY_TYPE_0 note must be aligned to 4 bytes in 32-bit objects and to 8 bytes in 64-bit objects. Skip diff --git a/elf/readlib.c b/elf/readlib.c index 3651dcdd8e..ed42fbd48e 100644 --- a/elf/readlib.c +++ b/elf/readlib.c @@ -72,9 +72,8 @@ is_gdb_python_file (const char *name) /* Returns 0 if everything is ok, != 0 in case of error. */ int process_file (const char *real_file_name, const char *file_name, - const char *lib, int *flag, unsigned int *osversion, - unsigned int *isa_level, char **soname, int is_link, - struct stat *stat_buf) + const char *lib, int *flag, unsigned int *isa_level, + char **soname, int is_link, struct stat *stat_buf) { FILE *file; struct stat statbuf; @@ -172,8 +171,8 @@ process_file (const char *real_file_name, const char *file_name, /* Libraries have to be shared object files. */ else if (elf_header->e_type != ET_DYN) ret = 1; - else if (process_elf_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, statbuf.st_size)) + else if (process_elf_file (file_name, lib, flag, isa_level, soname, + file_contents, statbuf.st_size)) ret = 1; done: diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h index df385dca2d..2944963531 100644 --- a/sysdeps/generic/dl-cache.h +++ b/sysdeps/generic/dl-cache.h @@ -95,7 +95,6 @@ struct file_entry_new uint32_t key, value; /* String table indices. */ }; }; - uint32_t osversion; /* Required OS version. */ uint64_t hwcap; /* Hwcap entry. */ }; diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h index 94f008bd90..7cc898db61 100644 --- a/sysdeps/generic/ldconfig.h +++ b/sysdeps/generic/ldconfig.h @@ -70,8 +70,7 @@ const char *glibc_hwcaps_subdirectory_name extern void add_to_cache (const char *path, const char *filename, const char *soname, int flags, - unsigned int osversion, unsigned int isa_level, - uint64_t hwcap, + unsigned int isa_level, uint64_t hwcap, struct glibc_hwcaps_subdirectory *); extern void init_aux_cache (void); @@ -79,28 +78,23 @@ extern void init_aux_cache (void); extern void load_aux_cache (const char *aux_cache_name); extern int search_aux_cache (struct stat *stat_buf, int *flags, - unsigned int *osversion, unsigned int *isa_level, char **soname); extern void add_to_aux_cache (struct stat *stat_buf, int flags, - unsigned int osversion, unsigned int isa_level, const char *soname); extern void save_aux_cache (const char *aux_cache_name); /* Declared in readlib.c. */ extern int process_file (const char *real_file_name, const char *file_name, - const char *lib, int *flag, - unsigned int *osversion, unsigned int *isa_level, - char **soname, int is_link, - struct stat *stat_buf); + const char *lib, int *flag, unsigned int *isa_level, + char **soname, int is_link, struct stat *stat_buf); extern char *implicit_soname (const char *lib, int flag); /* Declared in readelflib.c. */ extern int process_elf_file (const char *file_name, const char *lib, - int *flag, unsigned int *osversion, - unsigned int *isa_level, char **soname, + int *flag, unsigned int *isa_level, char **soname, void *file_contents, size_t file_length); /* Declared in chroot_canon.c. */ diff --git a/sysdeps/unix/sysv/linux/arm/readelflib.c b/sysdeps/unix/sysv/linux/arm/readelflib.c index 428b0f85ff..d4956e2d25 100644 --- a/sysdeps/unix/sysv/linux/arm/readelflib.c +++ b/sysdeps/unix/sysv/linux/arm/readelflib.c @@ -17,19 +17,17 @@ int process_elf32_file (const char *file_name, const char *lib, - int *flag, unsigned int *osversion, - unsigned int *isa_level, char **soname, + int *flag, 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, + int *flag, 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) + unsigned int *isa_level, char **soname, void *file_contents, + size_t file_length) { ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; int ret; @@ -38,8 +36,8 @@ process_elf_file (const char *file_name, const char *lib, int *flag, { Elf32_Ehdr *elf32_header = (Elf32_Ehdr *) elf_header; - ret = process_elf32_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf32_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); if (!ret && EF_ARM_EABI_VERSION (elf32_header->e_flags) == EF_ARM_EABI_VER5) { @@ -57,8 +55,8 @@ process_elf_file (const char *file_name, const char *lib, int *flag, } else { - ret = process_elf64_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf64_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); /* AArch64 libraries are always libc.so.6+. */ if (!ret) *flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6; diff --git a/sysdeps/unix/sysv/linux/ia64/readelflib.c b/sysdeps/unix/sysv/linux/ia64/readelflib.c index cd0918176a..bfd3558675 100644 --- a/sysdeps/unix/sysv/linux/ia64/readelflib.c +++ b/sysdeps/unix/sysv/linux/ia64/readelflib.c @@ -17,30 +17,28 @@ int process_elf32_file (const char *file_name, const char *lib, - int *flag, unsigned int *osversion, - unsigned int *isa_level, char **soname, + int *flag, 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, + int *flag, 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) + 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) - return process_elf32_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + return process_elf32_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); else { - ret = process_elf64_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf64_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); /* Intel 64bit libraries are always libc.so.6+. */ if (!ret) *flag = FLAG_IA64_LIB64|FLAG_ELF_LIBC6; diff --git a/sysdeps/unix/sysv/linux/mips/readelflib.c b/sysdeps/unix/sysv/linux/mips/readelflib.c index cfa6a12c1a..8c66ba1fa1 100644 --- a/sysdeps/unix/sysv/linux/mips/readelflib.c +++ b/sysdeps/unix/sysv/linux/mips/readelflib.c @@ -17,19 +17,17 @@ int process_elf32_file (const char *file_name, const char *lib, - int *flag, unsigned int *osversion, - unsigned int *isa_level, char **soname, + int *flag, 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, + int *flag, 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) + unsigned int *isa_level, char **soname, void *file_contents, + size_t file_length) { union { @@ -43,8 +41,8 @@ process_elf_file (const char *file_name, const char *lib, int *flag, elf_header.eh = file_contents; if (elf_header.eh->e_ident [EI_CLASS] == ELFCLASS32) { - ret = process_elf32_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf32_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); if (!ret) { Elf32_Word flags = elf_header.eh32->e_flags; @@ -60,8 +58,8 @@ process_elf_file (const char *file_name, const char *lib, int *flag, } else { - ret = process_elf64_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf64_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); /* n64 libraries are always libc.so.6+. */ if (!ret) { diff --git a/sysdeps/unix/sysv/linux/powerpc/readelflib.c b/sysdeps/unix/sysv/linux/powerpc/readelflib.c index 90ea9bf6f7..3b6902e35b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/readelflib.c +++ b/sysdeps/unix/sysv/linux/powerpc/readelflib.c @@ -18,30 +18,28 @@ int process_elf32_file (const char *file_name, const char *lib, - int *flag, unsigned int *osversion, - unsigned int *isa_level, char **soname, + int *flag, 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, + int *flag, 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) + 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) - return process_elf32_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + return process_elf32_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); else { - ret = process_elf64_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf64_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); /* PowerPC 64bit libraries are always libc.so.6+. */ if (!ret) *flag = FLAG_POWERPC_LIB64|FLAG_ELF_LIBC6; diff --git a/sysdeps/unix/sysv/linux/riscv/readelflib.c b/sysdeps/unix/sysv/linux/riscv/readelflib.c index 29f1ac676f..db882c066f 100644 --- a/sysdeps/unix/sysv/linux/riscv/readelflib.c +++ b/sysdeps/unix/sysv/linux/riscv/readelflib.c @@ -18,12 +18,10 @@ int process_elf32_file (const char *file_name, const char *lib, - int *flag, unsigned int *osversion, - unsigned int *isa_level, char **soname, + int *flag, 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, + int *flag, unsigned int *isa_level, char **soname, void *file_contents, size_t file_length); /* The ELF flags supported by our current glibc port: @@ -40,8 +38,8 @@ int process_elf64_file (const char *file_name, const char *lib, /* 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) + unsigned int *isa_level, char **soname, void *file_contents, + size_t file_length) { ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; Elf32_Ehdr *elf32_header = (Elf32_Ehdr *) elf_header; @@ -54,14 +52,14 @@ process_elf_file (const char *file_name, const char *lib, int *flag, if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) { - ret = process_elf32_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf32_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); flags = elf32_header->e_flags; } else { - ret = process_elf64_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf64_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); flags = elf64_header->e_flags; } diff --git a/sysdeps/unix/sysv/linux/s390/readelflib.c b/sysdeps/unix/sysv/linux/s390/readelflib.c index e3f51cc34d..063fce9d18 100644 --- a/sysdeps/unix/sysv/linux/s390/readelflib.c +++ b/sysdeps/unix/sysv/linux/s390/readelflib.c @@ -17,30 +17,28 @@ int process_elf32_file (const char *file_name, const char *lib, - int *flag, unsigned int *osversion, - unsigned int *isa_level, char **soname, + int *flag, 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, + int *flag, 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) + 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) - return process_elf32_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + return process_elf32_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); else { - ret = process_elf64_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf64_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); /* S/390 64bit libraries are always libc.so.6+. */ if (!ret) *flag = FLAG_S390_LIB64|FLAG_ELF_LIBC6; diff --git a/sysdeps/unix/sysv/linux/sparc/readelflib.c b/sysdeps/unix/sysv/linux/sparc/readelflib.c index bc7b1f4f90..97d441693c 100644 --- a/sysdeps/unix/sysv/linux/sparc/readelflib.c +++ b/sysdeps/unix/sysv/linux/sparc/readelflib.c @@ -17,30 +17,28 @@ int process_elf32_file (const char *file_name, const char *lib, - int *flag, unsigned int *osversion, - unsigned int *isa_level, char **soname, + int *flag, 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, + int *flag, 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) + 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) - return process_elf32_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + return process_elf32_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); else { - ret = process_elf64_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf64_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); /* Sparc 64bit libraries are always libc.so.6+. */ if (!ret) *flag = FLAG_SPARC_LIB64|FLAG_ELF_LIBC6; diff --git a/sysdeps/unix/sysv/linux/x86/readelflib.c b/sysdeps/unix/sysv/linux/x86/readelflib.c index 8863b752a2..cfa2a9dd22 100644 --- a/sysdeps/unix/sysv/linux/x86/readelflib.c +++ b/sysdeps/unix/sysv/linux/x86/readelflib.c @@ -16,19 +16,17 @@ . */ int process_elf32_file (const char *file_name, const char *lib, - int *flag, unsigned int *osversion, - unsigned int *isa_level, char **soname, + int *flag, 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, + int *flag, 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) + unsigned int *isa_level, char **soname, void *file_contents, + size_t file_length) { ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; int ret, file_flag = 0; @@ -67,11 +65,11 @@ failed: } if (elf_header->e_ident[EI_CLASS] == ELFCLASS32) - ret = process_elf32_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf32_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); else - ret = process_elf64_file (file_name, lib, flag, osversion, isa_level, - soname, file_contents, file_length); + ret = process_elf64_file (file_name, lib, flag, isa_level, soname, + file_contents, file_length); if (!ret && file_flag) *flag = file_flag;