2019-06-03 08:44:50 +03:00
/* SPDX-License-Identifier: GPL-2.0-only */
2012-03-05 15:49:31 +04:00
/ *
* GNU l i n k e r s c r i p t f o r t h e V D S O l i b r a r y .
*
* Copyright ( C ) 2 0 1 2 A R M L i m i t e d
*
* Author : Will D e a c o n < w i l l . d e a c o n @arm.com>
* Heavily b a s e d o n t h e v D S O l i n k e r s c r i p t s f o r o t h e r a r c h s .
* /
# include < l i n u x / c o n s t . h >
# include < a s m / p a g e . h >
# include < a s m / v d s o . h >
2022-05-10 12:58:31 +03:00
# include < a s m - g e n e r i c / v m l i n u x . l d s . h >
2012-03-05 15:49:31 +04:00
OUTPUT_ F O R M A T ( " e l f64 - l i t t l e a a r c h64 " , " e l f64 - b i g a a r c h64 " , " e l f64 - l i t t l e a a r c h64 " )
OUTPUT_ A R C H ( a a r c h64 )
SECTIONS
{
2020-06-24 11:33:18 +03:00
PROVIDE( _ v d s o _ d a t a = . - _ _ V V A R _ P A G E S * P A G E _ S I Z E ) ;
# ifdef C O N F I G _ T I M E _ N S
PROVIDE( _ t i m e n s _ d a t a = _ v d s o _ d a t a + P A G E _ S I Z E ) ;
# endif
2012-03-05 15:49:31 +04:00
. = VDSO_ 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 ) }
2021-04-23 23:51:59 +03:00
/ *
* Discard . n o t e . g n u . p r o p e r t y s e c t i o n s w h i c h a r e u n u s e d a n d h a v e
* different a l i g n m e n t r e q u i r e m e n t f r o m v D S O n o t e s e c t i o n s .
* /
/ DISCARD/ : {
* ( .note .GNU - stack . n o t e . g n u . p r o p e r t y )
}
2012-03-05 15:49:31 +04:00
.note : { * ( .note . * ) } : text : n o t e
. = ALIGN( 1 6 ) ;
.text : { * ( .text * ) } : text =0xd503201f
PROVIDE ( _ _ e t e x t = . ) ;
PROVIDE ( _ e t e x t = . ) ;
PROVIDE ( e t e x t = . ) ;
2022-08-30 13:48:32 +03:00
. = ALIGN( 4 ) ;
.altinstructions : {
* ( .altinstructions )
}
2012-03-05 15:49:31 +04:00
.dynamic : { * ( .dynamic ) } : text : d y n a m i c
2022-05-10 12:58:31 +03:00
.rela .dyn : ALIGN( 8 ) { * ( . r e l a . r e l a * ) }
2022-06-28 18:13:07 +03:00
.rodata : {
* ( .rodata * )
* ( .got )
* ( .got .plt )
2022-05-10 12:58:31 +03:00
* ( .plt )
* ( .plt . * )
* ( .iplt )
* ( .igot .igot .plt )
2022-06-28 18:13:07 +03:00
} : text
2012-03-05 15:49:31 +04:00
_ end = . ;
PROVIDE( e n d = . ) ;
2022-05-10 12:58:31 +03:00
DWARF_ D E B U G
ELF_ D E T A I L S
2012-03-05 15:49:31 +04:00
/ DISCARD/ : {
* ( .data .data . * .gnu .linkonce .d . * .sdata * )
* ( .bss .sbss .dynbss .dynsbss )
2020-12-31 01:19:54 +03:00
* ( .eh_frame .eh_frame_hdr )
2012-03-05 15:49:31 +04: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
{
text P T _ L O A D F L A G S ( 5 ) F I L E H D R P H D R S ; /* 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 */
}
/ *
* 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
{
LINUX_ 2 . 6 . 3 9 {
global :
_ _ kernel_ r t _ s i g r e t u r n ;
_ _ 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 ;
local : * ;
} ;
}
/ *
* Make t h e s i g r e t u r n c o d e v i s i b l e t o t h e k e r n e l .
* /
VDSO_ s i g t r a m p = _ _ k e r n e l _ r t _ s i g r e t u r n ;