Commit 0330b7fb authored by Josh Poimboeuf's avatar Josh Poimboeuf Committed by Ingo Molnar
Browse files

drivers/xen/xenbus: Fix namespace collision and split() section placement with AutoFDO



When compiling the kernel with -ffunction-sections enabled, the split()
function gets compiled into the .text.split section.  In some cases it
can even be cloned into .text.split.constprop.0 or .text.split.isra.0.

However, .text.split.* is already reserved for use by the Clang
-fsplit-machine-functions flag, which is used by AutoFDO.  That may
place part of a function's code in a .text.split.<func> section.

This naming conflict causes the vmlinux linker script to wrongly place
split() with other .text.split.* code, rather than where it belongs with
regular text.

Fix it by renaming split() to split_strings().

Fixes: 6568f14c ("vmlinux.lds: Exclude .text.startup and .text.exit from TEXT_MAIN")
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: live-patching@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://patch.msgid.link/92a194234a0f757765e275b288bb1a7236c2c35c.1762991150.git.jpoimboe@kernel.org
parent 56255fa9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -410,7 +410,7 @@ static char *join(const char *dir, const char *name)
	return (!buffer) ? ERR_PTR(-ENOMEM) : buffer;
}

static char **split(char *strings, unsigned int len, unsigned int *num)
static char **split_strings(char *strings, unsigned int len, unsigned int *num)
{
	char *p, **ret;

@@ -448,7 +448,7 @@ char **xenbus_directory(struct xenbus_transaction t,
	if (IS_ERR(strings))
		return ERR_CAST(strings);

	return split(strings, len, num);
	return split_strings(strings, len, num);
}
EXPORT_SYMBOL_GPL(xenbus_directory);