2005-04-16 15:20:36 -07:00
/ * ld s c r i p t t o m a k e A R M L i n u x k e r n e l
* taken f r o m t h e i 3 8 6 v e r s i o n b y R u s s e l l K i n g
* Written b y M a r t i n M a r e s < m j @atrey.karlin.mff.cuni.cz>
* /
# include < a s m - g e n e r i c / v m l i n u x . l d s . h >
2005-05-05 13:11:00 +01:00
# include < a s m / t h r e a d _ i n f o . h >
2005-10-29 21:44:56 +01:00
# include < a s m / m e m o r y . h >
2009-06-24 23:38:56 +01:00
# include < a s m / p a g e . h >
2005-04-16 15:20:36 -07:00
OUTPUT_ A R C H ( a r m )
ENTRY( s t e x t )
2005-10-29 21:44:56 +01:00
2005-04-16 15:20:36 -07:00
# ifndef _ _ A R M E B _ _
jiffies = j i f f i e s _ 6 4 ;
# else
jiffies = j i f f i e s _ 6 4 + 4 ;
# endif
2005-10-29 21:44:56 +01:00
2006-01-03 17:28:33 +00:00
SECTIONS
{
2005-10-29 21:44:56 +01:00
# ifdef C O N F I G _ X I P _ K E R N E L
2006-01-03 17:28:33 +00:00
. = XIP_ V I R T _ A D D R ( C O N F I G _ X I P _ P H Y S _ A D D R ) ;
2005-10-29 21:44:56 +01:00
# else
2006-01-03 17:28:33 +00:00
. = PAGE_ O F F S E T + T E X T _ O F F S E T ;
2005-10-29 21:44:56 +01:00
# endif
2007-05-08 15:15:45 +01:00
.text .head : {
2005-04-16 15:20:36 -07:00
_ stext = . ;
2007-05-08 15:15:45 +01:00
_ sinittext = . ;
* ( .text .head )
}
.init : { /* Init code and data */
2008-01-20 14:15:03 +01:00
INIT_ T E X T
2007-05-08 15:15:45 +01:00
_ einittext = . ;
2005-04-16 15:20:36 -07:00
_ _ proc_ i n f o _ b e g i n = . ;
2005-09-20 16:35:03 +01:00
* ( .proc .info .init )
2005-04-16 15:20:36 -07:00
_ _ proc_ i n f o _ e n d = . ;
_ _ arch_ i n f o _ b e g i n = . ;
2005-09-20 16:45:20 +01:00
* ( .arch .info .init )
2005-04-16 15:20:36 -07:00
_ _ arch_ i n f o _ e n d = . ;
_ _ tagtable_ b e g i n = . ;
2005-09-20 16:20:49 +01:00
* ( .taglist .init )
2005-04-16 15:20:36 -07:00
_ _ tagtable_ e n d = . ;
. = ALIGN( 1 6 ) ;
_ _ setup_ s t a r t = . ;
* ( .init .setup )
_ _ setup_ e n d = . ;
_ _ early_ b e g i n = . ;
2005-09-20 16:25:12 +01:00
* ( .early_param .init )
2005-04-16 15:20:36 -07:00
_ _ early_ e n d = . ;
_ _ initcall_ s t a r t = . ;
2006-10-27 11:41:44 -07:00
INITCALLS
2005-04-16 15:20:36 -07:00
_ _ initcall_ e n d = . ;
_ _ con_ i n i t c a l l _ s t a r t = . ;
* ( .con_initcall .init )
_ _ con_ i n i t c a l l _ e n d = . ;
_ _ security_ i n i t c a l l _ s t a r t = . ;
* ( .security_initcall .init )
_ _ security_ i n i t c a l l _ e n d = . ;
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
2005-04-16 15:20:36 -07:00
. = ALIGN( 3 2 ) ;
_ _ initramfs_ s t a r t = . ;
usr/ b u i l t - i n . o ( . i n i t . r a m f s )
_ _ initramfs_ e n d = . ;
2007-02-10 01:44:44 -08:00
# endif
2009-06-24 23:38:56 +01:00
. = ALIGN( P A G E _ S I Z E ) ;
2009-03-10 16:27:48 +09:00
_ _ per_ c p u _ l o a d = . ;
2005-04-16 15:20:36 -07:00
_ _ per_ c p u _ s t a r t = . ;
2009-01-17 15:26:32 +09:00
* ( .data .percpu .page_aligned )
2005-04-16 15:20:36 -07:00
* ( .data .percpu )
2007-07-19 01:48:12 -07:00
* ( .data .percpu .shared_aligned )
2005-04-16 15:20:36 -07:00
_ _ per_ c p u _ e n d = . ;
# ifndef C O N F I G _ X I P _ K E R N E L
_ _ init_ b e g i n = _ s t e x t ;
2008-01-20 14:15:03 +01:00
INIT_ D A T A
2009-06-24 23:38:56 +01:00
. = ALIGN( P A G E _ S I Z E ) ;
2005-04-16 15:20:36 -07:00
_ _ init_ e n d = . ;
# endif
}
/ DISCARD/ : { / * E x i t c o d e a n d d a t a * /
2008-01-20 14:15:03 +01:00
EXIT_ T E X T
EXIT_ D A T A
2005-04-16 15:20:36 -07:00
* ( .exitcall .exit )
2009-06-24 15:13:38 +09:00
* ( .discard )
2009-02-16 11:41:36 +01:00
* ( .ARM .exidx .exit .text )
* ( .ARM .extab .exit .text )
2009-06-19 16:39:29 +01:00
# ifndef C O N F I G _ H O T P L U G _ C P U
* ( .ARM .exidx .cpuexit .text )
* ( .ARM .extab .cpuexit .text )
# endif
# ifndef C O N F I G _ H O T P L U G
* ( .ARM .exidx .devexit .text )
* ( .ARM .extab .devexit .text )
# endif
2006-06-21 20:38:17 +01:00
# ifndef C O N F I G _ M M U
* ( .fixup )
* ( _ _ ex_ t a b l e )
# endif
2005-04-16 15:20:36 -07:00
}
.text : { /* Real text segment */
_ text = . ; /* Text and read-only data */
2007-03-02 15:01:36 +00:00
_ _ exception_ t e x t _ s t a r t = . ;
* ( .exception .text )
_ _ exception_ t e x t _ e n d = . ;
2007-05-13 00:31:33 +02:00
TEXT_ T E X T
2005-04-16 15:20:36 -07:00
SCHED_ T E X T
LOCK_ T E X T
2007-12-03 15:27:56 -05:00
KPROBES_ T E X T
2006-06-21 20:38:17 +01:00
# ifdef C O N F I G _ M M U
2005-04-16 15:20:36 -07:00
* ( .fixup )
2006-06-21 20:38:17 +01:00
# endif
2005-04-16 15:20:36 -07:00
* ( .gnu .warning )
* ( .rodata )
* ( .rodata . * )
* ( .glue_7 )
* ( .glue_7t )
* ( .got ) /* Global offset table */
}
2009-06-24 23:38:56 +01:00
RO_ D A T A ( P A G E _ S I Z E )
2005-04-16 15:20:36 -07:00
_ etext = . ; /* End of text and rodata section */
2009-02-16 11:41:36 +01:00
# ifdef C O N F I G _ A R M _ U N W I N D
/ *
* Stack u n w i n d i n g t a b l e s
* /
. = ALIGN( 8 ) ;
.ARM .unwind_idx : {
_ _ start_ u n w i n d _ i d x = . ;
* ( .ARM .exidx * )
_ _ stop_ u n w i n d _ i d x = . ;
}
.ARM .unwind_tab : {
_ _ start_ u n w i n d _ t a b = . ;
* ( .ARM .extab * )
_ _ stop_ u n w i n d _ t a b = . ;
}
# endif
2005-04-16 15:20:36 -07:00
# ifdef C O N F I G _ X I P _ K E R N E L
_ _ data_ l o c = A L I G N ( 4 ) ; /* location in binary */
2006-01-03 17:28:33 +00:00
. = PAGE_ O F F S E T + T E X T _ O F F S E T ;
2005-04-16 15:20:36 -07:00
# else
2005-05-05 13:11:00 +01:00
. = ALIGN( T H R E A D _ S I Z E ) ;
2005-04-16 15:20:36 -07:00
_ _ data_ l o c = . ;
# endif
.data : AT( _ _ d a t a _ l o c ) {
2008-12-01 11:53:07 +00:00
_ data = . ; /* address in memory */
2009-05-30 14:00:17 +01:00
_ sdata = . ;
2005-04-16 15:20:36 -07:00
/ *
* first, t h e i n i t t a s k u n i o n , a l i g n e d
* to a n 8 1 9 2 b y t e b o u n d a r y .
* /
2007-05-08 12:39:37 +01:00
* ( .data .init_task )
2005-04-16 15:20:36 -07:00
# ifdef C O N F I G _ X I P _ K E R N E L
2009-06-24 23:38:56 +01:00
. = ALIGN( P A G E _ S I Z E ) ;
2005-04-16 15:20:36 -07:00
_ _ init_ b e g i n = . ;
2008-01-20 14:15:03 +01:00
INIT_ D A T A
2009-06-24 23:38:56 +01:00
. = ALIGN( P A G E _ S I Z E ) ;
2005-04-16 15:20:36 -07:00
_ _ init_ e n d = . ;
# endif
2009-06-24 23:38:56 +01:00
. = ALIGN( P A G E _ S I Z E ) ;
2005-04-16 15:20:36 -07:00
_ _ nosave_ b e g i n = . ;
* ( .data .nosave )
2009-06-24 23:38:56 +01:00
. = ALIGN( P A G E _ S I Z E ) ;
2005-04-16 15:20:36 -07:00
_ _ nosave_ e n d = . ;
/ *
* then t h e c a c h e l i n e a l i g n e d d a t a
* /
. = ALIGN( 3 2 ) ;
* ( .data .cacheline_aligned )
2005-10-13 22:04:37 +01:00
/ *
* The e x c e p t i o n f i x u p t a b l e ( m i g h t n e e d r e s o r t i n g a t r u n t i m e )
* /
. = ALIGN( 3 2 ) ;
_ _ start_ _ _ e x _ t a b l e = . ;
2006-06-21 20:38:17 +01:00
# ifdef C O N F I G _ M M U
2005-10-13 22:04:37 +01:00
* ( _ _ ex_ t a b l e )
2006-06-21 20:38:17 +01:00
# endif
2005-10-13 22:04:37 +01:00
_ _ stop_ _ _ e x _ t a b l e = . ;
2005-04-16 15:20:36 -07:00
/ *
* and t h e u s u a l d a t a s e c t i o n
* /
2007-05-17 13:38:44 +02:00
DATA_ D A T A
2005-04-16 15:20:36 -07:00
CONSTRUCTORS
_ edata = . ;
}
2007-02-22 16:18:09 +01:00
_ edata_ l o c = _ _ d a t a _ l o c + S I Z E O F ( . d a t a ) ;
2005-04-16 15:20:36 -07:00
2009-09-15 17:30:37 +01:00
# ifdef C O N F I G _ H A V E _ T C M
/ *
* We a l i g n e v e r y t h i n g t o a p a g e b o u n d a r y s o w e c a n
* free i t a f t e r i n i t h a s c o m m e n c e d a n d T C M c o n t e n t s h a v e
* been c o p i e d t o i t s d e s t i n a t i o n .
* /
.tcm_start : {
. = ALIGN( P A G E _ S I Z E ) ;
_ _ tcm_ s t a r t = . ;
_ _ itcm_ s t a r t = . ;
}
/ *
* Link t h e s e t o t h e I T C M R A M
* Put V M A t o t h e T C M a d d r e s s a n d L M A t o t h e c o m m o n R A M
* and w e ' l l u p l o a d t h e c o n t e n t s f r o m R A M t o T C M a n d f r e e
* the u s e d R A M a f t e r t h a t .
* /
.text_itcm ITCM_OFFSET : AT( _ _ i t c m _ s t a r t )
{
_ _ sitcm_ t e x t = . ;
* ( .tcm .text )
* ( .tcm .rodata )
. = ALIGN( 4 ) ;
_ _ eitcm_ t e x t = . ;
}
/ *
* Reset t h e d o t p o i n t e r , t h i s i s n e e d e d t o c r e a t e t h e
* relative _ _ d t c m _ s t a r t b e l o w ( t o b e u s e d a s e x t e r n i n c o d e ) .
* /
. = ADDR( . t c m _ s t a r t ) + S I Z E O F ( . t c m _ s t a r t ) + S I Z E O F ( . t e x t _ i t c m ) ;
.dtcm_start : {
_ _ dtcm_ s t a r t = . ;
}
/* TODO: add remainder of ITCM as well, that can be used for data! */
.data_dtcm DTCM_OFFSET : AT( _ _ d t c m _ s t a r t )
{
. = ALIGN( 4 ) ;
_ _ sdtcm_ d a t a = . ;
* ( .tcm .data )
. = ALIGN( 4 ) ;
_ _ edtcm_ d a t a = . ;
}
/* Reset the dot pointer or the linker gets confused */
. = ADDR( . d t c m _ s t a r t ) + S I Z E O F ( . d a t a _ d t c m ) ;
/* End marker for freeing TCM copy in linked object */
.tcm_end : AT( A D D R ( . d t c m _ s t a r t ) + S I Z E O F ( . d a t a _ d t c m ) ) {
. = ALIGN( P A G E _ S I Z E ) ;
_ _ tcm_ e n d = . ;
}
# endif
2005-04-16 15:20:36 -07:00
.bss : {
_ _ bss_ s t a r t = . ; /* BSS */
* ( .bss )
* ( COMMON)
2009-05-30 14:00:17 +01:00
_ _ bss_ s t o p = . ;
2005-04-16 15:20:36 -07:00
_ end = . ;
}
/* Stabs debugging sections. */
.stab 0 : { * ( .stab ) }
.stabstr 0 : { * ( .stabstr ) }
.stab .excl 0 : { * ( .stab .excl ) }
.stab .exclstr 0 : { * ( .stab .exclstr ) }
.stab .index 0 : { * ( .stab .index ) }
.stab .indexstr 0 : { * ( .stab .indexstr ) }
.comment 0 : { * ( .comment ) }
}
2005-11-17 16:43:14 +00:00
/ *
* These m u s t n e v e r b e e m p t y
* If y o u h a v e t o c o m m e n t t h e s e t w o a s s e r t s t a t e m e n t s o u t , y o u r
* binutils i s t o o o l d ( f o r o t h e r r e a s o n s a s w e l l )
* /
2005-04-16 15:20:36 -07:00
ASSERT( ( _ _ p r o c _ i n f o _ e n d - _ _ p r o c _ i n f o _ b e g i n ) , " m i s s i n g C P U s u p p o r t " )
ASSERT( ( _ _ a r c h _ i n f o _ e n d - _ _ a r c h _ i n f o _ b e g i n ) , " n o m a c h i n e r e c o r d d e f i n e d " )