2008-12-25 13:38:36 +01:00
/ *
* This i s t h e i n f a m o u s l d s c r i p t f o r t h e 3 2 b i t s v d s o
* library
* /
2017-07-05 07:37:27 +02:00
# include < a s m / p a g e . h >
2008-12-25 13:38:36 +01:00
# include < a s m / v d s o . h >
OUTPUT_ F O R M A T ( " e l f32 - s39 0 " , " e l f32 - s39 0 " , " e l f32 - s39 0 " )
OUTPUT_ A R C H ( s39 0 : 3 1 - b i t )
ENTRY( _ s t a r t )
SECTIONS
{
. = VDSO3 2 _ L B A S E + S I Z E O F _ H E A D E R S ;
.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 ) }
.note : { * ( .note . * ) } : text : n o t e
. = ALIGN( 1 6 ) ;
.text : {
* ( .text .stub .text . * .gnu .linkonce .t . * )
} : text
PROVIDE( _ _ e t e x t = . ) ;
PROVIDE( _ e t e x t = . ) ;
PROVIDE( e t e x t = . ) ;
/ *
* Other s t u f f i s a p p e n d e d t o t h e t e x t s e g m e n t :
* /
.rodata : { * ( .rodata .rodata . * .gnu .linkonce .r . * ) }
.rodata1 : { * ( .rodata1 ) }
.dynamic : { * ( .dynamic ) } : text : d y n a m i c
.eh_frame_hdr : { * ( .eh_frame_hdr ) } : text : e h _ f r a m e _ h d r
.eh_frame : { KEEP ( * ( . e h _ f r a m e ) ) } : t e x t
.gcc_except_table : { * ( .gcc_except_table .gcc_except_table . * ) }
.rela .dyn ALIGN( 8 ) : { * ( . r e l a . d y n ) }
.got ALIGN( 8 ) : { * ( . g o t . t o c ) }
_ end = . ;
PROVIDE( e n d = . ) ;
/ *
* Stabs d e b u g g i n g s e c t i o n s a r e h e r e t o o .
* /
.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 ) }
/ *
* DWARF d e b u g s e c t i o n s .
* Symbols i n t h e D W A R F d e b u g g i n g s e c t i o n s a r e r e l a t i v e t o t h e
* beginning o f t h e s e c t i o n s o w e b e g i n t h e m a t 0 .
* /
/* DWARF 1 */
.debug 0 : { * ( .debug ) }
.line 0 : { * ( .line ) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { * ( .debug_srcinfo ) }
.debug_sfnames 0 : { * ( .debug_sfnames ) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { * ( .debug_aranges ) }
.debug_pubnames 0 : { * ( .debug_pubnames ) }
/* DWARF 2 */
.debug_info 0 : { * ( .debug_info .gnu .linkonce .wi . * ) }
.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 ) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { * ( .debug_weaknames ) }
.debug_funcnames 0 : { * ( .debug_funcnames ) }
.debug_typenames 0 : { * ( .debug_typenames ) }
.debug_varnames 0 : { * ( .debug_varnames ) }
/* DWARF 3 */
.debug_pubtypes 0 : { * ( .debug_pubtypes ) }
.debug_ranges 0 : { * ( .debug_ranges ) }
.gnu .attributes 0 : { KEEP ( * ( . g n u . a t t r i b u t e s ) ) }
2017-07-05 07:37:27 +02:00
. = ALIGN( P A G E _ S I Z E ) ;
2008-12-25 13:38:36 +01:00
PROVIDE( _ v d s o _ d a t a = . ) ;
/ DISCARD/ : {
* ( .note .GNU - stack)
* ( .branch_lt )
* ( .data .data . * .gnu .linkonce .d . * .sdata * )
* ( .bss .sbss .dynbss .dynsbss )
}
}
/ *
* 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
/ *
* 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
{
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 ;
}
/ *
* 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
{
VDSO_ V E R S I O N _ S T R I N G {
global :
/ *
* Has t o b e t h e r e f o r t h e k e r n e l t o f i n d
* /
_ _ kernel_ g e t t i m e o f d a y ;
_ _ kernel_ c l o c k _ g e t t i m e ;
_ _ kernel_ c l o c k _ g e t r e s ;
2016-01-05 13:29:38 +01:00
_ _ kernel_ g e t c p u ;
2008-12-25 13:38:36 +01:00
local : * ;
} ;
}