2005-04-16 15:20:36 -07:00
/ * ld s c r i p t t o m a k e i 3 8 6 L i n u x k e r n e l
* Written b y M a r t i n M a r e s < m j @atrey.karlin.mff.cuni.cz>;
2006-12-07 02:14:03 +01:00
*
* Don' t d e f i n e a b s o l u t e s y m b o l s u n t i l a n d u n l e s s y o u k n o w t h a t s y m b o l
* value i s s h o u l d r e m a i n c o n s t a n t e v e n i f k e r n e l i m a g e i s r e l o c a t e d
* at r u n t i m e . A b s o l u t e s y m b o l s a r e n o t r e l o c a t e d . I f s y m b o l v a l u e s h o u l d
* change i f k e r n e l i s r e l o c a t e d , m a k e t h e s y m b o l s e c t i o n r e l a t i v e a n d
* put i t i n s i d e t h e s e c t i o n d e f i n i t i o n .
2005-04-16 15:20:36 -07:00
* /
2006-12-07 02:14:10 +01:00
/ * Don' t d e f i n e a b s o l u t e s y m b o l s u n t i l a n d u n l e s s y o u k n o w t h a t s y m b o l
* value i s s h o u l d r e m a i n c o n s t a n t e v e n i f k e r n e l i m a g e i s r e l o c a t e d
* at r u n t i m e . A b s o l u t e s y m b o l s a r e n o t r e l o c a t e d . I f s y m b o l v a l u e s h o u l d
* change i f k e r n e l i s r e l o c a t e d , m a k e t h e s y m b o l s e c t i o n r e l a t i v e a n d
* put i t i n s i d e t h e s e c t i o n d e f i n i t i o n .
* /
2005-06-25 14:57:47 -07:00
# define L O A D _ O F F S E T _ _ 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 >
# include < a s m / t h r e a d _ i n f o . h >
# include < a s m / p a g e . h >
2006-01-27 14:02:47 -08:00
# include < a s m / c a c h e . h >
2006-12-07 02:14:04 +01:00
# include < a s m / b o o t . h >
2005-04-16 15:20:36 -07:00
OUTPUT_ F O R M A T ( " e l f32 - i 3 8 6 " , " e l f32 - i 3 8 6 " , " e l f32 - i 3 8 6 " )
OUTPUT_ A R C H ( i 3 8 6 )
2005-06-25 14:57:47 -07:00
ENTRY( p h y s _ s t a r t u p _ 3 2 )
2005-04-16 15:20:36 -07:00
jiffies = j i f f i e s _ 6 4 ;
2007-04-16 10:30:27 +02:00
_ proxy_ p d a = 1 ;
2006-09-25 23:32:26 -07:00
PHDRS {
text P T _ L O A D F L A G S ( 5 ) ; /* R_E */
data P T _ L O A D F L A G S ( 7 ) ; /* RWE */
note P T _ N O T E F L A G S ( 4 ) ; /* R__ */
}
2005-04-16 15:20:36 -07:00
SECTIONS
{
2006-12-07 02:14:04 +01:00
. = LOAD_ O F F S E T + L O A D _ P H Y S I C A L _ A D D R ;
2005-06-25 14:57:47 -07:00
phys_ s t a r t u p _ 3 2 = s t a r t u p _ 3 2 - L O A D _ O F F S E T ;
2007-02-13 13:26:22 +01:00
.text .head : AT( A D D R ( . t e x t . h e a d ) - L O A D _ O F F S E T ) {
_ text = . ; /* Text and read-only data */
* ( .text .head )
} : text = 0 x90 9 0
2005-04-16 15:20:36 -07:00
/* read-only */
2005-06-25 14:57:47 -07:00
.text : AT( A D D R ( . t e x t ) - L O A D _ O F F S E T ) {
2005-04-16 15:20:36 -07:00
* ( .text )
SCHED_ T E X T
LOCK_ T E X T
2005-09-06 15:19:27 -07:00
KPROBES_ T E X T
2005-04-16 15:20:36 -07:00
* ( .fixup )
* ( .gnu .warning )
2006-12-07 02:14:03 +01:00
_ etext = . ; /* End of text section */
} : text = 0 x90 9 0
2005-04-16 15:20:36 -07:00
. = ALIGN( 1 6 ) ; /* Exception table */
2006-12-07 02:14:03 +01:00
_ _ ex_ t a b l e : A T ( A D D R ( _ _ e x _ t a b l e ) - L O A D _ O F F S E T ) {
_ _ start_ _ _ e x _ t a b l e = . ;
* ( _ _ ex_ t a b l e )
_ _ stop_ _ _ e x _ t a b l e = . ;
}
2005-04-16 15:20:36 -07:00
RODATA
2006-12-08 02:36:21 -08:00
BUG_ T A B L E
2006-06-24 14:27:42 -07:00
. = ALIGN( 4 ) ;
.tracedata : AT( A D D R ( . t r a c e d a t a ) - L O A D _ O F F S E T ) {
2006-12-07 02:14:03 +01:00
_ _ tracedata_ s t a r t = . ;
2006-06-24 14:27:42 -07:00
* ( .tracedata )
2006-12-07 02:14:03 +01:00
_ _ tracedata_ e n d = . ;
2006-06-24 14:27:42 -07:00
}
2005-04-16 15:20:36 -07:00
/* writeable */
2006-11-08 17:44:41 -08:00
. = ALIGN( 4 0 9 6 ) ;
2005-06-25 14:57:47 -07:00
.data : AT( A D D R ( . d a t a ) - L O A D _ O F F S E T ) { / * D a t a * /
2005-04-16 15:20:36 -07:00
* ( .data )
CONSTRUCTORS
2006-09-25 23:32:26 -07:00
} : data
2005-04-16 15:20:36 -07:00
2006-12-07 02:14:08 +01:00
.paravirtprobe : AT( A D D R ( . p a r a v i r t p r o b e ) - L O A D _ O F F S E T ) {
2006-12-07 02:14:10 +01:00
_ _ start_ p a r a v i r t p r o b e = . ;
2006-12-07 02:14:08 +01:00
* ( .paravirtprobe )
2006-12-07 02:14:10 +01:00
_ _ stop_ p a r a v i r t p r o b e = . ;
2006-12-07 02:14:08 +01:00
}
2005-04-16 15:20:36 -07:00
. = ALIGN( 4 0 9 6 ) ;
2006-12-07 02:14:03 +01:00
.data_nosave : AT( A D D R ( . d a t a _ n o s a v e ) - L O A D _ O F F S E T ) {
_ _ nosave_ b e g i n = . ;
* ( .data .nosave )
. = ALIGN( 4 0 9 6 ) ;
_ _ nosave_ e n d = . ;
}
2005-04-16 15:20:36 -07:00
. = ALIGN( 4 0 9 6 ) ;
2005-06-25 14:57:47 -07:00
.data .page_aligned : AT( A D D R ( . d a t a . p a g e _ a l i g n e d ) - L O A D _ O F F S E T ) {
* ( .data .idt )
}
2005-04-16 15:20:36 -07:00
. = ALIGN( 3 2 ) ;
2005-06-25 14:57:47 -07:00
.data .cacheline_aligned : AT( A D D R ( . d a t a . c a c h e l i n e _ a l i g n e d ) - L O A D _ O F F S E T ) {
* ( .data .cacheline_aligned )
}
2005-04-16 15:20:36 -07:00
2005-07-07 17:56:59 -07:00
/* rarely changed data like cpu maps */
. = ALIGN( 3 2 ) ;
2006-12-07 02:14:03 +01:00
.data .read_mostly : AT( A D D R ( . d a t a . r e a d _ m o s t l y ) - L O A D _ O F F S E T ) {
* ( .data .read_mostly )
_ edata = . ; /* End of data section */
}
2005-04-16 15:20:36 -07:00
. = ALIGN( T H R E A D _ S I Z E ) ; /* init_task */
2005-06-25 14:57:47 -07:00
.data .init_task : AT( A D D R ( . d a t a . i n i t _ t a s k ) - L O A D _ O F F S E T ) {
* ( .data .init_task )
}
2005-04-16 15:20:36 -07:00
2006-03-23 02:59:32 -08:00
/* might get freed after init */
. = ALIGN( 4 0 9 6 ) ;
.smp_altinstructions : AT( A D D R ( . s m p _ a l t i n s t r u c t i o n s ) - L O A D _ O F F S E T ) {
2006-12-07 02:14:03 +01:00
_ _ smp_ a l t _ b e g i n = . ;
_ _ smp_ a l t _ i n s t r u c t i o n s = . ;
2006-03-23 02:59:32 -08:00
* ( .smp_altinstructions )
2006-12-07 02:14:03 +01:00
_ _ smp_ a l t _ i n s t r u c t i o n s _ e n d = . ;
2006-03-23 02:59:32 -08:00
}
. = ALIGN( 4 ) ;
.smp_locks : AT( A D D R ( . s m p _ l o c k s ) - L O A D _ O F F S E T ) {
2006-12-07 02:14:03 +01:00
_ _ smp_ l o c k s = . ;
2006-03-23 02:59:32 -08:00
* ( .smp_locks )
2006-12-07 02:14:03 +01:00
_ _ smp_ l o c k s _ e n d = . ;
2006-03-23 02:59:32 -08:00
}
.smp_altinstr_replacement : AT( A D D R ( . s m p _ a l t i n s t r _ r e p l a c e m e n t ) - L O A D _ O F F S E T ) {
* ( .smp_altinstr_replacement )
2006-12-07 02:14:03 +01:00
_ _ smp_ a l t _ e n d = . ;
2006-03-23 02:59:32 -08:00
}
2006-12-07 02:14:03 +01:00
/ * will b e f r e e d a f t e r i n i t
* Following A L I G N ( ) i s r e q u i r e d t o m a k e s u r e n o o t h e r d a t a f a l l s o n t h e
* same p a g e w h e r e _ _ s m p _ a l t _ e n d i s p o i n t i n g a s t h a t p a g e m i g h t b e f r e e d
* after b o o t . A l w a y s m a k e s u r e t h a t A L I G N ( ) d i r e c t i v e i s p r e s e n t a f t e r
* the s e c t i o n w h i c h c o n t a i n s _ _ s m p _ a l t _ e n d .
* /
2006-03-23 02:59:32 -08:00
. = ALIGN( 4 0 9 6 ) ;
2005-04-16 15:20:36 -07:00
/* will be freed after init */
. = ALIGN( 4 0 9 6 ) ; /* Init code and data */
2005-06-25 14:57:47 -07:00
.init .text : AT( A D D R ( . i n i t . t e x t ) - L O A D _ O F F S E T ) {
2006-12-07 02:14:03 +01:00
_ _ init_ b e g i n = . ;
2005-04-16 15:20:36 -07:00
_ sinittext = . ;
* ( .init .text )
_ einittext = . ;
}
2005-06-25 14:57:47 -07: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 ) { * ( . i n i t . d a t a ) }
2005-04-16 15:20:36 -07:00
. = ALIGN( 1 6 ) ;
2006-12-07 02:14:03 +01: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 ) {
_ _ setup_ s t a r t = . ;
* ( .init .setup )
_ _ setup_ e n d = . ;
}
2005-06-25 14:57:47 -07: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 ) {
2006-12-07 02:14:03 +01:00
_ _ initcall_ s t a r t = . ;
2006-10-27 11:41:44 -07:00
INITCALLS
2006-12-07 02:14:03 +01:00
_ _ initcall_ e n d = . ;
2005-04-16 15:20:36 -07:00
}
2005-06-25 14:57:47 -07: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 ) {
2006-12-07 02:14:03 +01:00
_ _ con_ i n i t c a l l _ s t a r t = . ;
2005-06-25 14:57:47 -07:00
* ( .con_initcall .init )
2006-12-07 02:14:03 +01:00
_ _ con_ i n i t c a l l _ e n d = . ;
2005-06-25 14:57:47 -07:00
}
2005-04-16 15:20:36 -07:00
SECURITY_ I N I T
. = ALIGN( 4 ) ;
2005-06-25 14:57:47 -07:00
.altinstructions : AT( A D D R ( . a l t i n s t r u c t i o n s ) - L O A D _ O F F S E T ) {
2006-12-07 02:14:03 +01:00
_ _ alt_ i n s t r u c t i o n s = . ;
2005-06-25 14:57:47 -07:00
* ( .altinstructions )
2006-12-07 02:14:03 +01:00
_ _ alt_ i n s t r u c t i o n s _ e n d = . ;
2005-06-25 14:57:47 -07:00
}
.altinstr_replacement : AT( A D D R ( . a l t i n s t r _ r e p l a c e m e n t ) - L O A D _ O F F S E T ) {
* ( .altinstr_replacement )
}
2006-12-07 02:14:08 +01:00
. = ALIGN( 4 ) ;
.parainstructions : AT( A D D R ( . p a r a i n s t r u c t i o n s ) - L O A D _ O F F S E T ) {
2006-12-07 02:14:10 +01:00
_ _ start_ p a r a i n s t r u c t i o n s = . ;
2006-12-07 02:14:08 +01:00
* ( .parainstructions )
2006-12-07 02:14:10 +01:00
_ _ stop_ p a r a i n s t r u c t i o n s = . ;
2006-12-07 02:14:08 +01:00
}
2005-04-16 15:20:36 -07:00
/ * .exit .text is discard 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 r e f e r e n c e s
from . a l t i n s t r u c t i o n s a n d . e h _ f r a m e * /
2005-06-25 14:57:47 -07:00
.exit .text : AT( A D D R ( . e x i t . t e x t ) - L O A D _ O F F S E T ) { * ( . e x i t . t e x t ) }
.exit .data : AT( A D D R ( . e x i t . d a t a ) - L O A D _ O F F S E T ) { * ( . e x i t . d a t a ) }
2007-02-10 01:44:44 -08:00
# if d e f i n e d ( 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( 4 0 9 6 ) ;
2006-12-07 02:14:03 +01: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 ) {
_ _ initramfs_ s t a r t = . ;
* ( .init .ramfs )
_ _ initramfs_ e n d = . ;
}
2007-02-10 01:44:44 -08:00
# endif
2006-01-27 14:02:47 -08:00
. = ALIGN( L 1 _ C A C H E _ B Y T E S ) ;
2006-12-07 02:14:03 +01:00
.data .percpu : AT( A D D R ( . d a t a . p e r c p u ) - L O A D _ O F F S E T ) {
_ _ per_ c p u _ s t a r t = . ;
* ( .data .percpu )
_ _ per_ c p u _ e n d = . ;
}
2005-04-16 15:20:36 -07:00
. = ALIGN( 4 0 9 6 ) ;
/* freed after init ends here */
2005-06-25 14:57:47 -07:00
.bss : AT( A D D R ( . b s s ) - L O A D _ O F F S E T ) {
2006-12-07 02:14:03 +01:00
_ _ init_ e n d = . ;
_ _ bss_ s t a r t = . ; /* BSS */
* ( .bss .page_aligned )
2005-04-16 15:20:36 -07:00
* ( .bss )
2006-12-07 02:14:03 +01:00
. = ALIGN( 4 ) ;
_ _ bss_ s t o p = . ;
_ end = . ;
/* This is where the kernel creates the early boot page tables */
. = ALIGN( 4 0 9 6 ) ;
pg0 = . ;
2005-04-16 15:20:36 -07:00
}
/* Sections to be discarded */
/ DISCARD/ : {
* ( .exitcall .exit )
}
2005-09-10 19:44:54 +02:00
STABS_ D E B U G
DWARF_ D E B U G
2006-09-25 23:32:26 -07:00
NOTES
2005-04-16 15:20:36 -07:00
}