From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id AAD49384F6F2 for ; Fri, 18 Nov 2022 10:46:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AAD49384F6F2 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-x62f.google.com with SMTP id n21so12008427ejb.9 for ; Fri, 18 Nov 2022 02:46:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7IRuyJyU2u6YinaQ7BCITNzSV4Xna9Gb8JczvCySAHs=; b=k/olqyfbrgheurFe7A0mAijJcbbpwYq8LbEBlHz+smkSBAUsW0riOZV638+m6s/GUq zwilzC80L8UXzuBSxkpahqFnwOzt2JpgLTWg6Lk3mjHaSVx/PffGoZ6zAwDi0c1kgJ8N mpbtYFxdXRlwthvPH3D7rAEJ1PU1uZcoxW4eiDX8iD61BabIhp3ggajhM6rkuVxrMJI8 FVYOon0301TiJ+IQnYTaAgJh2AQRdyyZkAO0+yDYTuiBNDhM5Q4xj5Y4IvRzHvrrcsTe m6XXQCPToBO5wiUxNAkhRogDXGAdWUocR1+wKRW3EQYu4Y8UHozn6Wub5w/4IcSqVgHH vw4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=7IRuyJyU2u6YinaQ7BCITNzSV4Xna9Gb8JczvCySAHs=; b=TmBXkTO/qy1RDszoZrKBM1+0QNkpFtN0di7FgmN0oRyy59i+Y7S5ePMaRqSRN0wOum F5MCXbj8QjTvMfiYzi7+BpYqMwMU/Z+XXbPeI7RfsmkNybburIIWkwLEiaeo44Ugylst hfbqYTzHyo8F/YQ4KHiSv3AOkm4VWYihtGoUfYRwKmRBczDo7Bx2R6H7jSpTmL/m5udt bS0ehZyvAu8X0jAYSxTTr0dCOYRWEceSfR5rXWJ8YmB5NiK+qmYW5iYTNAFIl+dqp58H Dmn9EA03egypgOk5KYQ0PLv7GoqgW2FCOF37e+UGsgRo8q3zySq+j62wq8fpEwUod247 q3zw== X-Gm-Message-State: ANoB5plYltPqcliz6yg0DNrgeXaSQ3eMSOHroYwbTay2SkjmqJRc26PJ 6WV1URvvLRKoeDZ4oJrNs3uJiX+knk+BwO/ydlvr+n4V/XY= X-Google-Smtp-Source: AA0mqf6YquGzqwEJ2SvhGtMql55sCP/nhJOYfQ7TfHfLC6BsgW25/lifG9nlWjRs93VzK9wzPTQ1GlgT0Txd9yVsaNk= X-Received: by 2002:a17:906:480f:b0:7ae:967a:50bb with SMTP id w15-20020a170906480f00b007ae967a50bbmr5436147ejq.383.1668768369570; Fri, 18 Nov 2022 02:46:09 -0800 (PST) MIME-Version: 1.0 References: <6bda2cb0-14ef-ae75-3253-689f3060c537@suse.com> In-Reply-To: <6bda2cb0-14ef-ae75-3253-689f3060c537@suse.com> From: =?UTF-8?B?5b6Q5oyB5oGSIFh1IENoaWhlbmc=?= Date: Fri, 18 Nov 2022 18:45:58 +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" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,BODY_8BITS,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: using x86_64-elf-g++ -m32 -c on C++ files to generate head.o(32 bit code, elf32). using x86_64-elf-objcopy to convert it to elf64. then link head.o(32 bit code, elf64) with other object files(64 bit code, elf64). link script line is : .head : { head.o (.multiboot) head.o (.*) } On Fri, Nov 18, 2022 at 6:34 PM Jan Beulich wrote: > > On 18.11.2022 11:24, =E5=BE=90=E6=8C=81=E6=81=92 Xu Chiheng wrote: > > Does that mean there is a bug in objcopy? > > x86_64-elf-objcopy failed to correctly convert a ELF32(USE_REL, addend > > is in section content) to ELF64(USE_RELA, addend is in relocation > > entry) . > > In other words, x86_64-elf-objcopy just converts a REL relocation > > entry to a RELA relocation entry, without putting the addend in > > section content to the new RELA relocation entry. > > Possible, but I can't check without knowing more details about the > input object you did use. > > As an aside - please don't top-post. > > Jan > > > On Fri, Nov 18, 2022 at 6:01 PM Jan Beulich wrote: > >> > >> On 18.11.2022 10:37, =E5=BE=90=E6=8C=81=E6=81=92 Xu Chiheng via Binuti= ls wrote: > >>> Sorry, but I really think this is a regression. > >>> 64 bit linker originally could do relocation on 32 bit object code. I= t > >>> worked perfectly. > >> > >> And it still can, provided you pass in well-formed 32-bit object files= . > >> > >>> Setting src_mask to 0, ignores the addend value in the section conten= t. > >> > >> Which is precisely what the ELF spec says the behavior is for RELA typ= e > >> relocations. _Not_ ignoring section contents was the bug here. > >> > >> You are, btw, not the first one to notice this perceived regression. B= ut > >> that still doesn't actually make it one. It is merely a change in > >> behavior to fix a long-standing bug. > >> > >> Jan >