From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 2BB223858D33 for ; Mon, 4 Sep 2023 00:04:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2BB223858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1bc0d39b52cso3109585ad.2 for ; Sun, 03 Sep 2023 17:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693785863; x=1694390663; darn=sourceware.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=AsNfn0PVesN9pDfeMh26SyDhQ1o2BBLmEEJ9eFq+/6M=; b=opno1Yxq3RIfiQ5MKyw+By2pAfhT6lLjsy+m68wmv582GDMuJ9vqo1rJD9sSqmF1YE gKqWxJ0nFKQEk1XTRTQBL7cmH2F1sS1eU+AkxZKBYFP55bFC9OZ5hEH7tmHuOonU/3ZX 1PZ5EJAow9CyAuaN4adIRP9GCGXE34NIGUNSVDlncd8xtTOlfrpIWeM9UVZP++lZriGb ZnH4qUf462rnxm/4Izw3e/9pRheUg7Na+O5BkRXSU9QV1zCDlHiinND1p70LARlHPZUy AKvLqJPKJj3j1OqT3kkXFhmgtYSB7gGlT9E/sRO/3+JkyG6vr6FO9htfer9ZzK3jITBK czFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693785863; x=1694390663; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AsNfn0PVesN9pDfeMh26SyDhQ1o2BBLmEEJ9eFq+/6M=; b=OS5ks0NaLNDQuRI0+mbTsT0iEKYdzUvH1K6m8Gk6tfFNLAJTxlHVIpmX6g/kXT+2wS ORbhbSGXe+D4ejPLz3W3xhvnrrLORZIwiRrdV+bzWmd4xeRv9uyae6nVleuKtT21QmLH 5SKjdJ7bz25fICyYyTG0W2o0EE5Ay9G38onk5C9EvFrdnwayRUgS2ha6pmgy52yq2CMu 627zhJcekhJaw1GAwEpFSLzj411mnj2SXV5+GANs1moSd0mUF9LVLv9updrPDJrLnDKS YNY/tLczAxSEep61EC2+b3NwGa4aVjMXIifhZcPHv5/zSpkEzb39tSJ28ja+Xw36fh+s 2gvw== X-Gm-Message-State: AOJu0YwUu0nJfn/5tMk2mhAjw/uc5TsBpkhYznkqq5bJPAF0VFYEp830 MN99f4XyuBbjqzIlK+ic7KypBJjqEdrmBw== X-Google-Smtp-Source: AGHT+IENhWyK4xOQz0MG6HcrBfcI3yuWvknXK2EJs2JVIPK8fdQtew3jaA5tOmLoT0OAE2jXwQR9Qw== X-Received: by 2002:a17:902:e5cf:b0:1bc:8c6c:217d with SMTP id u15-20020a170902e5cf00b001bc8c6c217dmr8022965plf.61.1693785862943; Sun, 03 Sep 2023 17:04:22 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:b931:605:d08e:85ee]) by smtp.gmail.com with ESMTPSA id t13-20020a1709028c8d00b001befe0ac506sm6336882plo.175.2023.09.03.17.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Sep 2023 17:04:22 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id B89E811404A4; Mon, 4 Sep 2023 09:34:19 +0930 (ACST) Date: Mon, 4 Sep 2023 09:34:19 +0930 From: Alan Modra To: jacob navia Cc: binutils@sourceware.org Subject: Re: Misleading names Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3026.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, Sep 03, 2023 at 11:59:28PM +0200, jacob navia wrote: > Hi > The function riscv_elf_ignore_reloc, contrary to its name, does NOT ignore the relocation! > > /* Special handler for relocations which don't have to be relocated. This > * function just simply return bfd_reloc_ok. */ > static bfd_reloc_status_type riscv_elf_ignore_reloc(bfd * abfd ATTRIBUTE_UNUSED, > arelent * reloc_entry, > asymbol * symbol ATTRIBUTE_UNUSED, > void *data ATTRIBUTE_UNUSED, > asection * input_section, > bfd * output_bfd, > char **error_message ATTRIBUTE_UNUSED) > { > if (output_bfd != NULL) > reloc_entry->address += input_section->output_offset; > return bfd_reloc_ok; > } > > Despite its name, and the associated comment, nothing is ignored here and the relocation address is modified. > > Long, descriptive names are very good WHEN THEY REFLECT THE TRUTH! > Otherwise they are completely misleading. > > Of course this is not a bug. There is nothing wrong with the name. No relocation of section contents is done. The only change made here is for ld -r to keep the relocation associated with the same location in the output as it was in the input. That said, I think it would be better for the R_RISCV_SET_ULEB128 and R_RISCV_SUB_ULEB128 howto to use a special function something like ppc64_elf_unhandled_reloc. -- Alan Modra Australia Development Lab, IBM