[{"id":3188361,"web_url":"http://patchwork.ozlabs.org/comment/3188361/","msgid":"<66963265-fdeb-9bb0-bc3e-a6cd57d53e57@redhat.com>","list_archive_url":null,"date":"2023-09-27T05:03:36","subject":"Re: [PATCH] optionrom: Remove build-id section","submitter":{"id":66152,"url":"http://patchwork.ozlabs.org/api/people/66152/","name":"Thomas Huth","email":"thuth@redhat.com"},"content":"On 26/09/2023 21.25, Fabiano Rosas wrote:\n> Our linker script for optionroms specifies only the placement of the\n> .text section, leaving the linker free to place the remaining sections\n> at arbitrary places in the file.\n> \n> Since at least binutils 2.39, the .note.gnu.build-id section is now\n> being placed at the start of the file, which causes label addresses to\n> be shifted. For linuxboot_dma.bin that means that the PnP header\n> (among others) will not be found when determining the type of ROM at\n> optionrom_setup():\n> \n> (0x1c is the label _pnph, where the magic \"PnP\" is)\n> \n> $ xxd /usr/share/qemu/linuxboot_dma.bin | grep \"PnP\"\n> 00000010: 0000 0000 0000 0000 0000 1c00 2450 6e50  ............$PnP\n> \n> $ xxd pc-bios/optionrom/linuxboot_dma.bin | grep \"PnP\"\n> 00000010: 0000 0000 0000 0000 0000 4c00 2450 6e50  ............$PnP\n>                                     ^bad\n> \n> Using a freshly built linuxboot_dma.bin ROM results in a broken boot:\n> \n>    SeaBIOS (version rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org)\n>    Booting from Hard Disk...\n>    Boot failed: could not read the boot disk\n> \n>    Booting from Floppy...\n>    Boot failed: could not read the boot disk\n> \n>    No bootable device.\n> \n> We're not using the build-id section, so pass the --build-id=none\n> option to the linker to remove it entirely.\n> \n> Note: In theory, this same issue could happen with any other\n> section. The ideal solution would be to have all unused sections\n> discarded in the linker script. However that would be a larger change,\n> specially for the pvh rom which uses the .bss and COMMON sections so\n> I'm addressing only the immediate issue here.\n> \n> Reported-by: Vasiliy Ulyanov <vulyanov@suse.de>\n> Signed-off-by: Fabiano Rosas <farosas@suse.de>\n> ---\n>   pc-bios/optionrom/Makefile | 2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile\n> index b1fff0ba6c..30d07026c7 100644\n> --- a/pc-bios/optionrom/Makefile\n> +++ b/pc-bios/optionrom/Makefile\n> @@ -36,7 +36,7 @@ config-cc.mak: Makefile\n>   \t    $(call cc-option,-Wno-array-bounds)) 3> config-cc.mak\n>   -include config-cc.mak\n>   \n> -override LDFLAGS = -nostdlib -Wl,-T,$(SRC_DIR)/flat.lds\n> +override LDFLAGS = -nostdlib -Wl,--build-id=none,-T,$(SRC_DIR)/flat.lds\n>   \n>   pvh.img: pvh.o pvh_main.o\n\nI remember that we had to do the same in other projects that use their own \nlinker script (kvm-unit-tests?) ... so this looks fine to me.\n\nReviewed-by: Thomas Huth <thuth@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=KyXMN7mZ;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4RwPfX4M9kz1yp0\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 27 Sep 2023 15:04:20 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1qlMiE-0005ZQ-Mj; Wed, 27 Sep 2023 01:03:50 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <thuth@redhat.com>) id 1qlMiC-0005ZH-7P\n for qemu-devel@nongnu.org; Wed, 27 Sep 2023 01:03:48 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.129.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <thuth@redhat.com>) id 1qlMi9-0002BA-C5\n for qemu-devel@nongnu.org; Wed, 27 Sep 2023 01:03:47 -0400","from mail-qt1-f198.google.com (mail-qt1-f198.google.com\n [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-355-wKtHEQ6SO6CYBP6RA3pmKQ-1; Wed, 27 Sep 2023 01:03:41 -0400","by mail-qt1-f198.google.com with SMTP id\n d75a77b69052e-412ede7897aso138557341cf.1\n for <qemu-devel@nongnu.org>; Tue, 26 Sep 2023 22:03:41 -0700 (PDT)","from [192.168.0.5] (ip-109-43-178-22.web.vodafone.de.\n [109.43.178.22]) by smtp.gmail.com with ESMTPSA id\n l11-20020ac84ccb000000b004181441cb2dsm2542013qtv.34.2023.09.26.22.03.38\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Tue, 26 Sep 2023 22:03:40 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1695791023;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=aWf/XtDJ6lWldjTJi7BhDN6gyWzLnfK6MWustL4P2TY=;\n b=KyXMN7mZlS3DO+aBgpneTKMCOw04cCOns443UFi31lPBNG6irhrwkhY0UDcVWbfgI1gAKU\n oWZc+ihs5lQFz1fPlAk5NFxr5DhX0aAerYLAzXkSqd04pJFdJC12rcFFhyW+oLtQeDt5m0\n FG4LnOm8Ny/mi0TCyVsLWysXDxlP4q8=","X-MC-Unique":"wKtHEQ6SO6CYBP6RA3pmKQ-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1695791021; x=1696395821;\n h=content-transfer-encoding:in-reply-to:from:content-language\n :references:cc:to:subject:user-agent:mime-version:date:message-id\n :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=aWf/XtDJ6lWldjTJi7BhDN6gyWzLnfK6MWustL4P2TY=;\n b=bQiO22KD6zRkgYG8OwiMxdBm+nyLKSKr5kaFk+zUkTjKqe1kR46uAUMxM9ZpocmvkD\n 1d99SgyY52CAf6kDc6JLxcpSBW/01Si7raKmMYmbU5qv/nPNaEfcqVCubTuk5Int5v1h\n NxaYgMWOvSlRm0WIaorKE+dWN2VD6Jm09GtwiL8DKwT22HriXasUG2kR8yr2XvBrdKrn\n APw72Ega3kD9bs4EgTRX05bUOoG4yUpp0ibenDgeieTCMYZUmAKr+g6wIwXYd+Dwdgu8\n 60yVVdcl0raaOX+aU/BklNsqFUnyzv2y6iOBkwUHukzWslKMnZf7uYbRV0PetcW5K/MZ\n o6bA==","X-Gm-Message-State":"AOJu0YzVkIEGw8gBlskGwSpcEFRHWAitwhP+gs7u2jqzVCeE3OCBhvMM\n irCE1kGFt0LE93esU5c7ZQMhBygKNIs19r3gIRXJE5Ozs7Izo2e4gcwjzYhsIY7h6VtfB6xeOlQ\n X+fi2ch6+Q8ag2A4=","X-Received":["by 2002:a05:622a:1111:b0:417:b00f:9c8a with SMTP id\n e17-20020a05622a111100b00417b00f9c8amr1155560qty.27.1695791021256;\n Tue, 26 Sep 2023 22:03:41 -0700 (PDT)","by 2002:a05:622a:1111:b0:417:b00f:9c8a with SMTP id\n e17-20020a05622a111100b00417b00f9c8amr1155544qty.27.1695791020934;\n Tue, 26 Sep 2023 22:03:40 -0700 (PDT)"],"X-Google-Smtp-Source":"\n AGHT+IEXLf9YVII023nAdvw9WEJEUKiR96PIsbnXFeV/DNxpsCXlPogrBar1QAA01VX8QqO/nXtecw==","Message-ID":"<66963265-fdeb-9bb0-bc3e-a6cd57d53e57@redhat.com>","Date":"Wed, 27 Sep 2023 07:03:36 +0200","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n Thunderbird/102.13.0","Subject":"Re: [PATCH] optionrom: Remove build-id section","To":"Fabiano Rosas <farosas@suse.de>, qemu-devel@nongnu.org","Cc":"Paolo Bonzini <pbonzini@redhat.com>,\n =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>,\n Dario Faggioli <dfaggioli@suse.com>, Vasiliy Ulyanov <vulyanov@suse.de>","References":"<20230926192502.15986-1-farosas@suse.de>","Content-Language":"en-US","From":"Thomas Huth <thuth@redhat.com>","In-Reply-To":"<20230926192502.15986-1-farosas@suse.de>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Received-SPF":"pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-35","X-Spam_score":"-3.6","X-Spam_bar":"---","X-Spam_report":"(-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n NICE_REPLY_A=-1.473, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001,\n RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3188416,"web_url":"http://patchwork.ozlabs.org/comment/3188416/","msgid":"<20230927065247.748219-1-pbonzini@redhat.com>","list_archive_url":null,"date":"2023-09-27T06:52:46","subject":"Re: [PATCH] optionrom: Remove build-id section","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"Queued, thanks.\n\nPaolo","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=dP3d7f4x;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4RwS4Q1xF3z1ypJ\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 27 Sep 2023 16:53:26 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1qlOPr-0003kC-Uw; Wed, 27 Sep 2023 02:52:59 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pbonzini@redhat.com>)\n id 1qlOPo-0003jz-Bn\n for qemu-devel@nongnu.org; Wed, 27 Sep 2023 02:52:56 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.129.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pbonzini@redhat.com>)\n id 1qlOPl-0001ya-EK\n for qemu-devel@nongnu.org; Wed, 27 Sep 2023 02:52:54 -0400","from mail-lf1-f69.google.com (mail-lf1-f69.google.com\n [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-465-HCKbrBOuOUWZ584WHM5wjQ-1; Wed, 27 Sep 2023 02:52:51 -0400","by mail-lf1-f69.google.com with SMTP id\n 2adb3069b0e04-503269edbb3so14707821e87.2\n for <qemu-devel@nongnu.org>; Tue, 26 Sep 2023 23:52:50 -0700 (PDT)","from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045])\n by smtp.gmail.com with ESMTPSA id\n ck15-20020a0564021c0f00b005342fa19070sm2887178edb.89.2023.09.26.23.52.48\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 26 Sep 2023 23:52:48 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1695797572;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=cyh9GNwkSeiWX8VVWJet6cmrStrv1Y1BhHYKMAKCy08=;\n b=dP3d7f4x6H6FJcgdwqWXpuEMtrju2NTUHowPMFgoclGphuu0qeeVOc1YalL+aQuFFf5y0A\n 33eCEkKzUL6XlOUkYm0T3ZGbc5VB3+DlpGpqIFu0NdhRzkgNSQ1A8HnG9TVKFS+0hg5OME\n +P2HLx47+reIFP9jSs6pPiDCZhCLXyg=","X-MC-Unique":"HCKbrBOuOUWZ584WHM5wjQ-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1695797569; x=1696402369;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=cyh9GNwkSeiWX8VVWJet6cmrStrv1Y1BhHYKMAKCy08=;\n b=YiqKVmTgKtMfKnW4gMePZ7xxUtBlhqUgXzjmLncN74zszSCLPsiSk7Jg/RFbyhqL4V\n 0/D7T3oYIfUQeYD7mhbYhi54RKZfs2DYfhs7Z9gLn5kLDpUM9GkusTcRuxuanvJPb9PV\n NvJ45vmJVd3ylb2wVlxHCqKLq8a+9MK2R071kNTGxrmFVc2xVBRIpqmfH7t42H2xH4WY\n Iq5MzgKNPN+VIcZ3RkKfu584YuPpj+lqjK6NPY1pJywt+H7iN1T8yd8fXRMTkN5jgxwR\n DqlmqWbJ4YNngxcjKAG4BfqArENj1lxT4NNLq3i+nFGK33Yip92aLMZokNHb9ALxDCFv\n sN/Q==","X-Gm-Message-State":"AOJu0YzLDhHSMu4VEFOaihX6lC4cOKwvjG3fRPeZ7/Zb1q1WkTCnpPuT\n dDHN8uVBcsFv61GQk69WlfaUI/fTDstwXop+J0/UVdQN2bad5YAbdQ6nqRJncD70liDSgnPjyLp\n cBa964r/EBC0awlc=","X-Received":["by 2002:a05:6512:4028:b0:500:b56d:e11a with SMTP id\n br40-20020a056512402800b00500b56de11amr977790lfb.43.1695797569719;\n Tue, 26 Sep 2023 23:52:49 -0700 (PDT)","by 2002:a05:6512:4028:b0:500:b56d:e11a with SMTP id\n br40-20020a056512402800b00500b56de11amr977777lfb.43.1695797569363;\n Tue, 26 Sep 2023 23:52:49 -0700 (PDT)"],"X-Google-Smtp-Source":"\n AGHT+IF1I5DvFBuAhubq7r0NSLTOSVhcXoZXEQAPIBjVC71Cc4CeMGvBRXYv9KgfxITomnThC92Vqw==","From":"Paolo Bonzini <pbonzini@redhat.com>","To":"Fabiano Rosas <farosas@suse.de>","Cc":"qemu-devel@nongnu.org,\n =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>,\n Thomas Huth <thuth@redhat.com>, Dario Faggioli <dfaggioli@suse.com>,\n Vasiliy Ulyanov <vulyanov@suse.de>","Subject":"Re: [PATCH] optionrom: Remove build-id section","Date":"Wed, 27 Sep 2023 08:52:46 +0200","Message-ID":"<20230927065247.748219-1-pbonzini@redhat.com>","X-Mailer":"git-send-email 2.41.0","In-Reply-To":"<20230926192502.15986-1-farosas@suse.de>","References":"","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=170.10.129.124;\n envelope-from=pbonzini@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}}]