Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b92021b0 authored by Rusty Russell's avatar Rusty Russell
Browse files

CONFIG_SYMBOL_PREFIX: cleanup.



We have CONFIG_SYMBOL_PREFIX, which three archs define to the string
"_".  But Al Viro broke this in "consolidate cond_syscall and
SYSCALL_ALIAS declarations" (in linux-next), and he's not the first to
do so.

Using CONFIG_SYMBOL_PREFIX is awkward, since we usually just want to
prefix it so something.  So various places define helpers which are
defined to nothing if CONFIG_SYMBOL_PREFIX isn't set:

1) include/asm-generic/unistd.h defines __SYMBOL_PREFIX.
2) include/asm-generic/vmlinux.lds.h defines VMLINUX_SYMBOL(sym)
3) include/linux/export.h defines MODULE_SYMBOL_PREFIX.
4) include/linux/kernel.h defines SYMBOL_PREFIX (which differs from #7)
5) kernel/modsign_certificate.S defines ASM_SYMBOL(sym)
6) scripts/modpost.c defines MODULE_SYMBOL_PREFIX
7) scripts/Makefile.lib defines SYMBOL_PREFIX on the commandline if
   CONFIG_SYMBOL_PREFIX is set, so that we have a non-string version
   for pasting.

(arch/h8300/include/asm/linkage.h defines SYMBOL_NAME(), too).

Let's solve this properly:
1) No more generic prefix, just CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX.
2) Make linux/export.h usable from asm.
3) Define VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR().
4) Make everyone use them.

Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Reviewed-by: default avatarJames Hogan <james.hogan@imgtec.com>
Tested-by: James Hogan <james.hogan@imgtec.com> (metag)
parent 4febd95a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1398,7 +1398,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))
# Run depmod only if we have System.map and depmod is executable
quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
      cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \
                   $(KERNELRELEASE) "$(patsubst "%",%,$(CONFIG_SYMBOL_PREFIX))"
                   $(KERNELRELEASE) "$(patsubst y,_,$(CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX))"

# Create temporary dir for module support files
# clean it up only when building all modules
+6 −0
Original line number Diff line number Diff line
@@ -384,6 +384,12 @@ config MODULES_USE_ELF_REL
	  Modules only use ELF REL relocations.  Modules with ELF RELA
	  relocations will give an error.

config HAVE_UNDERSCORE_SYMBOL_PREFIX
	bool
	help
	  Some architectures generate an _ in front of C symbols; things like
	  module loading and assembly files need to know about this.

#
# ABI hall of shame
#
+1 −4
Original line number Diff line number Diff line
config SYMBOL_PREFIX
	string
	default "_"

config MMU
	def_bool n

@@ -33,6 +29,7 @@ config BLACKFIN
	select ARCH_HAVE_CUSTOM_GPIO_H
	select ARCH_WANT_OPTIONAL_GPIOLIB
	select HAVE_UID16
	select HAVE_UNDERSCORE_SYMBOL_PREFIX
	select VIRT_TO_BUS
	select ARCH_WANT_IPC_PARSE_VERSION
	select HAVE_GENERIC_HARDIRQS
+1 −4
Original line number Diff line number Diff line
@@ -12,10 +12,7 @@ config H8300
	select MODULES_USE_ELF_RELA
	select OLD_SIGSUSPEND3
	select OLD_SIGACTION

config SYMBOL_PREFIX
	string
	default "_"
	select HAVE_UNDERSCORE_SYMBOL_PREFIX

config MMU
	bool
+1 −4
Original line number Diff line number Diff line
config SYMBOL_PREFIX
	string
	default "_"

config METAG
	def_bool y
	select EMBEDDED
@@ -27,6 +23,7 @@ config METAG
	select HAVE_MOD_ARCH_SPECIFIC
	select HAVE_PERF_EVENTS
	select HAVE_SYSCALL_TRACEPOINTS
	select HAVE_UNDERSCORE_SYMBOL_PREFIX
	select IRQ_DOMAIN
	select MODULES_USE_ELF_RELA
	select OF
Loading