From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWsxN-0002Pp-V5 for qemu-devel@nongnu.org; Wed, 03 Jan 2018 19:00:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWsxK-00052i-Kp for qemu-devel@nongnu.org; Wed, 03 Jan 2018 19:00:25 -0500 Received: from mail-pg0-x22c.google.com ([2607:f8b0:400e:c05::22c]:39898) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWsxK-00051A-9m for qemu-devel@nongnu.org; Wed, 03 Jan 2018 19:00:22 -0500 Received: by mail-pg0-x22c.google.com with SMTP id 81so22135pgf.6 for ; Wed, 03 Jan 2018 16:00:21 -0800 (PST) References: <1514940265-18093-1-git-send-email-mjc@sifive.com> <1514940265-18093-12-git-send-email-mjc@sifive.com> From: Richard Henderson Message-ID: Date: Wed, 3 Jan 2018 16:00:17 -0800 MIME-Version: 1.0 In-Reply-To: <1514940265-18093-12-git-send-email-mjc@sifive.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1 11/21] RISC-V HTIF Console List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Clark , qemu-devel@nongnu.org Cc: Bastian Koppelmann , Sagar Karandikar On 01/02/2018 04:44 PM, Michael Clark wrote: > + /* > + * Find the static and dynamic symbol tables and their string > + * tables in the the mapped binary. The sh_link field in symbol > + * table section headers gives the section index of the string > + * table for that symbol table. > + */ > + shdr = (Elf64_Shdr *)(ep->maddr + ep->ehdr->e_shoff); This fails to do any byte swapping such that this code works on a big-endian host. You should use the routines in "hw/elf_ops.h" as adjusted by "hw/loader.h". r~