From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by sourceware.org (Postfix) with ESMTPS id 328203857011 for ; Fri, 10 Jul 2020 22:35:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 328203857011 Received: by mail-il1-x141.google.com with SMTP id o3so6373780ilo.12 for ; Fri, 10 Jul 2020 15:35:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pr0uYCul6ExkPQutYuJV7741Hj9NXYAFqF6KHauv7b0=; b=HRisPZ9XmRQ/LN0viY9YrSmc9TcOqPtSMrUf+gtGnZoshP2GFgaHQOWUMvFnnF/20u a8bOiDQQ2lKL7GUy+tD31aLQCbJ4CPSPNNrjKU+atRwYgtC1ujhLU6WwaDqenhn8dKmg 3h4fQ9SAdQKS7pxhpt+Kr2NB8ClvIObirRuvDM0hJlJxCUg5/L/pIk7lR0AiMvC6LN2+ iAKVBQ14gONWsWJ7fp7qTW9yt53rygllDfb6KG0rkHcBeR2UXTID7UIY4sv+Y+1KUmzk kqxc64rmLxmKQAje8xisM21w6ESF4sIptWTK2ZqVeFQZJG+LadFZiI83QdPtLkg5Ml7W /ulA== X-Gm-Message-State: AOAM531FZoNMApZPAl7lI6NHFr0diW+IJSZgG6/EPAcWY1tbAFIUzwDA dg1N62UXd61DquSI1WKuqAgfkHbaYgjSzMdHp5E= X-Google-Smtp-Source: ABdhPJy3Uhb3j6jSdIxuOPQyP67nQqD+cA81XT6+HtcgXs8hIbflAYxFI6Q1ySsCfGUKroSCS2q8L2OK6Fc6QypS+u8= X-Received: by 2002:a92:bf0c:: with SMTP id z12mr52176029ilh.151.1594420521723; Fri, 10 Jul 2020 15:35:21 -0700 (PDT) MIME-Version: 1.0 References: <20200622211034.659739-1-alistair.francis@wdc.com> <87zh8u8d17.fsf@igel.home> <87o8p21bjh.fsf@oldenburg2.str.redhat.com> <87366dx35x.fsf@oldenburg2.str.redhat.com> <87sgedvnq3.fsf@oldenburg2.str.redhat.com> <87o8p1vnb9.fsf@oldenburg2.str.redhat.com> <87ftadvmnv.fsf@oldenburg2.str.redhat.com> <87r1txyfew.fsf@igel.home> <87a70lvm48.fsf@oldenburg2.str.redhat.com> In-Reply-To: From: "H.J. Lu" Date: Fri, 10 Jul 2020 15:34:45 -0700 Message-ID: Subject: Re: [PATCH] Allow memset local PLT reference for RISC-V. To: Alistair Francis Cc: "Maciej W. Rozycki" , Florian Weimer , Andreas Schwab , Alistair Francis , Alistair Francis via Libc-alpha Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 22:35:24 -0000 On Fri, Jul 10, 2020 at 2:45 PM Alistair Francis via Libc-alpha wrote: > > On Tue, Jun 30, 2020 at 5:45 PM Maciej W. Rozycki via Libc-alpha > wrote: > > > > On Mon, 29 Jun 2020, Jim Wilson wrote: > > > > > Anyways, if you want to know where the PLT call is coming from, you > > > can't rely on the relocs. R_RISCV_CALL_PLT is not necessarily a plt > > > call. > > > > If a PLT entry has been created, then the linker must have considered the > > symbol referred preemptible, whether legitimately or not. > > > > Rather than scratching one's head I would suggest running the relevant LD > > invocation under GDB to find out what really happens there, which may be > > as easy as setting a breakpoint on `riscv_elf_finish_dynamic_symbol' with > > the right condition on the hash entry so as to stop on `memset' only, and > > then working backwards with a watchpoint (on a host system that does not > > use ASLR) to find out what sets `h->plt.offset'. There'll be the answer. > > I tried to look into this but haven't made much progress here. If > anyone has more ideas they would be very welcome otherwise I'll keep > digging into this. > It may be related to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67220 -- H.J.