2021-04-13 09:35:14 +03:00
/* SPDX-License-Identifier: GPL-2.0-only */
/ *
* Copyright ( C ) 2 0 1 2 R e g e n t s o f t h e U n i v e r s i t y o f C a l i f o r n i a
* Copyright ( C ) 2 0 1 7 S i F i v e
* Copyright ( C ) 2 0 2 0 V i t a l y W o o l , K o n s u l k o A B
* /
# include < a s m / p g t a b l e . h >
# define L O A D _ O F F S E T K E R N E L _ L I N K _ A D D R
/* No __ro_after_init data in the .rodata section - which will always be ro */
# define R O _ A F T E R _ I N I T _ D A T A
# include < a s m / v m l i n u x . l d s . h >
# include < a s m / p a g e . h >
# include < a s m / c a c h e . h >
# include < a s m / t h r e a d _ i n f o . h >
OUTPUT_ A R C H ( r i s c v )
ENTRY( _ s t a r t )
jiffies = j i f f i e s _ 6 4 ;
SECTIONS
{
/* Beginning of code and text segment */
. = LOAD_ O F F S E T ;
_ xiprom = . ;
_ start = . ;
HEAD_ T E X T _ S E C T I O N
INIT_ T E X T _ S E C T I O N ( P A G E _ S I Z E )
/* we have to discard exit text and such at runtime, not link time */
.exit .text :
{
EXIT_ T E X T
}
.text : {
_ text = . ;
_ stext = . ;
TEXT_ T E X T
SCHED_ T E X T
CPUIDLE_ T E X T
LOCK_ T E X T
KPROBES_ T E X T
ENTRY_ T E X T
IRQENTRY_ T E X T
SOFTIRQENTRY_ T E X T
_ etext = . ;
}
RO_ D A T A ( L 1 _ C A C H E _ B Y T E S )
.srodata : {
* ( .srodata * )
}
.init .rodata : {
INIT_ S E T U P ( 1 6 )
INIT_ C A L L S
CON_ I N I T C A L L
INIT_ R A M _ F S
}
_ exiprom = . ; /* End of XIP ROM area */
/ *
* From t h i s p o i n t , s t u f f i s c o n s i d e r e d w r i t a b l e a n d w i l l b e c o p i e d t o R A M
* /
2021-10-11 12:14:14 +03:00
_ _ data_ l o c = A L I G N ( P A G E _ S I Z E ) ; /* location in file */
. = KERNEL_ L I N K _ A D D R + X I P _ O F F S E T ; /* location in memory */
# undef L O A D _ O F F S E T
# define L O A D _ O F F S E T ( K E R N E L _ L I N K _ A D D R + X I P _ O F F S E T - ( _ _ d a t a _ l o c & X I P _ O F F S E T _ M A S K ) )
2021-04-13 09:35:14 +03:00
_ sdata = . ; /* Start of data section */
_ data = . ;
RW_ D A T A ( L 1 _ C A C H E _ B Y T E S , P A G E _ S I Z E , T H R E A D _ S I Z E )
_ edata = . ;
_ _ start_ r o _ a f t e r _ i n i t = . ;
.data .ro_after_init : AT( A D D R ( . d a t a . r o _ a f t e r _ i n i t ) - L O A D _ O F F S E T ) {
* ( .data . .ro_after_init )
}
_ _ end_ r o _ a f t e r _ i n i t = . ;
. = ALIGN( P A G E _ S I Z E ) ;
_ _ init_ b e g i n = . ;
.init .data : {
INIT_ D A T A
}
.exit .data : {
EXIT_ D A T A
}
. = ALIGN( 8 ) ;
_ _ soc_ e a r l y _ i n i t _ t a b l e : {
_ _ soc_ e a r l y _ i n i t _ t a b l e _ s t a r t = . ;
KEEP( * ( _ _ s o c _ e a r l y _ i n i t _ t a b l e ) )
_ _ soc_ e a r l y _ i n i t _ t a b l e _ e n d = . ;
}
_ _ soc_ b u i l t i n _ d t b _ t a b l e : {
_ _ soc_ b u i l t i n _ d t b _ t a b l e _ s t a r t = . ;
KEEP( * ( _ _ s o c _ b u i l t i n _ d t b _ t a b l e ) )
_ _ soc_ b u i l t i n _ d t b _ t a b l e _ e n d = . ;
}
2021-05-31 11:53:42 +03:00
. = ALIGN( 8 ) ;
.alternative : {
_ _ alt_ s t a r t = . ;
* ( .alternative )
_ _ alt_ e n d = . ;
}
2021-04-13 09:35:14 +03:00
_ _ init_ e n d = . ;
2021-05-31 11:53:42 +03:00
. = ALIGN( 1 6 ) ;
.xip .traps : {
_ _ xip_ t r a p s _ s t a r t = . ;
* ( .xip .traps )
_ _ xip_ t r a p s _ e n d = . ;
}
. = ALIGN( P A G E _ S I Z E ) ;
2021-04-13 09:35:14 +03:00
.sdata : {
_ _ global_ p o i n t e r $ = . + 0 x80 0 ;
* ( .sdata * )
* ( .sbss * )
}
BSS_ S E C T I O N ( P A G E _ S I Z E , P A G E _ S I Z E , 0 )
2021-10-11 12:14:14 +03:00
PERCPU_ S E C T I O N ( L 1 _ C A C H E _ B Y T E S )
2021-04-13 09:35:14 +03:00
.rel .dyn : AT( A D D R ( . r e l . d y n ) - L O A D _ O F F S E T ) {
* ( .rel .dyn * )
}
/ *
* End o f c o p i e d d a t a . W e n e e d a d u m m y s e c t i o n t o g e t i t s L M A .
* Also l o c a t e d b e f o r e f i n a l A L I G N ( ) a s t r a i l i n g p a d d i n g i s n o t s t o r e d
* in t h e r e s u l t i n g b i n a r y f i l e a n d u s e l e s s t o c o p y .
* /
.data .endmark : AT( A D D R ( . d a t a . e n d m a r k ) - L O A D _ O F F S E T ) { }
_ edata_ l o c = L O A D A D D R ( . d a t a . e n d m a r k ) ;
. = ALIGN( P A G E _ S I Z E ) ;
_ end = . ;
STABS_ D E B U G
DWARF_ D E B U G
DISCARDS
}