2005-04-16 15:20:36 -07:00
/ * Kernel l i n k l a y o u t f o r v a r i o u s " s e c t i o n s "
*
* Copyright ( C ) 1 9 9 9 - 2 0 0 3 M a t t h e w W i l c o x < w i l l y a t p a r i s c - l i n u x . o r g >
* Copyright ( C ) 2 0 0 0 - 2 0 0 3 P a u l B a m e < b a m e a t p a r i s c - l i n u x . o r g >
* Copyright ( C ) 2 0 0 0 J o h n M a r v i n < j s m a t p a r i s c - l i n u x . o r g >
* Copyright ( C ) 2 0 0 0 M i c h a e l A n g < m a n g w i t h s u b c a r r i e r . o r g >
* Copyright ( C ) 2 0 0 2 R a n d o l p h C h u n g < t a u s q w i t h p a r i s c - l i n u x . o r g >
* Copyright ( C ) 2 0 0 3 J a m e s B o t t o m l e y < j e j b w i t h p a r i s c - l i n u x . o r g >
2013-11-30 22:07:51 +01:00
* Copyright ( C ) 2 0 0 6 - 2 0 1 3 H e l g e D e l l e r < d e l l e r @gmx.de>
* /
/ *
* Put p a g e t a b l e e n t r i e s ( s w a p p e r _ p g _ d i r ) a s t h e f i r s t t h i n g i n . b s s . T h i s
* will e n s u r e t h a t i t h a s . b s s a l i g n m e n t ( P A G E _ S I Z E ) .
2005-04-16 15:20:36 -07:00
* /
2013-11-30 22:07:51 +01:00
# define B S S _ F I R S T _ S E C T I O N S * ( . d a t a . . v m 0 . p m d ) \
* ( .data . .vm0 .pgd ) \
* ( .data . .vm0 .pte )
2005-04-16 15:20:36 -07:00
# include < a s m - g e n e r i c / v m l i n u x . l d s . h >
2013-11-30 22:07:51 +01:00
2005-04-16 15:20:36 -07:00
/* needed for the processor specific cache alignment size */
# include < a s m / c a c h e . h >
# include < a s m / p a g e . h >
2006-04-20 20:40:23 +00:00
# include < a s m / a s m - o f f s e t s . h >
2009-09-28 00:39:47 +02:00
# include < a s m / t h r e a d _ i n f o . h >
2005-04-16 15:20:36 -07:00
/* ld script to make hppa Linux kernel */
# ifndef C O N F I G _ 6 4 B I T
OUTPUT_ F O R M A T ( " e l f32 - h p p a - l i n u x " )
OUTPUT_ A R C H ( h p p a )
# else
OUTPUT_ F O R M A T ( " e l f64 - h p p a - l i n u x " )
OUTPUT_ A R C H ( h p p a : h p p a2 . 0 w )
# endif
2013-11-30 22:07:51 +01:00
ENTRY( p a r i s c _ k e r n e l _ s t a r t )
2005-04-16 15:20:36 -07:00
# ifndef C O N F I G _ 6 4 B I T
jiffies = j i f f i e s _ 6 4 + 4 ;
# else
jiffies = j i f f i e s _ 6 4 ;
# endif
SECTIONS
{
2007-10-18 00:04:25 -07:00
. = KERNEL_ B I N A R Y _ T E X T _ S T A R T ;
2005-04-16 15:20:36 -07:00
2013-11-30 22:07:51 +01:00
_ _ init_ b e g i n = . ;
HEAD_ T E X T _ S E C T I O N
INIT_ T E X T _ S E C T I O N ( 8 )
. = ALIGN( P A G E _ S I Z E ) ;
INIT_ D A T A _ S E C T I O N ( P A G E _ S I Z E )
/* we have to discard exit text and such at runtime, not link time */
.exit .text :
{
EXIT_ T E X T
}
.exit .data :
{
EXIT_ D A T A
}
PERCPU_ S E C T I O N ( 8 )
2015-11-22 00:07:44 +01:00
. = ALIGN( H U G E P A G E _ S I Z E ) ;
2013-11-30 22:07:51 +01:00
_ _ init_ e n d = . ;
/* freed after init ends here */
2007-10-18 00:04:25 -07:00
_ text = . ; /* Text and read-only data */
2013-11-30 22:07:51 +01:00
_ stext = . ;
.text ALIGN( P A G E _ S I Z E ) : {
2007-10-18 00:04:25 -07:00
TEXT_ T E X T
SCHED_ T E X T
2016-10-07 17:02:55 -07:00
CPUIDLE_ T E X T
2007-10-18 00:04:25 -07:00
LOCK_ T E X T
2009-02-09 00:43:36 +01:00
KPROBES_ T E X T
IRQENTRY_ T E X T
2016-03-25 14:22:05 -07:00
SOFTIRQENTRY_ T E X T
2007-10-18 00:04:25 -07:00
* ( .text .do_softirq )
* ( .text .sys_exit )
* ( .text .do_sigaltstack )
* ( .text .do_fork )
* ( .text . * )
* ( .fixup )
* ( .lock .text ) /* out-of-line lock text */
* ( .gnu .warning )
2012-05-17 10:34:34 -04:00
}
2013-11-30 22:07:51 +01:00
. = ALIGN( P A G E _ S I Z E ) ;
2007-10-18 00:04:25 -07:00
_ etext = . ;
2013-11-30 22:07:51 +01:00
/* End of text section */
2005-04-16 15:20:36 -07:00
2011-05-19 21:34:58 -04:00
/* Start of data section */
_ sdata = . ;
2016-10-09 11:12:34 +02:00
/ * Architecturally w e n e e d t o k e e p _ _ g p b e l o w 0 x10 0 0 0 0 0 a n d t h u s
* in f r o n t o f R O _ D A T A _ S E C T I O N ( ) w h i c h s t o r e s l o t s o f t r a c e p o i n t
* and f t r a c e s y m b o l s . * /
2013-11-30 22:07:51 +01:00
# ifdef C O N F I G _ 6 4 B I T
. = ALIGN( 1 6 ) ;
/* Linkage tables */
.opd : {
* ( .opd )
} PROVIDE ( _ _ g p = . ) ;
.plt : {
* ( .plt )
}
.dlt : {
* ( .dlt )
}
# endif
2007-08-26 23:28:34 -04:00
2016-10-09 11:12:34 +02:00
RO_ D A T A _ S E C T I O N ( 8 )
2007-10-18 00:04:25 -07:00
/* unwind info */
.PARISC .unwind : {
_ _ start_ _ _ u n w i n d = . ;
* ( .PARISC .unwind )
_ _ stop_ _ _ u n w i n d = . ;
}
2006-04-20 20:40:23 +00:00
2013-11-30 22:07:51 +01:00
/* writeable */
/ * Make s u r e t h i s i s p a g e a l i g n e d s o
* that w e c a n p r o p e r l y l e a v e t h e s e
* as w r i t a b l e
* /
2015-11-22 00:07:44 +01:00
. = ALIGN( H U G E P A G E _ S I Z E ) ;
2013-11-30 22:07:51 +01:00
data_ s t a r t = . ;
EXCEPTION_ T A B L E ( 8 )
2009-11-28 20:33:11 +00:00
NOTES
2007-10-18 00:04:25 -07:00
/* Data */
2013-05-07 19:28:52 +00:00
RW_ D A T A _ S E C T I O N ( L 1 _ C A C H E _ B Y T E S , P A G E _ S I Z E , P A G E _ S I Z E )
2005-04-16 15:20:36 -07:00
2007-10-18 00:04:25 -07:00
/* PA-RISC locks requires 16-byte alignment */
. = ALIGN( 1 6 ) ;
2010-02-20 01:03:55 +01:00
.data . .lock_aligned : {
* ( .data . .lock_aligned )
2007-10-18 00:04:25 -07:00
}
2005-04-16 15:20:36 -07:00
2007-10-18 00:04:25 -07:00
/* End of data section */
_ edata = . ;
2005-04-16 15:20:36 -07:00
2007-10-18 00:04:25 -07:00
/* BSS */
2015-11-22 00:07:44 +01:00
BSS_ S E C T I O N ( P A G E _ S I Z E , P A G E _ S I Z E , P A G E _ S I Z E )
. = ALIGN( H U G E P A G E _ S I Z E ) ;
2007-10-18 00:04:25 -07:00
_ end = . ;
2007-07-19 01:48:12 -07:00
linker script: unify usage of discard definition
Discarded sections in different archs share some commonality but have
considerable differences. This led to linker script for each arch
implementing its own /DISCARD/ definition, which makes maintaining
tedious and adding new entries error-prone.
This patch makes all linker scripts to move discard definitions to the
end of the linker script and use the common DISCARDS macro. As ld
uses the first matching section definition, archs can include default
discarded sections by including them earlier in the linker script.
ia64 is notable because it first throws away some ia64 specific
subsections and then include the rest of the sections into the final
image, so those sections must be discarded before the inclusion.
defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
alpha, sparc, sparc64 and s390. Michal Simek tested microblaze.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Tony Luck <tony.luck@intel.com>
2009-07-09 11:27:40 +09:00
STABS_ D E B U G
.note 0 : { * ( .note ) }
2007-10-18 00:04:25 -07:00
/* Sections to be discarded */
linker script: unify usage of discard definition
Discarded sections in different archs share some commonality but have
considerable differences. This led to linker script for each arch
implementing its own /DISCARD/ definition, which makes maintaining
tedious and adding new entries error-prone.
This patch makes all linker scripts to move discard definitions to the
end of the linker script and use the common DISCARDS macro. As ld
uses the first matching section definition, archs can include default
discarded sections by including them earlier in the linker script.
ia64 is notable because it first throws away some ia64 specific
subsections and then include the rest of the sections into the final
image, so those sections must be discarded before the inclusion.
defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
alpha, sparc, sparc64 and s390. Michal Simek tested microblaze.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Tony Luck <tony.luck@intel.com>
2009-07-09 11:27:40 +09:00
DISCARDS
2007-10-18 00:04:25 -07:00
/ DISCARD/ : {
2005-04-16 15:20:36 -07:00
# ifdef C O N F I G _ 6 4 B I T
2007-10-18 00:04:25 -07:00
/ * temporary h a c k u n t i l b i n u t i l s i s f i x e d t o n o t e m i t t h e s e
* for s t a t i c b i n a r i e s
* /
* ( .interp )
* ( .dynsym )
* ( .dynstr )
* ( .dynamic )
* ( .hash )
* ( .gnu .hash )
2005-04-16 15:20:36 -07:00
# endif
}
}