2005-06-23 22:01:16 -07:00
/ *
* arch/ x t e n s a / k e r n e l / v m l i n u x . l d s . S
*
* Xtensa l i n k e r s c r i p t
*
* 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 .
*
* Copyright ( C ) 2 0 0 1 - 2 0 0 5 T e n s i l i c a I n c .
*
* Chris Z a n k e l < c h r i s @zankel.net>
* Marc G a u t h i e r < m a r c @tensilica.com, marc@alumni.uwaterloo.ca>
* Joe T a y l o r < j o e @tensilica.com, joetylr@yahoo.com>
* /
# include < a s m - g e n e r i c / v m l i n u x . l d s . h >
2006-12-10 02:18:48 -08:00
# include < a s m / v a r i a n t / c o r e . h >
2005-06-23 22:01:16 -07:00
OUTPUT_ A R C H ( x t e n s a )
ENTRY( _ s t a r t )
2006-12-10 02:18:48 -08:00
# ifdef _ _ X T E N S A _ E B _ _
2005-06-23 22:01:16 -07:00
jiffies = j i f f i e s _ 6 4 + 4 ;
# else
jiffies = j i f f i e s _ 6 4 ;
# endif
2006-12-10 02:18:48 -08:00
# define K E R N E L O F F S E T 0 x d00 0 1 0 0 0
2005-06-23 22:01:16 -07:00
/ * Note : In t h e f o l l o w i n g m a c r o s , i t w o u l d b e n i c e t o s p e c i f y o n l y t h e
vector n a m e a n d s e c t i o n k i n d a n d c o n s t r u c t " s y m " a n d " s e c t i o n " u s i n g
CPP c o n c a t e n a t i o n , b u t t h a t d o e s n o t w o r k r e l i a b l y . C o n c a t e n a t i n g a
string w i t h " . " p r o d u c e s a n i n v a l i d t o k e n . C P P w i l l n o t p r i n t a
warning b e c a u s e i t t h i n k s t h i s i s a n a s s e m b l y f i l e , b u t i t l e a v e s
them a s m u l t i p l e t o k e n s a n d t h e r e m a y o r m a y n o t b e w h i t e s p a c e
between t h e m . * /
/* Macro for a relocation entry */
# define R E L O C A T E _ E N T R Y ( s y m , s e c t i o n ) \
LONG( s y m ## _ s t a r t ) ; \
LONG( s y m ## _ e n d ) ; \
LONG( L O A D A D D R ( s e c t i o n ) )
/ * Macro t o d e f i n e a s e c t i o n f o r a v e c t o r .
*
* Use o f t h e M I N f u n c t i o n c a t c h e s t h e t y p e s o f e r r o r s i l l u s t r a t e d i n
* the f o l l o w i n g e x a m p l e :
*
* Assume t h e s e c t i o n . D o u b l e E x c e p t i o n V e c t o r . l i t e r a l i s c o m p l e t e l y
* full. T h e n a p r o g r a m m e r a d d s c o d e t o . D o u b l e E x c e p t i o n V e c t o r . t e x t
* that p r o d u c e s a n o t h e r l i t e r a l . T h e f i n a l l i t e r a l p o s i t i o n w i l l
* overlay o n t o t h e f i r s t w o r d o f t h e a d j a c e n t c o d e s e c t i o n
* .DoubleExceptionVector .text . ( In p r a c t i c e , t h e l i t e r a l s w i l l
* overwrite t h e c o d e , a n d t h e f i r s t f e w i n s t r u c t i o n s w i l l b e
* garbage. )
* /
# define S E C T I O N _ V E C T O R ( s y m , s e c t i o n , a d d r , m a x _ p r e v s e c _ s i z e , p r e v s e c ) \
section a d d r : A T ( ( M I N ( L O A D A D D R ( p r e v s e c ) + m a x _ p r e v s e c _ s i z e , \
LOADADDR( p r e v s e c ) + S I Z E O F ( p r e v s e c ) ) + 3 ) & ~ 3 ) \
{ \
. = ALIGN( 4 ) ; \
sym ## _ s t a r t = A B S O L U T E ( . ) ; \
* ( section) \
sym ## _ e n d = A B S O L U T E ( . ) ; \
}
/ *
* Mapping o f i n p u t s e c t i o n s t o o u t p u t s e c t i o n s w h e n l i n k i n g .
* /
SECTIONS
{
2006-12-10 02:18:48 -08:00
. = KERNELOFFSET;
2005-06-23 22:01:16 -07:00
/* .text section */
_ text = . ;
_ stext = . ;
_ ftext = . ;
.text :
{
/* The .head.text section must be the first section! */
* ( .head .text )
2007-05-31 17:47:01 -07:00
* ( .literal .text )
2005-06-23 22:01:16 -07:00
VMLINUX_ S Y M B O L ( _ _ s c h e d _ t e x t _ s t a r t ) = . ;
2005-07-12 13:58:25 -07:00
* ( .sched .literal .sched .text )
2005-06-23 22:01:16 -07:00
VMLINUX_ S Y M B O L ( _ _ s c h e d _ t e x t _ e n d ) = . ;
VMLINUX_ S Y M B O L ( _ _ l o c k _ t e x t _ s t a r t ) = . ;
2005-07-12 13:58:25 -07:00
* ( .spinlock .literal .spinlock .text )
2005-06-23 22:01:16 -07:00
VMLINUX_ S Y M B O L ( _ _ l o c k _ t e x t _ e n d ) = . ;
}
_ etext = . ;
2007-05-31 17:47:01 -07:00
PROVIDE ( e t e x t = . ) ;
2005-06-23 22:01:16 -07:00
. = ALIGN( 1 6 ) ;
RODATA
/* Relocation table */
.fixup : { * ( .fixup ) }
. = ALIGN( 1 6 ) ;
_ _ ex_ t a b l e : {
_ _ start_ _ _ e x _ t a b l e = . ;
* ( _ _ ex_ t a b l e )
_ _ stop_ _ _ e x _ t a b l e = . ;
}
/* Data section */
. = ALIGN( X C H A L _ I C A C H E _ L I N E S I Z E ) ;
_ fdata = . ;
.data :
{
2007-06-16 22:29:39 -04:00
DATA_ D A T A
CONSTRUCTORS
2005-06-23 22:01:16 -07:00
. = ALIGN( X C H A L _ I C A C H E _ L I N E S I Z E ) ;
* ( .data .cacheline_aligned )
}
_ edata = . ;
/* The initial task */
. = ALIGN( 8 1 9 2 ) ;
.data .init_task : { * ( .data .init_task ) }
/* Initialization code and data: */
2006-12-10 02:18:48 -08:00
. = ALIGN( 1 < < 1 2 ) ;
2005-06-23 22:01:16 -07:00
_ _ init_ b e g i n = . ;
.init .text : {
_ sinittext = . ;
2005-07-12 13:58:25 -07:00
* ( .init .literal ) * ( .init .text )
2005-06-23 22:01:16 -07:00
_ einittext = . ;
}
.init .data :
{
* ( .init .data )
. = ALIGN( 0 x4 ) ;
_ _ tagtable_ b e g i n = . ;
* ( .taglist )
_ _ tagtable_ e n d = . ;
2007-05-31 17:47:01 -07:00
. = ALIGN( 1 6 ) ;
_ _ boot_ r e l o c _ t a b l e _ s t a r t = A B S O L U T E ( . ) ;
RELOCATE_ E N T R Y ( _ W i n d o w V e c t o r s _ t e x t ,
.WindowVectors .text ) ;
RELOCATE_ E N T R Y ( _ K e r n e l E x c e p t i o n V e c t o r _ t e x t ,
.KernelExceptionVector .text ) ;
RELOCATE_ E N T R Y ( _ U s e r E x c e p t i o n V e c t o r _ t e x t ,
.UserExceptionVector .text ) ;
RELOCATE_ E N T R Y ( _ D o u b l e E x c e p t i o n V e c t o r _ l i t e r a l ,
.DoubleExceptionVector .literal ) ;
RELOCATE_ E N T R Y ( _ D o u b l e E x c e p t i o n V e c t o r _ t e x t ,
.DoubleExceptionVector .text ) ;
_ _ boot_ r e l o c _ t a b l e _ e n d = A B S O L U T E ( . ) ;
2005-06-23 22:01:16 -07:00
}
. = ALIGN( X C H A L _ I C A C H E _ L I N E S I Z E ) ;
_ _ setup_ s t a r t = . ;
.init .setup : { * ( .init .setup ) }
_ _ setup_ e n d = . ;
_ _ initcall_ s t a r t = . ;
.initcall .init : {
2006-10-27 11:41:44 -07:00
INITCALLS
2005-06-23 22:01:16 -07:00
}
_ _ initcall_ e n d = . ;
_ _ con_ i n i t c a l l _ s t a r t = . ;
.con_initcall .init : { * ( .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
2005-06-23 22:01:16 -07:00
. = ALIGN( 4 0 9 6 ) ;
_ _ initramfs_ s t a r t = . ;
.init .ramfs : { * ( .init .ramfs ) }
_ _ initramfs_ e n d = . ;
2007-02-10 01:44:44 -08:00
# endif
2005-06-23 22:01:16 -07:00
2007-07-19 01:48:12 -07:00
PERCPU( 4 0 9 6 )
2007-05-31 17:47:01 -07:00
2005-06-23 22:01:16 -07:00
/* We need this dummy segment here */
. = ALIGN( 4 ) ;
.dummy : { LONG( 0 ) }
/* The vectors are relocated to the real position at startup time */
SECTION_ V E C T O R ( _ W i n d o w V e c t o r s _ t e x t ,
.WindowVectors .text ,
XCHAL_ W I N D O W _ V E C T O R S _ V A D D R , 4 ,
.dummy )
SECTION_ V E C T O R ( _ D e b u g I n t e r r u p t V e c t o r _ l i t e r a l ,
.DebugInterruptVector .literal ,
2006-12-10 02:18:48 -08:00
XCHAL_ D E B U G _ V E C T O R _ V A D D R - 4 ,
2005-06-23 22:01:16 -07:00
SIZEOF( . W i n d o w V e c t o r s . t e x t ) ,
.WindowVectors .text )
SECTION_ V E C T O R ( _ D e b u g I n t e r r u p t V e c t o r _ t e x t ,
.DebugInterruptVector .text ,
2006-12-10 02:18:48 -08:00
XCHAL_ D E B U G _ V E C T O R _ V A D D R ,
2005-06-23 22:01:16 -07:00
4 ,
.DebugInterruptVector .literal )
SECTION_ V E C T O R ( _ K e r n e l E x c e p t i o n V e c t o r _ l i t e r a l ,
.KernelExceptionVector .literal ,
2006-12-10 02:18:48 -08:00
XCHAL_ K E R N E L _ V E C T O R _ V A D D R - 4 ,
2005-06-23 22:01:16 -07:00
SIZEOF( . D e b u g I n t e r r u p t V e c t o r . t e x t ) ,
.DebugInterruptVector .text )
SECTION_ V E C T O R ( _ K e r n e l E x c e p t i o n V e c t o r _ t e x t ,
.KernelExceptionVector .text ,
2006-12-10 02:18:48 -08:00
XCHAL_ K E R N E L _ V E C T O R _ V A D D R ,
2005-06-23 22:01:16 -07:00
4 ,
.KernelExceptionVector .literal )
SECTION_ V E C T O R ( _ U s e r E x c e p t i o n V e c t o r _ l i t e r a l ,
.UserExceptionVector .literal ,
2006-12-10 02:18:48 -08:00
XCHAL_ U S E R _ V E C T O R _ V A D D R - 4 ,
2005-06-23 22:01:16 -07:00
SIZEOF( . K e r n e l E x c e p t i o n V e c t o r . t e x t ) ,
.KernelExceptionVector .text )
SECTION_ V E C T O R ( _ U s e r E x c e p t i o n V e c t o r _ t e x t ,
.UserExceptionVector .text ,
2006-12-10 02:18:48 -08:00
XCHAL_ U S E R _ V E C T O R _ V A D D R ,
2005-06-23 22:01:16 -07:00
4 ,
.UserExceptionVector .literal )
SECTION_ V E C T O R ( _ D o u b l e E x c e p t i o n V e c t o r _ l i t e r a l ,
.DoubleExceptionVector .literal ,
XCHAL_ D O U B L E E X C _ V E C T O R _ V A D D R - 1 6 ,
SIZEOF( . U s e r E x c e p t i o n V e c t o r . t e x t ) ,
.UserExceptionVector .text )
SECTION_ V E C T O R ( _ D o u b l e E x c e p t i o n V e c t o r _ t e x t ,
.DoubleExceptionVector .text ,
XCHAL_ D O U B L E E X C _ V E C T O R _ V A D D R ,
3 2 ,
.DoubleExceptionVector .literal )
. = ( LOADADDR( . D o u b l e E x c e p t i o n V e c t o r . t e x t ) + S I Z E O F ( . D o u b l e E x c e p t i o n V e c t o r . t e x t ) + 3 ) & ~ 3 ;
2006-12-10 02:18:48 -08:00
. = ALIGN( 1 < < 1 2 ) ;
2005-06-23 22:01:16 -07:00
_ _ init_ e n d = . ;
. = ALIGN( 8 1 9 2 ) ;
/* BSS section */
_ bss_ s t a r t = . ;
2007-05-31 17:47:01 -07:00
.bss : { * ( .bss .page_aligned ) * ( .bss ) }
2005-06-23 22:01:16 -07:00
_ bss_ e n d = . ;
2007-05-31 17:47:01 -07:00
2005-06-23 22:01:16 -07:00
_ end = . ;
/* only used by the boot loader */
. = ALIGN( 0 x10 ) ;
.bootstrap : { * ( .bootstrap .literal .bootstrap .text .bootstrap .data ) }
. = ALIGN( 0 x10 0 0 ) ;
_ _ initrd_ s t a r t = . ;
.initrd : { * ( .initrd ) }
_ _ initrd_ e n d = . ;
.ResetVector .text XCHAL_RESET_VECTOR_VADDR :
{
* ( .ResetVector .text )
}
/* Sections to be discarded */
/ DISCARD/ :
{
2007-05-31 17:47:01 -07:00
* ( .exit .literal .exit .text )
* ( .exit .data )
2005-06-23 22:01:16 -07:00
* ( .exitcall .exit )
}
2007-05-31 17:47:01 -07:00
.xt .lit : { * ( .xt .lit ) }
.xt .prop : { * ( .xt .prop ) }
2005-06-23 22:01:16 -07:00
.debug 0 : { * ( .debug ) }
.line 0 : { * ( .line ) }
.debug_srcinfo 0 : { * ( .debug_srcinfo ) }
.debug_sfnames 0 : { * ( .debug_sfnames ) }
.debug_aranges 0 : { * ( .debug_aranges ) }
.debug_pubnames 0 : { * ( .debug_pubnames ) }
.debug_info 0 : { * ( .debug_info ) }
.debug_abbrev 0 : { * ( .debug_abbrev ) }
.debug_line 0 : { * ( .debug_line ) }
.debug_frame 0 : { * ( .debug_frame ) }
.debug_str 0 : { * ( .debug_str ) }
.debug_loc 0 : { * ( .debug_loc ) }
.debug_macinfo 0 : { * ( .debug_macinfo ) }
.debug_weaknames 0 : { * ( .debug_weaknames ) }
.debug_funcnames 0 : { * ( .debug_funcnames ) }
.debug_typenames 0 : { * ( .debug_typenames ) }
.debug_varnames 0 : { * ( .debug_varnames ) }
.xt .insn 0 :
{
* ( .xt .insn )
* ( .gnu .linkonce .x * )
}
.xt .lit 0 :
{
* ( .xt .lit )
* ( .gnu .linkonce .p * )
}
}