From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113531 invoked by alias); 27 Dec 2018 02:29:49 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 113520 invoked by uid 89); 27 Dec 2018 02:29:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=H*Ad:D*debian.org, gets, complicated, terminate X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail-vs1-f50.google.com Received: from mail-vs1-f50.google.com (HELO mail-vs1-f50.google.com) (209.85.217.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Dec 2018 02:29:38 +0000 Received: by mail-vs1-f50.google.com with SMTP id v205so10588539vsc.3 for ; Wed, 26 Dec 2018 18:29:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=j0OH8B8tof4GhUb9bmgXgOMB/ccER+716iPtWbidiz4=; b=fkpjNfvkiPBzfmMxIqXRdt5YoKKqCvJ4mEmtOSyEPMppx/FPJ7h97MNzSQOcLgAsd3 zv4AWLJk3oAtCOpaueTHQ/UyKrOaNeSzjlMDHr5F1WNjrM6vrsaWLcdAm6F0ob0u7rLE HsIIbfEXp6YRtbxUlc2GSPYaRG+XxWjgLjjgQf/eX+wwSoGE/3Ib7GB9MH34LFfRapNW vsPrYEgMCpyRC/Sn7D/eBqvzS6h64aHSdVcuV74uh53BQtovTLZA237WGqpLGdg0cOw1 UzS/ukBrJQoJ7N/aYiZwn2U89kj/x1gi3EuuFkCSS/FFvgIKdxoiKfC2RhN2YHyrZ33M w1rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=j0OH8B8tof4GhUb9bmgXgOMB/ccER+716iPtWbidiz4=; b=lj/N1osSyGc3VIKLXSMGGL/h3euj5CRFE5j9UNAgNrt/zXbfW1KMUU7d85veMDVLmd y5ligF2O3Ddqc+HbVB9Mzwi5sIQbo9GJiLGxGgFhll03c0S42V2MQjvXt6TCD5KxUuRI 0AoZSoonIRd5iaoHkyXo7WF6jh5C2veW43XnFDULTtpmFWBVghIfyJ0mnoTfyfxovqug 54Xf1Pe497fXIZUxzeTLcaFTi/a9FujNQqPzUQ6qHLaSXYTFsotbrhbGawuvJScHuNao uYdKHdJ8qIMCyliUqDf2a1X6ujQjVbdf4/p2tuOUYcg18rnwciN9FOK3MKQG+N3Jr28Q 53Cw== X-Gm-Message-State: AA+aEWaFLuSXz/BR8bxctCLN1Q1e4AfDWfVS6Mok/6gnclebLw5oWMiY MkMe5KPxkptDtfgGQtj7BpsIvGu/CBp5YtLPfVSEeJ3WQBgdMg== X-Google-Smtp-Source: ALg8bN7U3HiWPwohmbcC0cVimXRzGZkSRfD5ulVNvFsqHzJ67uFMuS4pmwn7ST+YrHMttLv1j3YT1YfiYzQEtioV3jo= X-Received: by 2002:a67:4e5d:: with SMTP id c90mr9023336vsb.72.1545877776480; Wed, 26 Dec 2018 18:29:36 -0800 (PST) MIME-Version: 1.0 From: Jim Wilson Date: Thu, 27 Dec 2018 02:29:00 -0000 Message-ID: Subject: RISC-V support To: elfutils-devel@sourceware.org Cc: Karsten Merker Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-q4/txt/msg00230.txt.bz2 I'm looking at the RISC-V elfutils support to help the Debian folks. I see four testcases failing, same as Kurt Roeckx reported about 6 weeks ago. I'm testing on a Fedora Core 29 system. I found a trivial bug in backends/riscv_corenote.c. It has ".offset = 1" but this is a byte offset not a register offset, so it needs to be ".offset = 8" instead. I also added in the missing PC support. These two fixes then require a fix for tests/run-readelf-mixed-corenote.sh because the eu-readelf output is now more correct than before. There is also a missing backends/riscv_retval.c file. I have an initial implementation for this, but I haven't implemented the support for structures with one or two float fields yet, as this gets a little complicated. With these patches, I now see two failures. One is a glibc bug that Andreas Schwab already fixed, where _start fails to terminate the unwind chain. I just don't have this patch on my system. The other failure is the same glibc bug in __thread_start, which apparently isn't fixed yet, and needs the same fix Andreas already added to _start. So with the appropriate glibc fixes, the elfutils testsuite should run without error on a riscv64/lp64d system using the patches I have. There is a problem here though. The riscv support was written to try to handle both 32-bit and 64-bit targets with a single elfutils backend. But I have 6 ABIs I need to (theoretically) handle in riscv_retval.c. The return_value_location function doesn't take any ebl or elf pointer, so I can't handle it there. I can handle it in riscv_init.c by checking ebl and elf pointers there, and calling an appropriate function, but I'm not sure if that is OK. Currently, none of the *_init.c files are using the elf pointer argument. I noticed another problem which is that riscv_corenote.c is only correct for riscv64, because it assumes that registers are 64-bits. But I see that sparc has a solution for that, so I will have to take a closer look at that and see if I can make it work for riscv. I unfortunately can't test the 32-bit riscv support. We don't have working upstream support for 32-bit linux yet. I can only test the 64-bit LP64D riscv support. I haven't contributed to elfutils before. So I'm looking for advice on how to proceed. I can send out my work in progress patches if that is useful. I probably should try to chop them up a bit first. I think I have 3 parts at the moment. One part should be OK, and one part needs more work to be complete (but maybe incomplete is OK?), and one part I haven't written yet. Jim