Message ID | 1608023800-14560-1-git-send-email-vincent.chen@sifive.com |
---|---|
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> 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 8AAEE385043B; Tue, 15 Dec 2020 09:17:01 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by sourceware.org (Postfix) with ESMTPS id 89550385800D for <libc-alpha@sourceware.org>; Tue, 15 Dec 2020 09:16:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 89550385800D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vincent.chen@sifive.com Received: by mail-pf1-x441.google.com with SMTP id c79so14125126pfc.2 for <libc-alpha@sourceware.org>; Tue, 15 Dec 2020 01:16:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id; bh=dZNLr73Iuoei4Ou6Bt37fT0110JsDaF0X4/ghlQQQi4=; b=Q25vEfYI8DTAiclEJvmMou8c6biaFQivJflsMziWVrhfNkWc0nYQTfYp/vTdB9ZXgO GBpzcDz9FtTVYQXwdRGU/gl9Q73pgjPZEZAbRMrRe2nJrIKEunlHjWWWqYvw8NQE0Xiy OYCN14hhtIrPGU4JZ0cZkmsgD4MMTrBXzwqP4fLJGja3+Sla/7lMRpG6kdAv7sZKEmbP bYn00TVto9MGK6npH6Dp1OMynQqsuDZRfMoZM4zlNq8ipFBro6tJ2qNRAEYwTVOqlaXe jeVrCuwvX+quOx84ghKX3owdt2nudPG7li6dwxFvg4fsDL8ovx0TRLQg2nB6UuHNDlW6 r5SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dZNLr73Iuoei4Ou6Bt37fT0110JsDaF0X4/ghlQQQi4=; b=ErnSjMadRC693acXbpOI7v/PQevm5wpeKOHrMpvZQVr5Odbq9Cub41RevwauktKQ0G FRYfzOoDtnPV4RgQumlw2JdY77BnQnU010+eH7BqSBlCsTmQ3Li3jB+bePzYp5TePp3J FUs5eTQxsQsxq+3S1uRWCZ8oKfRkK4MK8W7UFUVN7zRqjvO9tzYQTg1x1/Kg3ZIDckKu n/wpNgXZ8Of/e67mH2l/LyPFRsrDg5MXFcdltnJdWqk84C5MEJM3JjOfSn53Fuic9+Uw SOmvnbdmg/GJ3Cs2LQNa7kQqJqiClFDsM/QrpUAZ32MTgQ7v+TkOEKrH1+M7Tc89D/SZ FGyg== X-Gm-Message-State: AOAM5332FeuWZlLIj887/T+LG552Gv8BM6A/LKr7Dxk6xMJNuXGQSSc5 jzHtEgKc3bMM8lIHLk5NjOvOchYcYDIADLudhZQ= X-Google-Smtp-Source: ABdhPJxFscGodPRweX4N9t7iTRqgOI++vt6SMfNwS0GLukxZOLveOmG7Qjx/+d4jPh3nTHBQ7fYnTQ== X-Received: by 2002:a05:6a00:795:b029:19e:28de:e92a with SMTP id g21-20020a056a000795b029019e28dee92amr235798pfu.36.1608023818506; Tue, 15 Dec 2020 01:16:58 -0800 (PST) Received: from VincentChen-ThinkPad-T480s.internal.sifive.com (114-34-229-221.HINET-IP.hinet.net. [114.34.229.221]) by smtp.gmail.com with ESMTPSA id e8sm19193256pfn.176.2020.12.15.01.16.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Dec 2020 01:16:57 -0800 (PST) From: Vincent Chen <vincent.chen@sifive.com> To: libc-alpha@sourceware.org, palmer@dabbelt.com, darius@bluespec.com, dj@redhat.com Subject: [PATCH v2 0/2] riscv: add support for GNU indirect function Date: Tue, 15 Dec 2020 17:16:38 +0800 Message-Id: <1608023800-14560-1-git-send-email-vincent.chen@sifive.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Cc: nelson.chu@sifive.com, Vincent Chen <vincent.chen@sifive.com>, paul.walmsley@sifive.com Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
riscv: add support for GNU indirect function
|
|
Message
Vincent Chen
Dec. 15, 2020, 9:16 a.m. UTC
The riscv Binutils supported GNU indirect function in the commit 02dd9d25. To make the entire mechanism work, these patches adds the required ports to enable Glibc to address the IRELATIVE relocation. Because the dynamic linker resolves the IRELATIVE relocation before jumping into the executable program, the $gp register is not initialized when executing the IFUNC resolver function. It may cause some unexpected error to occur when the dynamic loader resolves the IREALTIVE relocation of the position-dependent executable program. To solve this issue, the second patch enables dynamic linker to look for the __global_pointer$ symbol and use it to initialize $gp before resolving the IREALTIVE relocation of the PDE program. Changes since v1: 1. Move the riscv entry to the end of libc-abis file 2. Add the second input argument to IFUNC resolver to preserve the extension flexibility 3. Enable ld.so to initilize $gp by __global_pointer$ symbol instead of the DT_RISCV_GP dynamic entry to avoid to modify the riscv ELF psABI specification. Vincent Chen (2): riscv: support GNU indirect function riscv: Initialize $gp before resolving the IRELATIVE relocation libc-abis | 1 + sysdeps/riscv/dl-irel.h | 56 ++++++++++++++++++++++++++++++++++++++ sysdeps/riscv/dl-machine.h | 44 +++++++++++++++++++++++++++++- 3 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 sysdeps/riscv/dl-irel.h
Comments
On Tue, Dec 15, 2020 at 5:16 PM Vincent Chen <vincent.chen@sifive.com> wrote: > > The riscv Binutils supported GNU indirect function in the commit > 02dd9d25. To make the entire mechanism work, these patches adds the > required ports to enable Glibc to address the IRELATIVE relocation. > > Because the dynamic linker resolves the IRELATIVE relocation before > jumping into the executable program, the $gp register is not initialized > when executing the IFUNC resolver function. It may cause some unexpected > error to occur when the dynamic loader resolves the IREALTIVE relocation > of the position-dependent executable program. To solve this issue, the > second patch enables dynamic linker to look for the __global_pointer$ > symbol and use it to initialize $gp before resolving the IREALTIVE > relocation of the PDE program. > > > Changes since v1: > 1. Move the riscv entry to the end of libc-abis file > 2. Add the second input argument to IFUNC resolver to preserve the > extension flexibility > 3. Enable ld.so to initilize $gp by __global_pointer$ symbol instead > of the DT_RISCV_GP dynamic entry to avoid to modify the riscv ELF > psABI specification. > Gentle ping on this series. Thanks and happy new year. > > Vincent Chen (2): > riscv: support GNU indirect function > riscv: Initialize $gp before resolving the IRELATIVE relocation > > libc-abis | 1 + > sysdeps/riscv/dl-irel.h | 56 ++++++++++++++++++++++++++++++++++++++ > sysdeps/riscv/dl-machine.h | 44 +++++++++++++++++++++++++++++- > 3 files changed, 100 insertions(+), 1 deletion(-) > create mode 100644 sysdeps/riscv/dl-irel.h > > -- > 2.29.2 >
On Sun, Jan 3, 2021 at 5:38 PM Vincent Chen <vincent.chen@sifive.com> wrote: > Gentle ping on this series. Thanks and happy new year. > This is on the release blockers list at my request, so hopefully it will get looked at before the release. https://sourceware.org/glibc/wiki/Release/2.33#Release_blockers.3F Jim
On Tue, Jan 5, 2021 at 9:53 AM Jim Wilson <jimw@sifive.com> wrote: > This is on the release blockers list at my request, so hopefully it will get looked at before the release. > https://sourceware.org/glibc/wiki/Release/2.33#Release_blockers.3F Thank you very much, Jim. > 3. Enable ld.so to initilize $gp by __global_pointer$ symbol instead > of the DT_RISCV_GP dynamic entry to avoid to modify the riscv ELF The binutils commit 18b9872261b950a8d10a4ae6ccb8f2acdaebc3e6 is committed, so this should work when updating the mainline binutils. Thanks Nelson psABI specification.
On 1/4/21 8:53 PM, Jim Wilson wrote: > On Sun, Jan 3, 2021 at 5:38 PM Vincent Chen <vincent.chen@sifive.com> wrote: > >> Gentle ping on this series. Thanks and happy new year. >> > > This is on the release blockers list at my request, so hopefully it will > get looked at before the release. > https://sourceware.org/glibc/wiki/Release/2.33#Release_blockers.3F The patches were discussed on the Monday patch review meeting. I've asked DJ to help move these along. I have confidence that we will get to them before the release.
On Tue, Jan 5, 2021 at 8:32 PM Carlos O'Donell <carlos@redhat.com> wrote: > > On 1/4/21 8:53 PM, Jim Wilson wrote: > > On Sun, Jan 3, 2021 at 5:38 PM Vincent Chen <vincent.chen@sifive.com> wrote: > > > >> Gentle ping on this series. Thanks and happy new year. > >> > > > > This is on the release blockers list at my request, so hopefully it will > > get looked at before the release. > > https://sourceware.org/glibc/wiki/Release/2.33#Release_blockers.3F > > The patches were discussed on the Monday patch review meeting. > > I've asked DJ to help move these along. > > I have confidence that we will get to them before the release. > Glad to hear this information. Thanks to the people who have given me help on this patch set. Best Regards Vincent Chen
Thank you all ! Nelson On Mon, Jan 11, 2021 at 10:29 AM DJ Delorie <dj@redhat.com> wrote: > > Vincent Chen <vincent.chen@sifive.com> writes: > > Gentle ping on this series. Thanks and happy new year. > > Series committed. Thanks! >