From patchwork Fri Feb 9 02:07:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 871183 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-90168-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="xqY1Va+f"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zcz335c1Rz9ryQ for ; Fri, 9 Feb 2018 13:07:11 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:to:subject; q=dns; s= default; b=cDZ06CWqkyCtAL58wtqsRVLImOJ1d4peNpvCzzohno4xTmxrKkdSb g06Vjg+HkucfWTp6fcYUZoQm+/pusGqFNMVCP+qq9Cb3vuNE+BC3h1oalNZt1fk+ mahK+pw2m3pWft+pgAC7kqXEWEBtQOcV/94R32wg1vBcWyA52qK7cY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:to:subject; s=default; bh=1hjjq2im5wFoWRRBSk52waHW9os=; b=xqY1Va+fzFG0lffh6H1jToWuB0kO upWKEvNeKzJC4sYgvbqpsdcZhCexPcX9K6+Vf+L5e80m7huOllgUb7Xj404JdWq+ W4V18eIx/Gd8f0Yc8SiADK7Spwpmce5I9nmuTmRE+AvSZLLW30fZA9qql9jI8vsQ rA5jiH9YP8RtiRo= Received: (qmail 98934 invoked by alias); 9 Feb 2018 02:07:05 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 98785 invoked by uid 89); 9 Feb 2018 02:07:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Date: Thu, 08 Feb 2018 21:07:01 -0500 Message-Id: From: DJ Delorie To: libc-alpha@sourceware.org Subject: riscv: fix elf parsing I think this one is obvious... it was causing ldconfig to cache all libraries with the wrong flags (soft float vs double), thus making the cache useless. * sysdeps/unix/sysv/linux/riscv/readelflib.c (process_elf_file): Fix Elf64 flag parsing. diff --git a/sysdeps/unix/sysv/linux/riscv/readelflib.c b/sysdeps/unix/sysv/linux/riscv/readelflib.c index 6e249ff82f..7e27e0c1d6 100644 --- a/sysdeps/unix/sysv/linux/riscv/readelflib.c +++ b/sysdeps/unix/sysv/linux/riscv/readelflib.c @@ -43,6 +43,7 @@ process_elf_file (const char *file_name, const char *lib, int *flag, { ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; Elf32_Ehdr *elf32_header = (Elf32_Ehdr *) elf_header; + Elf64_Ehdr *elf64_header = (Elf64_Ehdr *) elf_header; int ret; long flags; @@ -59,7 +60,7 @@ process_elf_file (const char *file_name, const char *lib, int *flag, { ret = process_elf64_file (file_name, lib, flag, osversion, soname, file_contents, file_length); - flags = elf32_header->e_flags; + flags = elf64_header->e_flags; } /* RISC-V linkers encode the floating point ABI as part of the ELF headers. */