From patchwork Tue Dec 3 07:57:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wieczorkiewicz, Pawel" X-Patchwork-Id: 11270763 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38B971593 for ; Tue, 3 Dec 2019 07:59:03 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1172D2068E for ; Tue, 3 Dec 2019 07:59:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.de header.i=@amazon.de header.b="shcP6r5v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1172D2068E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ic343-0007Ue-8h; Tue, 03 Dec 2019 07:57:43 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ic342-0007UL-DJ for xen-devel@lists.xenproject.org; Tue, 03 Dec 2019 07:57:42 +0000 X-Inumbo-ID: 94dbd94e-15a2-11ea-81d2-12813bfff9fa Received: from smtp-fw-9101.amazon.com (unknown [207.171.184.25]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 94dbd94e-15a2-11ea-81d2-12813bfff9fa; Tue, 03 Dec 2019 07:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1575359862; x=1606895862; h=from:to:cc:subject:date:message-id:mime-version; bh=WQZjLiqp5j6RdtHSFA00tl6skVgpBIU71hfx91RlOb8=; b=shcP6r5v/eGqD0Z+WP8r3YDAJSJEkcBlVxlnTEvs7HvrqndWnwX3tRRh VJgIP+dmbnadhMgXlYt61JXpTD2hXqzmIVXOOddMZXBDSj8AlzkiYPzdF xwwDDpLYE61IFlw6W9uA/rOHt66KVuG4wzFHEdqDxTYueQ1geY/99U2jY o=; IronPort-SDR: 2VI+cY00XD5uhRVh5plD89AAPLtuzGN0tBt6qLWa0FD477S/XZ/B0KcLLRxSVAXqe+VcWaLQN2 mCgrcr99gUEg== X-IronPort-AV: E=Sophos;i="5.69,272,1571702400"; d="scan'208";a="2804270" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2b-c7131dcf.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 03 Dec 2019 07:57:31 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2b-c7131dcf.us-west-2.amazon.com (Postfix) with ESMTPS id C074DA0759; Tue, 3 Dec 2019 07:57:30 +0000 (UTC) Received: from EX13D03EUA002.ant.amazon.com (10.43.165.166) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 3 Dec 2019 07:57:30 +0000 Received: from EX13MTAUWA001.ant.amazon.com (10.43.160.58) by EX13D03EUA002.ant.amazon.com (10.43.165.166) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 3 Dec 2019 07:57:29 +0000 Received: from dev-dsk-wipawel-1a-0c4e6d58.eu-west-1.amazon.com (10.4.134.33) by mail-relay.amazon.com (10.43.160.118) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 3 Dec 2019 07:57:27 +0000 From: Pawel Wieczorkiewicz To: Date: Tue, 3 Dec 2019 07:57:22 +0000 Message-ID: <20191203075722.107886-1-wipawel@amazon.de> X-Mailer: git-send-email 2.16.5 MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH livepatch-build-tools] create-diff-object: Include string sections later X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: mpohlack@amazon.de, Pawel Wieczorkiewicz , Ross Lagerwall , Sergey Dyasli , Konrad Rzeszutek Wilk Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" ... when all symbols have their status and include flags processed. Processing special sections may include additional symbols. String sections (.rodata*) are included iff they are referenced by at least one symbol. Thus, in order to decide if string section should be included or not, all symbols must be evaluated first. Signed-off-by: Pawel Wieczorkiewicz Reported-by: Sergey Dyasli Tested-by: Sergey Dyasli Reviewed-by: Ross Lagerwall --- create-diff-object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create-diff-object.c b/create-diff-object.c index 1ce5c09..a516670 100644 --- a/create-diff-object.c +++ b/create-diff-object.c @@ -2372,8 +2372,6 @@ int main(int argc, char *argv[]) log_debug("Include hook elements\n"); num_changed += kpatch_include_hook_elements(kelf_patched); log_debug("num_changed = %d\n", num_changed); - log_debug("Include standard string elements\n"); - kpatch_include_standard_string_elements(kelf_patched); log_debug("Include new globals\n"); new_globals_exist = kpatch_include_new_globals(kelf_patched); log_debug("new_globals_exist = %d\n", new_globals_exist); @@ -2390,6 +2388,8 @@ int main(int argc, char *argv[]) log_debug("Process special sections\n"); kpatch_process_special_sections(kelf_patched); + log_debug("Include standard string elements\n"); + kpatch_include_standard_string_elements(kelf_patched); log_debug("Strip undefined elements of known size\n"); livepatch_strip_undefined_elements(kelf_patched); log_debug("Verify patchability\n");