2005-04-16 15:20:36 -07:00
/ *
2007-11-20 15:35:42 +09:00
* ld s c r i p t t o m a k e S H 6 4 L i n u x k e r n e l
2005-04-16 15:20:36 -07:00
*
* Copyright ( C ) 2 0 0 0 , 2 0 0 1 P a o l o A l b e r e l l i
*
* benedict. g a s t e r @superh.com: 2nd May 2002
* Add d e f i n i t i o n o f e m p t y _ z e r o _ p a g e t o b e t h e f i r s t p a g e o f k e r n e l i m a g e .
*
* benedict. g a s t e r @superh.com: 3rd May 2002
2007-11-20 15:35:42 +09:00
* Added s u p p o r t f o r r a m d i s k , r e m o v i n g s t a t i c a l l y l i n k e d r o m f s a t t h e
* same t i m e .
2005-04-16 15:20:36 -07:00
*
* lethal@linux-sh.org: 9th May 2003
* Kill o f f G L O B A L _ N A M E ( ) u s a g e a n d o t h e r C D C - i s m s .
*
* lethal@linux-sh.org: 19th May 2003
* Remove s u p p o r t f o r a n c i e n t t o o l c h a i n s .
2007-11-20 15:35:42 +09:00
*
* 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 .
2005-04-16 15:20:36 -07:00
* /
# include < a s m / p a g e . h >
# include < a s m / c a c h e . h >
# include < a s m / t h r e a d _ i n f o . h >
2007-11-21 15:34:33 +09:00
# define L O A D _ O F F S E T C O N F I G _ P A G E _ O F F S E T
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 >
OUTPUT_ A R C H ( s h : s h5 )
# define C _ P H Y S ( x ) A T ( A D D R ( x ) - L O A D _ O F F S E T )
ENTRY( _ _ s t a r t )
SECTIONS
{
2007-11-21 15:34:33 +09:00
. = CONFIG_ P A G E _ O F F S E T + C O N F I G _ M E M O R Y _ S T A R T + P A G E _ S I Z E ;
2007-11-20 15:35:42 +09:00
_ text = . ; /* Text and read-only data */
2005-04-16 15:20:36 -07:00
2007-11-20 15:35:42 +09:00
.empty_zero_page : C_ P H Y S ( . e m p t y _ z e r o _ p a g e ) {
* ( .empty_zero_page )
2005-04-16 15:20:36 -07:00
} = 0
2007-11-20 15:35:42 +09:00
.text : C_ P H Y S ( . t e x t ) {
* ( .text .head )
TEXT_ T E X T
* ( .text64 )
* ( .text . .SHmedia32 )
SCHED_ T E X T
LOCK_ T E X T
KPROBES_ T E X T
* ( .fixup )
* ( .gnu .warning )
2005-04-16 15:20:36 -07:00
# ifdef C O N F I G _ L I T T L E _ E N D I A N
} = 0 x6 f f0 f f f0
# else
} = 0 xf0 f f f06 f
# endif
2007-11-20 15:35:42 +09:00
/* We likely want __ex_table to be Cache Line aligned */
. = ALIGN( L 1 _ C A C H E _ B Y T E S ) ; /* Exception table */
_ _ start_ _ _ e x _ t a b l e = . ;
_ _ ex_ t a b l e : C _ P H Y S ( _ _ e x _ t a b l e ) { * ( _ _ e x _ t a b l e ) }
_ _ stop_ _ _ e x _ t a b l e = . ;
2005-04-16 15:20:36 -07:00
2007-11-20 15:35:42 +09:00
_ etext = . ; /* End of text section */
2005-04-16 15:20:36 -07:00
2007-11-20 15:35:42 +09:00
BUG_ T A B L E
NOTES
RO_ D A T A ( P A G E _ S I Z E )
2007-10-09 15:53:16 +09:00
2007-11-20 15:35:42 +09:00
. = ALIGN( T H R E A D _ S I Z E ) ;
.data : C_ P H Y S ( . d a t a ) { / * D a t a * /
* ( .data .init_task )
2007-10-09 15:53:16 +09:00
2007-11-20 15:35:42 +09:00
. = ALIGN( L 1 _ C A C H E _ B Y T E S ) ;
* ( .data .cacheline_aligned )
. = ALIGN( L 1 _ C A C H E _ B Y T E S ) ;
* ( .data .read_mostly )
. = ALIGN( P A G E _ S I Z E ) ;
* ( .data .page_aligned )
_ _ nosave_ b e g i n = . ;
* ( .data .nosave )
. = ALIGN( P A G E _ S I Z E ) ;
_ _ nosave_ e n d = . ;
DATA_ D A T A
CONSTRUCTORS
2005-04-16 15:20:36 -07:00
}
2007-11-20 15:35:42 +09:00
_ edata = . ; /* End of data section */
. = ALIGN( P A G E _ S I Z E ) ; /* Init code and data */
_ _ init_ b e g i n = . ;
_ sinittext = . ;
2008-01-20 14:15:03 +01:00
.init .text : C_ P H Y S ( . i n i t . t e x t ) { I N I T _ T E X T }
2007-11-20 15:35:42 +09:00
_ einittext = . ;
2008-01-20 14:15:03 +01:00
.init .data : C_ P H Y S ( . i n i t . d a t a ) { I N I T _ D A T A }
2007-11-20 15:35:42 +09:00
. = ALIGN( L 1 _ C A C H E _ B Y T E S ) ; /* Better if Cache Line aligned */
_ _ setup_ s t a r t = . ;
.init .setup : C_ P H Y S ( . i n i t . s e t u p ) { * ( . i n i t . s e t u p ) }
_ _ setup_ e n d = . ;
_ _ initcall_ s t a r t = . ;
.initcall .init : C_ P H Y S ( . i n i t c a l l . i n i t ) {
INITCALLS
}
_ _ initcall_ e n d = . ;
_ _ con_ i n i t c a l l _ s t a r t = . ;
.con_initcall .init : C_ P H Y S ( . c o n _ i n i t c a l l . i n i t ) {
* ( .con_initcall .init )
}
_ _ con_ i n i t c a l l _ e n d = . ;
SECURITY_ I N I T
2007-02-10 01:44:44 -08:00
# ifdef C O N F I G _ B L K _ D E V _ I N I T R D
2007-11-20 15:35:42 +09:00
. = ALIGN( P A G E _ S I Z E ) ;
_ _ initramfs_ s t a r t = . ;
.init .ramfs : C_ P H Y S ( . i n i t . r a m f s ) { * ( . i n i t . r a m f s ) }
_ _ initramfs_ e n d = . ;
2007-02-10 01:44:44 -08:00
# endif
2007-11-20 15:35:42 +09:00
. = ALIGN( 8 ) ;
_ _ machvec_ s t a r t = . ;
.machvec .init : C_ P H Y S ( . m a c h v e c . i n i t ) { * ( . m a c h v e c . i n i t ) }
_ _ machvec_ e n d = . ;
PERCPU( P A G E _ S I Z E )
/ *
* .exit .text is discarded a t r u n t i m e , n o t l i n k t i m e , t o d e a l w i t h
* references f r o m _ _ b u g _ t a b l e
* /
2008-01-20 14:15:03 +01:00
.exit .text : C_ P H Y S ( . e x i t . t e x t ) { E X I T _ T E X T }
.exit .data : C_ P H Y S ( . e x i t . d a t a ) { E X I T _ D A T A }
2007-11-20 15:35:42 +09:00
. = ALIGN( P A G E _ S I Z E ) ;
.bss : C_ P H Y S ( . b s s ) {
_ _ init_ e n d = . ;
_ _ bss_ s t a r t = . ; /* BSS */
* ( .bss .page_aligned )
* ( .bss )
* ( COMMON)
. = ALIGN( 4 ) ;
_ ebss = . ; /* uClinux MTD sucks */
_ end = . ;
2005-04-16 15:20:36 -07:00
}
2007-11-20 15:35:42 +09:00
/ *
* When s o m e t h i n g i n t h e k e r n e l i s N O T c o m p i l e d a s a m o d u l e , t h e
* module c l e a n u p c o d e a n d d a t a a r e p u t i n t o t h e s e s e g m e n t s . B o t h
* can t h e n b e t h r o w n a w a y , a s c l e a n u p c o d e i s n e v e r c a l l e d u n l e s s
* it' s a m o d u l e .
* /
/ DISCARD/ : {
* ( .exitcall .exit )
2005-04-16 15:20:36 -07:00
}
2007-11-20 15:35:42 +09:00
STABS_ D E B U G
DWARF_ D E B U G
2005-04-16 15:20:36 -07:00
}