Skip to content
Snippets Groups Projects
Commit 405d967d authored by Tejun Heo's avatar Tejun Heo
Browse files

linker script: throw away .discard section


x86 throws away .discard section but no other archs do.  Also,
.discard is not thrown away while linking modules.  Make every arch
and module linking throw it away.  This will be used to define dummy
variables for percpu declarations and definitions.

This patch is based on Ivan Kokshaysky's alpha percpu patch.

[ Impact: always throw away everything in .discard ]

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Bryan Wu <cooloney@kernel.org>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>
parent e74e3962
No related merge requests found
...@@ -175,6 +175,7 @@ SECTIONS ...@@ -175,6 +175,7 @@ SECTIONS
EXIT_TEXT EXIT_TEXT
EXIT_DATA EXIT_DATA
*(.exitcall.exit) *(.exitcall.exit)
*(.discard)
} }
STABS_DEBUG STABS_DEBUG
......
...@@ -156,4 +156,6 @@ SECTIONS ...@@ -156,4 +156,6 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
/DISCARD/ : { *(.discard) }
} }
...@@ -100,4 +100,6 @@ SECTIONS ...@@ -100,4 +100,6 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
/DISCARD/ : { *(.discard) }
} }
...@@ -287,6 +287,7 @@ SECTIONS ...@@ -287,6 +287,7 @@ SECTIONS
EXIT_TEXT EXIT_TEXT
EXIT_DATA EXIT_DATA
*(.exitcall.exit) *(.exitcall.exit)
*(.discard)
} }
.xt.lit : { *(.xt.lit) } .xt.lit : { *(.xt.lit) }
......
...@@ -628,6 +628,14 @@ ...@@ -628,6 +628,14 @@
#define INITRAMFS #define INITRAMFS
#endif #endif
#define DISCARDS \
/DISCARD/ : { \
EXIT_TEXT \
EXIT_DATA \
*(.exitcall.exit) \
*(.discard) \
}
/** /**
* PERCPU_VADDR - define output section for percpu area * PERCPU_VADDR - define output section for percpu area
* @vaddr: explicit base address (optional) * @vaddr: explicit base address (optional)
......
/*
* Common module linker script, always used when linking a module.
* Archs are free to supply their own linker scripts. ld will
* combine them automatically.
*/
SECTIONS {
/DISCARD/ : { *(.discard) }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment