Skip to contentSkip to conversation

Drop exported symbols list if !modules

PATCH In review Matt Mackall 4 participants 8 messages Apr 5, 2004 – Apr 6, 2004

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Drop exported symbols list if !modules

Drop ksyms if we've built without module support

From: Zwane Mwaikambo <[email protected]>
Subject: Re: 2.6.1-rc1-tiny2

Index: linux-2.6.1-rc1-tiny2/arch/alpha/kernel/Makefile=================================================================== RCS file: /home/cvsroot/linux-2.6.1-rc1-tiny2/arch/alpha/kernel/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 Makefile

 tiny-mpm/arch/alpha/kernel/Makefile   |    4 ++--
 tiny-mpm/arch/i386/kernel/Makefile    |    4 ++--
 tiny-mpm/arch/ia64/kernel/Makefile    |    4 ++--
 tiny-mpm/arch/m68k/kernel/Makefile    |    4 ++--
 tiny-mpm/arch/parisc/kernel/Makefile  |    4 ++--
 tiny-mpm/arch/sh/kernel/Makefile      |    4 ++--
 tiny-mpm/arch/sparc64/kernel/Makefile |    4 ++--
 tiny-mpm/arch/x86_64/kernel/Makefile  |    4 ++--
 8 files changed, 16 insertions(+), 16 deletions(-)
arch/alpha/kernel/Makefile +2 -2
Index: tiny/arch/alpha/kernel/Makefile
===================================================================
@@ -8,13 +8,13 @@
 
 obj-y    := entry.o traps.o process.o init_task.o osf_sys.o irq.o \
 	    irq_alpha.o signal.o setup.o ptrace.o time.o semaphore.o \
-	    alpha_ksyms.o systbls.o err_common.o
+	    systbls.o err_common.o
 
 obj-$(CONFIG_VGA_HOSE)	+= console.o
 obj-$(CONFIG_SMP)	+= smp.o
 obj-$(CONFIG_PCI)	+= pci.o pci_iommu.o
 obj-$(CONFIG_SRM_ENV)	+= srm_env.o
-obj-$(CONFIG_MODULES)	+= module.o
+obj-$(CONFIG_MODULES)	+= alpha_ksyms.o module.o
 
 ifdef CONFIG_ALPHA_GENERIC
 
arch/i386/kernel/Makefile +2 -2
Index: tiny/arch/i386/kernel/Makefile
===================================================================
@@ -6,7 +6,7 @@
 
 obj-y	:= process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \
 		ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \
-		pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \
+		pci-dma.o i387.o dmi_scan.o bootflag.o \
 		doublefault.o
 
 obj-y				+= cpu/
@@ -26,7 +26,7 @@
 obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o
 obj-$(CONFIG_X86_NUMAQ)		+= numaq.o
 obj-$(CONFIG_X86_SUMMIT_NUMA)	+= summit.o
-obj-$(CONFIG_MODULES)		+= module.o
+obj-$(CONFIG_MODULES)		+= module.o i386_ksyms.o
 obj-y				+= sysenter.o vsyscall.o
 obj-$(CONFIG_ACPI_SRAT) 	+= srat.o
 obj-$(CONFIG_HPET_TIMER) 	+= time_hpet.o
arch/ia64/kernel/Makefile +2 -2
Index: tiny/arch/ia64/kernel/Makefile
===================================================================
@@ -4,7 +4,7 @@
 
 extra-y	:= head.o init_task.o vmlinux.lds.s
 
-obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o	\
+obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o irq.o irq_ia64.o	\
 	 irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o		\
 	 salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o unwind.o mca.o mca_asm.o
 
@@ -14,7 +14,7 @@
 obj-$(CONFIG_IA64_HP_ZX1)	+= acpi-ext.o
 obj-$(CONFIG_IA64_PALINFO)	+= palinfo.o
 obj-$(CONFIG_IOSAPIC)		+= iosapic.o
-obj-$(CONFIG_MODULES)		+= module.o
+obj-$(CONFIG_MODULES)		+= ia64_ksyms.o module.o
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o
 obj-$(CONFIG_PERFMON)		+= perfmon_default_smpl.o
 obj-$(CONFIG_IA64_CYCLONE)	+= cyclone.o
arch/m68k/kernel/Makefile +2 -2
Index: tiny/arch/m68k/kernel/Makefile
===================================================================
@@ -10,9 +10,9 @@
 extra-y	+= vmlinux.lds.s
 
 obj-y		:= entry.o process.o traps.o ints.o signal.o ptrace.o \
-			sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o
+			sys_m68k.o time.o semaphore.o setup.o
 
 obj-$(CONFIG_PCI)	+= bios32.o
-obj-$(CONFIG_MODULES)	+= module.o
+obj-$(CONFIG_MODULES)	+= m68k_ksyms.o module.o
 
 EXTRA_AFLAGS := -traditional
arch/parisc/kernel/Makefile +2 -2
Index: tiny/arch/parisc/kernel/Makefile
===================================================================
@@ -13,13 +13,13 @@
 obj-y	     	:= cache.o pacache.o setup.o traps.o time.o irq.o \
 		   pa7300lc.o syscall.o entry.o sys_parisc.o firmware.o \
 		   ptrace.o hardware.o inventory.o drivers.o semaphore.o \
-		   signal.o hpmc.o real2.o parisc_ksyms.o unaligned.o \
+		   signal.o hpmc.o real2.o unaligned.o \
 		   process.o processor.o pdc_cons.o pdc_chassis.o
 
 obj-$(CONFIG_SMP)	+= smp.o
 obj-$(CONFIG_PA11)	+= pci-dma.o
 obj-$(CONFIG_PCI)	+= pci.o
-obj-$(CONFIG_MODULES)	+= module.o
+obj-$(CONFIG_MODULES)	+= parisc_ksyms.o module.o
 obj-$(CONFIG_PARISC64)	+= binfmt_elf32.o sys_parisc32.o ioctl32.o signal32.o
 # only supported for PCX-W/U in 64-bit mode at the moment
 obj-$(CONFIG_PARISC64)	+= perf.o perf_asm.o
arch/sh/kernel/Makefile +2 -2
Index: tiny/arch/sh/kernel/Makefile
===================================================================
@@ -6,7 +6,7 @@
 
 obj-y	:= process.o signal.o entry.o traps.o irq.o \
 	ptrace.o setup.o time.o sys_sh.o semaphore.o \
-	io.o io_generic.o sh_ksyms.o
+	io.o io_generic.o
 
 obj-y				+= cpu/
 
@@ -15,7 +15,7 @@
 obj-$(CONFIG_SH_STANDARD_BIOS)	+= sh_bios.o
 obj-$(CONFIG_SH_KGDB)		+= kgdb_stub.o kgdb_jmp.o
 obj-$(CONFIG_SH_CPU_FREQ)	+= cpufreq.o
-obj-$(CONFIG_MODULES)		+= module.o
+obj-$(CONFIG_MODULES)		+= sh_ksyms.o module.o
 
 USE_STANDARD_AS_RULE := true
 
arch/sparc64/kernel/Makefile +2 -2
Index: tiny/arch/sparc64/kernel/Makefile
===================================================================
@@ -11,7 +11,7 @@
 		   traps.o devices.o auxio.o \
 		   irq.o ptrace.o time.o sys_sparc.o signal.o \
 		   unaligned.o central.o pci.o starfire.o semaphore.o \
-		   power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o
+		   power.o sbus.o iommu_common.o chmc.o
 
 obj-$(CONFIG_PCI)	 += ebus.o isa.o pci_common.o pci_iommu.o \
 			    pci_psycho.o pci_sabre.o pci_schizo.o
@@ -19,7 +19,7 @@
 obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o ioctl32.o
 obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o
 obj-$(CONFIG_BINFMT_AOUT32) += binfmt_aout32.o
-obj-$(CONFIG_MODULES) += module.o
+obj-$(CONFIG_MODULES) += sparc64_ksyms.o module.o
 obj-$(CONFIG_US3_FREQ) += us3_cpufreq.o
 obj-$(CONFIG_US2E_FREQ) += us2e_cpufreq.o
 
arch/x86_64/kernel/Makefile +2 -2
Index: tiny/arch/x86_64/kernel/Makefile
===================================================================
@@ -6,7 +6,7 @@
 EXTRA_AFLAGS	:= -traditional
 obj-y	:= process.o semaphore.o signal.o entry.o traps.o irq.o \
 		ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
-		x8664_ksyms.o i387.o syscall.o vsyscall.o \
+		i387.o syscall.o vsyscall.o \
 		setup64.o bootflag.o e820.o reboot.o warmreboot.o
 obj-y += mce.o acpi/
 
@@ -26,7 +26,7 @@
 obj-$(CONFIG_DUMMY_IOMMU)	+= pci-nommu.o pci-dma.o
 obj-$(CONFIG_SWIOTLB)		+= swiotlb.o
 
-obj-$(CONFIG_MODULES)		+= module.o
+obj-$(CONFIG_MODULES)		+= x8664_ksyms.o module.o
 
 obj-y				+= topology.o
 
Signature · 1 line
Matt Mackall : http://www.selenic.com : Linux development and consulting
#1 lore raw
Quoted 4 lines · Matt Mackall

Drop ksyms if we've built without module support

From: Zwane Mwaikambo <[email protected]>
Subject: Re: 2.6.1-rc1-tiny2

Other than saving a little compile time, does this actually do anything?

I'm not against it, I just don't think I see the point.

Rusty.

Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell
#2 lore raw
Quoted 9 lines · Rusty Russell
Quoted 4 lines · Matt Mackall

Drop ksyms if we've built without module support

From: Zwane Mwaikambo <[email protected]>
Subject: Re: 2.6.1-rc1-tiny2

Other than saving a little compile time, does this actually do anything?

I'm not against it, I just don't think I see the point.

Well it obviously saves memory and image size too; I'm in the process of merging bits from my -tiny tree. As bloat has a way of being well-distributed across the code base, it's going to take many small trimmings to cut it back. Most of the 150 or so patches I've got now save between 1 and 8k. Doesn't sound like much, but it adds up.

Signature · 1 line
Matt Mackall : http://www.selenic.com : Linux development and consulting
#3 lore raw
Quoted 4 lines · Matt Mackall
Quoted 3 lines · Rusty Russell
Quoted 2 lines · Matt Mackall

Drop ksyms if we've built without module support

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

From: Zwane Mwaikambo <[email protected]>
Subject: Re: 2.6.1-rc1-tiny2

Other than saving a little compile time, does this actually do anything?

I'm not against it, I just don't think I see the point.

Well it obviously saves memory and image size too;

Please measure it. It's not obvious to me at all.

Thanks,
Rusty.

Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell
#4 lore raw
Quoted 9 lines · Rusty Russell
Quoted 7 lines · Matt Mackall
Quoted 6 lines · Rusty Russell
Quoted 4 lines · Matt Mackall

Drop ksyms if we've built without module support

From: Zwane Mwaikambo <[email protected]>
Subject: Re: 2.6.1-rc1-tiny2

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Other than saving a little compile time, does this actually do anything?

I'm not against it, I just don't think I see the point.

Well it obviously saves memory and image size too;

Please measure it. It's not obvious to me at all.

Miniscule savings

text data bss dec hex filename

3221815  862456       0 4084271  3e522f vmlinux-before
3221591  862456       0 4084047  3e514f vmlinux-after
#5 lore raw
Quoted 16 lines · Andrew Morton
Quoted 15 lines · Rusty Russell
Quoted 12 lines · Matt Mackall
Quoted 9 lines · Rusty Russell
Quoted 4 lines · Matt Mackall

Drop ksyms if we've built without module support

From: Zwane Mwaikambo <[email protected]>
Subject: Re: 2.6.1-rc1-tiny2

Other than saving a little compile time, does this actually do anything?

I'm not against it, I just don't think I see the point.

Well it obviously saves memory and image size too;

Quoted 7 lines
Quoted 1 line

Please measure it. It's not obvious to me at all.

Miniscule savings

text data bss dec hex filename

3221815  862456       0 4084271  3e522f vmlinux-before
3221591  862456       0 4084047  3e514f vmlinux-after

I was seeing this when I added it to my tree circa 2.6.1:

 701262   58619   15616  775497   bd549 vmlinux before 
 700530   58619   15616  774765   bd26d vmlinux after

..which I would expect to grow with code size.

On the other hand, I'm now seeing:

      0       0       0       0       0 arch/i386/kernel/i386_ksyms.o

So something's changed.

Signature · 1 line
Matt Mackall : http://www.selenic.com : Linux development and consulting
#6 lore raw
In reply to Andrew Morton
Quoted 8 lines · Andrew Morton
Quoted 1 line · Rusty Russell

Please measure it. It's not obvious to me at all.

Miniscule savings

text data bss dec hex filename

3221815  862456       0 4084271  3e522f vmlinux-before
3221591  862456       0 4084047  3e514f vmlinux-after

Reproduced here: that's the .comment section getting a little larger.

This gets stripped in building arch/i386/boot/vmlinux.bin, and hence arch/i386/boot/bzImage.

So, the patch is just churn AFAICT.

Thanks,
Rusty.

Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell
#7 lore raw
In reply to Matt Mackall
Quoted 11 lines · Matt Mackall
Quoted 9 lines · Rusty Russell
Quoted 4 lines · Matt Mackall

Drop ksyms if we've built without module support

From: Zwane Mwaikambo <[email protected]>
Subject: Re: 2.6.1-rc1-tiny2

Other than saving a little compile time, does this actually do anything?

Quoted 9 lines
Quoted 1 line

I'm not against it, I just don't think I see the point.

Well it obviously saves memory and image size too; I'm in the process of merging bits from my -tiny tree. As bloat has a way of being well-distributed across the code base, it's going to take many small trimmings to cut it back. Most of the 150 or so patches I've got now save between 1 and 8k. Doesn't sound like much, but it adds up.

EXPORT_SYMBOL() is a no-op when modules are disabled:

$ size arch/i386/kernel/i386_ksyms.o
   text    data     bss     dec     hex filename
      0       0       0       0       0 arch/i386/kernel/i386_ksyms.o

Although, what really should be done is to move the exports to the appropriate files instead of keeping them lumped together.

--
Brian Gerst