2006-09-27 18:33:49 +09:00
/ *
* Linker s c r i p t f o r v s y s c a l l D S O . T h e v s y s c a l l p a g e i s a n E L F s h a r e d
* object p r e l i n k e d t o i t s v i r t u a l a d d r e s s , a n d w i t h o n l y o n e r e a d - o n l y
* segment ( t h a t f i t s 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 i t s l a y o u t .
* /
# include < a s m / a s m - o f f s e t s . h >
# ifdef C O N F I G _ C P U _ L I T T L E _ E N D I A N
OUTPUT_ F O R M A T ( " e l f32 - s h - l i n u x " , " e l f32 - s h - l i n u x " , " e l f32 - s h - l i n u x " )
# else
OUTPUT_ F O R M A T ( " e l f32 - s h b i g - l i n u x " , " e l f32 - s h b i g - l i n u x " , " e l f32 - s h b i g - l i n u x " )
# endif
OUTPUT_ A R C H ( s h )
/* The ELF entry point can be used to set the AT_SYSINFO value. */
ENTRY( _ _ k e r n e l _ v s y s c a l l ) ;
SECTIONS
{
2007-10-15 20:42:02 -07:00
. = SIZEOF_ H E A D E R S ;
2006-09-27 18:33:49 +09:00
2007-10-15 20:42:02 -07:00
.hash : { * ( .hash ) } : text
.gnu .hash : { * ( .gnu .hash ) }
.dynsym : { * ( .dynsym ) }
.dynstr : { * ( .dynstr ) }
.gnu .version : { * ( .gnu .version ) }
.gnu .version_d : { * ( .gnu .version_d ) }
.gnu .version_r : { * ( .gnu .version_r ) }
2006-09-27 18:33:49 +09:00
2007-10-15 20:42:02 -07:00
/ *
* 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 .
* For t h e 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
* space f o r t h e 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
* is i n s u f f i c i e n t , l d - 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 .
* /
. = 0 x4 0 0 ;
2006-09-27 18:33:49 +09:00
2007-10-15 20:42:02 -07:00
.text : { * ( .text ) } : text =0x90909090
.note : { * ( .note . * ) } : text : n o t e
.eh_frame_hdr : { * ( .eh_frame_hdr ) } : text : e h _ f r a m e _ h d r
2007-11-02 12:29:37 +09:00
.eh_frame : {
KEEP ( * ( . e h _ f r a m e ) )
LONG ( 0 )
} : text
2007-10-15 20:42:02 -07:00
.dynamic : { * ( .dynamic ) } : text : d y n a m i c
.useless : {
* ( .got .plt ) * ( .got )
* ( .data .data . * .gnu .linkonce .d . * )
* ( .dynbss )
* ( .bss .bss . * .gnu .linkonce .b . * )
} : text
2006-09-27 18:33:49 +09:00
}
2007-10-15 20:42:02 -07:00
/ *
* Very o l d v e r s i o n s o f l d d o 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 _ G N U _ E H _ F R A M E 0 x64 7 4 e 5 5 0
2006-09-27 18:33:49 +09: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:42:02 -07:00
text P T _ L O A D F I L E H D R P H D R S F L A G S ( 5 ) ; /* PF_R|PF_X */
dynamic P T _ D Y N A M I C F L A G S ( 4 ) ; /* PF_R */
note P T _ N O T E F L A G S ( 4 ) ; /* PF_R */
eh_ f r a m e _ h d r P T _ G N U _ E H _ F R A M E ;
2006-09-27 18:33:49 +09: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:42:02 -07:00
LINUX_ 2 . 6 {
global :
_ _ kernel_ v s y s c a l l ;
_ _ kernel_ s i g r e t u r n ;
_ _ kernel_ r t _ s i g r e t u r n ;
2006-09-27 18:33:49 +09:00
2007-10-15 20:42:02 -07:00
local : * ;
} ;
2006-09-27 18:33:49 +09:00
}