2005-04-16 15:20:36 -07:00
/ *
2007-10-15 20:40:29 -07:00
* Linker s c r i p t f o r g a t e D S O . T h e g a t e p a g e s a r e a n E L F s h a r e d o b j e c t
* prelinked t o i t s v i r t u a l a d d r e s s , w i t h o n l y o n e r e a d - o n l y s e g m e n t a n d
* one e x e c u t e - o n l y s e g m e n t ( b o t h f i t i n o n e p a g e ) . T h i s s c r i p t c o n t r o l s
* its l a y o u t .
2005-04-16 15:20:36 -07:00
* /
2012-03-28 18:30:02 +01:00
# include < a s m / p a g e . h >
2009-03-04 21:05:42 +09:00
# include " p a r a v i r t _ p a t c h l i s t . h "
2005-04-16 15:20:36 -07:00
SECTIONS
{
2007-10-15 20:40:29 -07:00
. = GATE_ A D D R + S I Z E O F _ H E A D E R S ;
.hash : { * ( .hash ) } : readable
.gnu .hash : { * ( .gnu .hash ) }
.dynsym : { * ( .dynsym ) }
.dynstr : { * ( .dynstr ) }
.gnu .version : { * ( .gnu .version ) }
.gnu .version_d : { * ( .gnu .version_d ) }
.gnu .version_r : { * ( .gnu .version_r ) }
2007-10-18 15:11:08 -07:00
.note : { * ( .note * ) } : readable : n o t e
2007-10-15 20:40:29 -07:00
.dynamic : { * ( .dynamic ) } : readable : d y n a m i c
/ *
* This l i n k e r s c r i p t i s u s e d b o t h w i t h - r a n d w i t h - s h a r e d . F o r
* the l a y o u t s t o m a t c h , w e n e e d t o s k i p m o r e t h a n e n o u g h s p a c e f o r
* the d y n a m i c s y m b o l t a b l e e t a l . I f t h i s a m o u n t i s i n s u f f i c i e n t ,
* ld - s h a r e d w i l l b a r f . J u s t i n c r e a s e i t h e r e .
* /
2007-12-05 14:32:13 -08:00
. = GATE_ A D D R + 0 x60 0 ;
2007-10-15 20:40:29 -07:00
2010-02-20 01:03:42 +01:00
.data . .patch : {
2009-03-04 21:05:42 +09:00
_ _ paravirt_ s t a r t _ g a t e _ m c k i n l e y _ e 9 _ p a t c h l i s t = . ;
2010-02-20 01:03:42 +01:00
* ( .data . .patch .mckinley_e9 )
2009-03-04 21:05:42 +09:00
_ _ paravirt_ e n d _ g a t e _ m c k i n l e y _ e 9 _ p a t c h l i s t = . ;
2007-10-15 20:40:29 -07:00
2009-03-04 21:05:42 +09:00
_ _ paravirt_ s t a r t _ g a t e _ v t o p _ p a t c h l i s t = . ;
2010-02-20 01:03:42 +01:00
* ( .data . .patch .vtop )
2009-03-04 21:05:42 +09:00
_ _ paravirt_ e n d _ g a t e _ v t o p _ p a t c h l i s t = . ;
2007-10-15 20:40:29 -07:00
2009-03-04 21:05:42 +09:00
_ _ paravirt_ s t a r t _ g a t e _ f s y s c a l l _ p a t c h l i s t = . ;
2010-02-20 01:03:42 +01:00
* ( .data . .patch .fsyscall_table )
2009-03-04 21:05:42 +09:00
_ _ paravirt_ e n d _ g a t e _ f s y s c a l l _ p a t c h l i s t = . ;
2007-10-15 20:40:29 -07:00
2009-03-04 21:05:42 +09:00
_ _ paravirt_ s t a r t _ g a t e _ b r l _ f s y s _ b u b b l e _ d o w n _ p a t c h l i s t = . ;
2010-02-20 01:03:42 +01:00
* ( .data . .patch .brl_fsys_bubble_down )
2009-03-04 21:05:42 +09:00
_ _ paravirt_ e n d _ g a t e _ b r l _ f s y s _ b u b b l e _ d o w n _ p a t c h l i s t = . ;
2007-10-15 20:40:29 -07:00
} : readable
.IA_64 .unwind_info : { * ( .IA_64 .unwind_info * ) }
.IA_64 .unwind : { * ( .IA_64 .unwind * ) } : readable : u n w i n d
2005-04-16 15:20:36 -07:00
# ifdef H A V E _ B U G G Y _ S E G R E L
2007-10-15 20:40:29 -07:00
.text ( GATE_ A D D R + P A G E _ S I Z E ) : { * ( . t e x t ) * ( . t e x t . * ) } : r e a d a b l e
2005-04-16 15:20:36 -07:00
# else
2007-10-15 20:40:29 -07:00
. = ALIGN( P E R C P U _ P A G E _ S I Z E ) + ( . & ( P E R C P U _ P A G E _ S I Z E - 1 ) ) ;
.text : { * ( .text ) * ( .text . * ) } : epc
2005-04-16 15:20:36 -07:00
# endif
2007-10-15 20:40:29 -07:00
/ DISCARD/ : {
* ( .got .plt ) * ( .got )
* ( .data .data . * .gnu .linkonce .d . * )
* ( .dynbss )
* ( .bss .bss . * .gnu .linkonce .b . * )
* ( _ _ ex_ t a b l e )
* ( _ _ mca_ t a b l e )
}
2005-04-16 15:20:36 -07:00
}
2007-10-15 20:40:29 -07:00
/ *
* ld d o e s n o t r e c o g n i z e t h i s n a m e t o k e n ; use the constant.
* /
# define P T _ I A _ 6 4 _ U N W I N D 0 x70 0 0 0 0 0 1
2005-04-16 15:20:36 -07:00
/ *
* We m u s t s u p p l y t h e E L F p r o g r a m h e a d e r s e x p l i c i t l y t o g e t j u s t o n e
* PT_ L O A D s e g m e n t , a n d s e t t h e f l a g s e x p l i c i t l y t o m a k e s e g m e n t s r e a d - o n l y .
* /
PHDRS
{
2007-10-15 20:40:29 -07:00
readable P T _ L O A D F I L E H D R P H D R S F L A G S ( 4 ) ; /* PF_R */
2005-04-16 15:20:36 -07:00
# ifndef H A V E _ B U G G Y _ S E G R E L
2007-10-15 20:40:29 -07:00
epc P T _ L O A D F I L E H D R P H D R S F L A G S ( 1 ) ; /* PF_X */
2005-04-16 15:20:36 -07:00
# endif
2007-10-15 20:40:29 -07:00
dynamic P T _ D Y N A M I C F L A G S ( 4 ) ; /* PF_R */
2007-10-18 15:11:08 -07:00
note P T _ N O T E F L A G S ( 4 ) ; /* PF_R */
2007-10-15 20:40:29 -07:00
unwind P T _ I A _ 6 4 _ U N W I N D ;
2005-04-16 15:20:36 -07:00
}
/ *
* This c o n t r o l s w h a t s y m b o l s w e e x p o r t f r o m t h e D S O .
* /
VERSION
{
2007-10-15 20:40:29 -07:00
LINUX_ 2 . 5 {
global :
_ _ kernel_ s y s c a l l _ v i a _ b r e a k ;
_ _ kernel_ s y s c a l l _ v i a _ e p c ;
_ _ kernel_ s i g t r a m p ;
local : * ;
} ;
2005-04-16 15:20:36 -07:00
}
/* The ELF entry point can be used to set the AT_SYSINFO value. */
ENTRY( _ _ k e r n e l _ s y s c a l l _ v i a _ e p c )