2009-03-27 16:25:20 +03:00
/ *
* Copyright ( C ) 2 0 0 8 - 2 0 0 9 M i c h a l S i m e k < m o n s t r @monstr.eu>
* Copyright ( C ) 2 0 0 8 - 2 0 0 9 P e t a L o g i x
* Copyright ( C ) 2 0 0 6 A t m a r k T e c h n o , I n c .
*
* This f i l e i s s u b j e c t t o t h e t e r m s a n d c o n d i t i o n s o f t h e G N U G e n e r a l P u b l i c
* License. S e e t h e f i l e " C O P Y I N G " i n t h e m a i n d i r e c t o r y o f t h i s a r c h i v e
* for m o r e d e t a i l s .
* /
OUTPUT_ A R C H ( m i c r o b l a z e )
2010-07-28 11:29:11 +04:00
ENTRY( m i c r o b l a z e _ s t a r t )
2009-03-27 16:25:20 +03:00
2009-09-07 07:10:10 +04:00
# include < a s m / p a g e . h >
2009-09-22 11:58:56 +04:00
# include < a s m - g e n e r i c / v m l i n u x . l d s . h >
2009-09-07 07:10:10 +04:00
# include < a s m / t h r e a d _ i n f o . h >
2009-03-27 16:25:20 +03:00
2010-09-28 10:04:14 +04:00
# ifdef _ _ M I C R O B L A Z E E L _ _
jiffies = j i f f i e s _ 6 4 ;
# else
2009-03-27 16:25:20 +03:00
jiffies = j i f f i e s _ 6 4 + 4 ;
2010-09-28 10:04:14 +04:00
# endif
2009-03-27 16:25:20 +03:00
SECTIONS {
2009-05-26 18:30:24 +04:00
. = CONFIG_ K E R N E L _ S T A R T ;
2010-07-28 11:29:11 +04:00
microblaze_ s t a r t = C O N F I G _ K E R N E L _ B A S E _ A D D R ;
2009-09-22 11:58:56 +04:00
.text : AT( A D D R ( . t e x t ) - L O A D _ O F F S E T ) {
2009-03-27 16:25:20 +03:00
_ text = . ;
_ stext = . ;
2010-04-10 07:03:37 +04:00
HEAD_ T E X T
TEXT_ T E X T
2009-03-27 16:25:20 +03:00
* ( .fixup )
2009-11-06 14:27:25 +03:00
EXIT_ T E X T
EXIT_ C A L L
2009-03-27 16:25:20 +03:00
SCHED_ T E X T
LOCK_ T E X T
KPROBES_ T E X T
2009-11-06 14:27:25 +03:00
IRQENTRY_ T E X T
2009-03-27 16:25:20 +03:00
. = ALIGN ( 4 ) ;
_ etext = . ;
}
. = ALIGN ( 4 ) ;
2009-09-22 11:58:56 +04:00
_ _ fdt_ b l o b : A T ( A D D R ( _ _ f d t _ b l o b ) - L O A D _ O F F S E T ) {
_ fdt_ s t a r t = . ; /* place for fdt blob */
* ( _ _ fdt_ b l o b ) ; /* Any link-placed DTB */
. = _ fdt_ s t a r t + 0 x40 0 0 ; /* Pad up to 16kbyte */
_ fdt_ e n d = . ;
}
2009-03-27 16:25:20 +03:00
. = ALIGN( 1 6 ) ;
RODATA
2009-09-07 07:10:10 +04:00
EXCEPTION_ T A B L E ( 1 6 )
2009-03-27 16:25:20 +03:00
/ *
* sdata2 s e c t i o n c a n g o a n y w h e r e , b u t m u s t b e w o r d a l i g n e d
* and S D A 2 _ B A S E m u s t p o i n t t o t h e m i d d l e o f i t
* /
2009-09-22 11:58:56 +04:00
.sdata2 : AT( A D D R ( . s d a t a2 ) - L O A D _ O F F S E T ) {
2009-03-27 16:25:20 +03:00
_ ssrw = . ;
2010-05-13 19:48:27 +04:00
. = ALIGN( P A G E _ S I Z E ) ; /* page aligned when MMU used */
2009-03-27 16:25:20 +03:00
* ( .sdata2 )
. = ALIGN( 8 ) ;
_ essrw = . ;
_ ssrw_ s i z e = _ e s s r w - _ s s r w ;
_ KERNEL_ S D A 2 _ B A S E _ = _ s s r w + ( _ s s r w _ s i z e / 2 ) ;
}
_ sdata = . ;
2009-09-07 07:10:10 +04:00
RW_ D A T A _ S E C T I O N ( 3 2 , P A G E _ S I Z E , T H R E A D _ S I Z E )
2009-03-27 16:25:20 +03:00
_ edata = . ;
/* Reserve some low RAM for r0 based memory references */
. = ALIGN( 0 x4 ) ;
r0 _ r a m = . ;
2010-05-13 19:48:27 +04:00
. = . + PAGE_ S I Z E ; /* a page should be enough */
2009-03-27 16:25:20 +03:00
/* Under the microblaze ABI, .sdata and .sbss must be contiguous */
. = ALIGN( 8 ) ;
2009-09-22 11:58:56 +04:00
.sdata : AT( A D D R ( . s d a t a ) - L O A D _ O F F S E T ) {
2009-03-27 16:25:20 +03:00
_ ssro = . ;
* ( .sdata )
}
2009-09-22 11:58:56 +04:00
.sbss : AT( A D D R ( . s b s s ) - L O A D _ O F F S E T ) {
2009-03-27 16:25:20 +03:00
_ ssbss = . ;
* ( .sbss )
_ esbss = . ;
_ essro = . ;
_ ssro_ s i z e = _ e s s r o - _ s s r o ;
_ KERNEL_ S D A _ B A S E _ = _ s s r o + ( _ s s r o _ s i z e / 2 ) ;
}
2009-10-30 16:41:52 +03:00
. = ALIGN( P A G E _ S I Z E ) ;
2009-03-27 16:25:20 +03:00
_ _ init_ b e g i n = . ;
2009-09-07 07:10:10 +04:00
INIT_ T E X T _ S E C T I O N ( P A G E _ S I Z E )
2009-03-27 16:25:20 +03:00
2009-09-22 11:58:56 +04:00
.init .data : AT( A D D R ( . i n i t . d a t a ) - L O A D _ O F F S E T ) {
2009-06-20 16:24:01 +04:00
INIT_ D A T A
}
2009-03-27 16:25:20 +03:00
. = ALIGN( 4 ) ;
2009-09-22 11:58:56 +04:00
.init .ivt : AT( A D D R ( . i n i t . i v t ) - L O A D _ O F F S E T ) {
2009-03-27 16:25:20 +03:00
_ _ ivt_ s t a r t = . ;
* ( .init .ivt )
_ _ ivt_ e n d = . ;
}
2009-09-22 11:58:56 +04:00
.init .setup : AT( A D D R ( . i n i t . s e t u p ) - L O A D _ O F F S E T ) {
2009-09-07 07:10:10 +04:00
INIT_ S E T U P ( 0 )
2009-03-27 16:25:20 +03:00
}
2009-09-22 11:58:56 +04:00
.initcall .init : AT( A D D R ( . i n i t c a l l . i n i t ) - L O A D _ O F F S E T ) {
2009-09-07 07:10:10 +04:00
INIT_ C A L L S
2009-03-27 16:25:20 +03:00
}
2009-09-22 11:58:56 +04:00
.con_initcall .init : AT( A D D R ( . c o n _ i n i t c a l l . i n i t ) - L O A D _ O F F S E T ) {
2009-09-07 07:10:10 +04:00
CON_ I N I T C A L L
2009-03-27 16:25:20 +03:00
}
2009-05-02 01:36:44 +04:00
SECURITY_ I N I T
2009-03-27 16:25:20 +03:00
_ _ init_ e n d _ b e f o r e _ i n i t r a m f s = . ;
2010-11-02 20:04:04 +03:00
.init .ramfs : AT( A D D R ( . i n i t . r a m f s ) - L O A D _ O F F S E T ) {
INIT_ R A M _ F S
2009-03-27 16:25:20 +03:00
}
2010-11-02 20:04:04 +03:00
2009-03-27 16:25:20 +03:00
_ _ init_ e n d = . ;
2010-05-13 19:48:27 +04:00
.bss ALIGN ( PAGE_ S I Z E ) : A T ( A D D R ( . b s s ) - L O A D _ O F F S E T ) {
2009-09-22 11:58:56 +04:00
/* page aligned when MMU used */
2009-03-27 16:25:20 +03:00
_ _ bss_ s t a r t = . ;
* ( .bss * )
* ( COMMON)
. = ALIGN ( 4 ) ;
_ _ bss_ s t o p = . ;
_ ebss = . ;
}
2010-05-13 19:48:27 +04:00
. = ALIGN( P A G E _ S I Z E ) ;
2009-03-27 16:25:20 +03:00
_ end = . ;
2009-06-24 10:13:38 +04: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 06:27:40 +04:00
DISCARDS
2009-03-27 16:25:20 +03:00
}