lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260112142009.1006236-24-herve.codina@bootlin.com>
Date: Mon, 12 Jan 2026 15:19:13 +0100
From: Herve Codina <herve.codina@...tlin.com>
To: David Gibson <david@...son.dropbear.id.au>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>
Cc: Ayush Singh <ayush@...gleboard.org>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	devicetree-compiler@...r.kernel.org,
	devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	devicetree-spec@...r.kernel.org,
	Hui Pu <hui.pu@...ealthcare.com>,
	Ian Ray <ian.ray@...ealthcare.com>,
	Luca Ceresoli <luca.ceresoli@...tlin.com>,
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
	Herve Codina <herve.codina@...tlin.com>
Subject: [RFC PATCH 23/77] dtc: Introduce mark_local_exports()

In order to have correct tags set in dtb, an export symbol has to
be identified as a "local" export symbol when it references a local
node.

This is done for phandles used by properties in mark_local_phandles().

The same operation is needed for export symbols. This is the purpose of
mark_local_exports().

Signed-off-by: Herve Codina <herve.codina@...tlin.com>
---
 dtc.c      |  2 ++
 dtc.h      |  2 ++
 livetree.c | 23 +++++++++++++++++++++++
 3 files changed, 27 insertions(+)

diff --git a/dtc.c b/dtc.c
index fe8e8e4..030bfa2 100644
--- a/dtc.c
+++ b/dtc.c
@@ -336,6 +336,8 @@ int main(int argc, char *argv[])
 	update_phandles_ref(dti);
 	mark_local_phandles(dti);
 
+	mark_local_exports(dti);
+
 	/*
 	 * With FDT_REF_PHANDLE added in dtbs, we need to identified
 	 * if some unresolved phandle references are allowed in the dtb
diff --git a/dtc.h b/dtc.h
index 0bf5ba5..ea073c2 100644
--- a/dtc.h
+++ b/dtc.h
@@ -368,6 +368,8 @@ void generate_local_fixups_tree(struct dt_info *dti, const char *name);
 void update_phandles_ref(struct dt_info *dti);
 void mark_local_phandles(struct dt_info *dti);
 
+void mark_local_exports(struct dt_info *dti);
+
 /* Checks */
 
 void parse_checks_option(bool warn, bool error, const char *arg);
diff --git a/livetree.c b/livetree.c
index 4458437..0e756b8 100644
--- a/livetree.c
+++ b/livetree.c
@@ -1303,3 +1303,26 @@ void mark_local_phandles(struct dt_info *dti)
 {
 	mark_local_phandles_internal(dti, dti->dt);
 }
+
+static void mark_local_exports_internal(struct dt_info *dti,
+					struct node *node)
+{
+	struct node *c;
+	struct symbol *exportsym;
+	struct node *refnode;
+
+	for_each_symbol(node->exportsymlist, exportsym) {
+		refnode = get_node_by_ref(dti->dt, exportsym->ref);
+		if (refnode)
+			exportsym->is_local = true;
+	}
+
+	for_each_child(node, c)
+		mark_local_exports_internal(dti, c);
+}
+
+void mark_local_exports(struct dt_info *dti)
+{
+	mark_local_exports_internal(dti, dti->dt);
+
+}
-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ