From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id A91393858C3A for ; Mon, 21 Nov 2022 09:21:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A91393858C3A 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-ej1-x62b.google.com with SMTP id gv23so27055660ejb.3 for ; Mon, 21 Nov 2022 01:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=o12udTolDWeKjqsVtesT/GoO2ZuUM4BAXKQErwAraJ4=; b=jvLrv5GArxniZqJBRhdkTDc7Dm4DgxCBqH687FUP5aMittpByLG+4RWeMy3QcVDQIR FNXqKr3BK5y2bPwNIFXkq6iuFDTwP05eGEUh7T8LgEMfm4QsN0WMlv2kUss/E+l/ulpg OTxDKSV/HvV/kxAQP8uYHuAtpRvXb80VnlAv6rYYX6tKUyumDjUU5oYSWk7r/WtRC0x0 ntZ0axvYVf0Y8aq6hhX/KtVczS8G9TjPKX00zEarNqrXD0qeTqzRe2P6aoEqOO+wvNM/ ayM6Ftr8mmQj8Rc0tVhOXHUAL1CKHbQyYPZuicvgWPvsKId5ka0K/K5BwOV0PpAr+jga OCAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o12udTolDWeKjqsVtesT/GoO2ZuUM4BAXKQErwAraJ4=; b=6hbVqbo46zSlVUkmKqMNCuxWjH6hrUqI9TWHelg5wzqhFJcQEze4vP7G7O15c2zj2m yaVXjub+8jX8HCxv9Sh6JwH/PifEiOgUqL2CSMfQlBg3iiuJaWVDU7VkA/d8OljjZFVe 3l+c9Ah7CImjsjGgyDclnetoFYnfF3ptKHhy+LQPpcDqaOedm7kHO5ahhCBHePMmOGXY herwc6aFTm+QA4Fe3i+bPdKhJ8rNXulbzbJ0KP8nXUyGzTqDamy7+yJD2MRY52TOViSD E4F/QCZKo8fO1DByNWvZjGWirWNatSLz+9r4U9mEkRf23jcFKwaFC+6iiCoYU00LOnCL etqg== X-Gm-Message-State: ANoB5pkKAjRySpbSfYBX/MGczYZT4aBeExw38G1M/Hfi0/x556qBbvIm mYn5sFfbJUh5l1MIZJgpIlFzOBI/REglORHI8nDKWPJGL3I= X-Google-Smtp-Source: AA0mqf6fD2RUE00qYmh+0l1Ml1eJ1kuQTaahQYtzU9M6DtOkJMS5ZbzJGyahRaDPE6MUIqLNh+g7XP4iWwWf5zzmQC0= X-Received: by 2002:a17:906:8d86:b0:78d:4742:bb62 with SMTP id ry6-20020a1709068d8600b0078d4742bb62mr3493423ejc.43.1669022498329; Mon, 21 Nov 2022 01:21:38 -0800 (PST) MIME-Version: 1.0 References: <6bda2cb0-14ef-ae75-3253-689f3060c537@suse.com> <6799b669-f38b-1a4f-fd63-2c0c3da4e55d@suse.com> In-Reply-To: From: =?UTF-8?B?5b6Q5oyB5oGSIFh1IENoaWhlbmc=?= Date: Mon, 21 Nov 2022 17:21:26 +0800 Message-ID: Subject: Re: [PATCH] binutils: partially revert 17c6c3b99156fe82c1e637e1a5fd9f163ac788c8 To: Jan Beulich Cc: "binutils@sourceware.org" , "H.J. Lu" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 Mon, Nov 21, 2022 at 5:02 PM Jan Beulich wrote: > > So how did you conclude start32.cpp.o uses RELA relocations? .rel.text > is SHT_REL, not SHT_RELA, and so are other .rel.* sections. Which > actually supports my suspicion that SHT_REL aren't correctly handled > when linking, perhaps first and foremost because the x86-64 ABI > specifies that only RELA relocations are to be used. Whether, in that > light, it is valid for objcopy to produce SHT_REL output without any > warning is another question. > I'm not an expert, that was all my guess. It is clear now that x86-64 linker treats the REL relocation entries as RELA relocation entries, when doing relocation, it does not count the addend in section content, because src_mask is set to 0. Then can objcopy transform the REL relocation entries to RELA relocation entries, so the x86-64 linker can consume them correctly ?