[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH] automation: add linker symbol name script


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: <victorm.lira@xxxxxxx>
  • Date: Tue, 23 Jul 2024 17:18:05 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pdmzGOZ01iKtzDRXJ5lnNKsk76Ks+qEliQuX5qEoB0I=; b=XuFRkWL4mmsySTk6eJw1SFhEFENem1AxWqWYs3U+j8F5UE96YVK+XG+qR73+X2ku2PlCBF6n2oP2kf7dJ7lRGnaCaLpse8CgeWZnKZk1igvOJ+d9s1OZqrvxVmAlb/DeCpcnELE26NvVmZTikTBMKr8lG6v8N+/7wpX/0ZOxKjLH0SW9smuJCRo3txc5rZu+C50WkGaf4k8E1IAmezLNzPwT9Zz3qApk4Wrl9DIAAszB2pHupE+x5H2AokhAjRXKa6Xjl5/EnzFfq9uSx15ZxBnDhi1kkyvYJ5xl/U+wUxJAeAP3NJ0SkuiA7cwVhL4zjDwBd/WGRVAQQ+gQZj7OnQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QIKxhtUA/vU+vBG7256ipJrxRzSbefDFd/r2qf/jyGS37nYcPJ46mGaIEkOWFjDQm0dMZnZ5YaVc0J0iOeXZSNSLAK3+TW8fRYLFkQ5i1NZNXuWUuGyi5OFZ0ufBe3obZi0WdOP4rBWSkZzCt6uabll9HViw6Kfyhe8o5mg38H7k0L+bORJFdl73mgoL6KBNkGIcPFbg936HHr9sFbu8d13cIyge4D5pwXKaIBWxUKw9rn81aonoZejuhMZf8bRPFr95pRFBN836CNlHRe1pm4zcqEdT6xIuZ8RZCljZlLsmP7sZ93Fq+NnB9ATKiM5L3JSZQOwLJShHKpgHnX1WLA==
  • Cc: Victor Lira <victorm.lira@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, <roberto.bagnara@xxxxxxxxxxx>, <consulting@xxxxxxxxxxx>, <simone.ballarin@xxxxxxxxxxx>
  • Delivery-date: Wed, 24 Jul 2024 00:19:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Victor Lira <victorm.lira@xxxxxxx>

Add a script that extracts the names of symbols in linker scripts.

Signed-off-by: Victor Lira <victorm.lira@xxxxxxx>
---
Note:
Not included are the "." location name or symbol names enclosed in quotes
since the files dont't use any.
---
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: roberto.bagnara@xxxxxxxxxxx
Cc: consulting@xxxxxxxxxxx
Cc: simone.ballarin@xxxxxxxxxxx
---
 automation/eclair_analysis/linker_symbols.sh | 41 +++++++++++++++++++
 automation/eclair_analysis/stuff.txt         | 42 ++++++++++++++++++++
 2 files changed, 83 insertions(+)
 create mode 100755 automation/eclair_analysis/linker_symbols.sh
 create mode 100644 automation/eclair_analysis/stuff.txt

diff --git a/automation/eclair_analysis/linker_symbols.sh 
b/automation/eclair_analysis/linker_symbols.sh
new file mode 100755
index 0000000000..c8c44e235f
--- /dev/null
+++ b/automation/eclair_analysis/linker_symbols.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+# Stop immediately if any executed command has exit status different from 0.
+set -e
+
+# Extract linker symbol names (except those starting with ".") from 
assignments.
+
+script_name=`basename "$0"`
+script_dir="$(
+  cd "$(dirname "$0")"
+  echo "${PWD}"
+)"
+src_dir="${script_dir}/../.."
+
+usage() {
+  echo "Usage: ${script_name} <ARM64|X86_64>"
+}
+
+if [ $# -ne 1 ]; then
+  usage
+  exit 1
+fi
+
+if [ "$1" == "X86_64" ]; then
+    filepaths=(
+        "${src_dir}/xen/arch/x86/xen.lds.S"
+    )
+elif [ "$1" == "ARM64" ]; then
+    filepaths=(
+        "${src_dir}/xen/arch/arm/xen.lds.S"
+    )
+else
+    usage
+    exit 1
+fi
+
+(
+    for file in "${filepaths[@]}"
+    do
+        sed -n "s/^\s*\([a-zA-Z_][a-zA-Z_0-9.\-]*\)\s*=.*;\s*$/\1/p" $filepaths
+    done
+)
diff --git a/automation/eclair_analysis/stuff.txt 
b/automation/eclair_analysis/stuff.txt
new file mode 100644
index 0000000000..efc33e6a59
--- /dev/null
+++ b/automation/eclair_analysis/stuff.txt
@@ -0,0 +1,42 @@
+_start
+_idmap_start
+_idmap_end
+__proc_info_start
+__proc_info_end
+__note_gnu_build_id_start
+__note_gnu_build_id_end
+__ro_after_init_start
+__ro_after_init_end
+__start___ex_table
+__stop___ex_table
+__start___pre_ex_table
+__stop___pre_ex_table
+__start_schedulers_array
+__end_schedulers_array
+_splatform
+_eplatform
+_sdevice
+_edevice
+_asdevice
+_aedevice
+_steemediator
+_eteemediator
+__init_begin
+_sinittext
+_einittext
+__setup_start
+__setup_end
+__initcall_start
+__presmp_initcall_end
+__initcall_end
+__alt_instructions
+__alt_instructions_end
+__ctors_start
+__ctors_end
+__init_end_efi
+__init_end
+__bss_start
+__per_cpu_start
+__per_cpu_data_end
+__bss_end
+_end
--
2.37.6




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.