2005-11-05 10:36:59 +11:00
# ifdef C O N F I G _ P P C 6 4
2006-03-28 23:15:54 +11:00
# define P R O V I D E 3 2 ( x ) P R O V I D E ( _ _ u n u s e d _ _ ## x )
2005-11-05 10:36:59 +11:00
# else
2006-03-28 23:15:54 +11:00
# define P R O V I D E 3 2 ( x ) P R O V I D E ( x )
2005-11-05 10:36:59 +11:00
# endif
2008-04-16 05:52:26 +10:00
# include < a s m / p a g e . h >
2005-09-26 16:04:21 +10:00
# include < a s m - g e n e r i c / v m l i n u x . l d s . h >
2007-07-04 14:04:31 +10:00
# include < a s m / c a c h e . h >
2009-09-24 10:36:24 -04:00
# include < a s m / t h r e a d _ i n f o . h >
2005-09-26 16:04:21 +10:00
2005-11-03 16:03:06 +11:00
ENTRY( _ s t e x t )
2008-07-22 09:03:45 +10:00
PHDRS {
kernel P T _ L O A D F L A G S ( 7 ) ; /* RWX */
notes P T _ N O T E F L A G S ( 0 ) ;
dummy P T _ N O T E F L A G S ( 0 ) ;
/ * binutils < 2 . 1 8 h a s a b u g t h a t m a k e s i t m i s b e h a v e w h e n t a k i n g a n
ELF f i l e w i t h a l l s e g m e n t s a t l o a d a d d r e s s 0 a s i n p u t . T h i s
happens w h e n r u n n i n g " s t r i p " o n v m l i n u x , b e c a u s e o f t h e A T ( ) m a g i c
in t h i s l i n k e r s c r i p t . P e o p l e u s i n g G C C > = 4 . 2 w o n ' t r u n i n t o
this p r o b l e m , b e c a u s e t h e " b u i l d - i d " s u p p o r t w i l l p u t s o m e d a t a
into t h e " n o t e s " s e g m e n t ( a t a n o n - z e r o l o a d a d d r e s s ) .
To w o r k a r o u n d t h i s , w e f o r c e s o m e d a t a i n t o b o t h t h e " d u m m y "
segment a n d t h e k e r n e l s e g m e n t , s o t h e d u m m y s e g m e n t w i l l g e t a
non- z e r o l o a d a d d r e s s . I t ' s n o t e n o u g h t o a l w a y s c r e a t e t h e
" notes" s e g m e n t , s i n c e i f n o t h i n g g e t s a s s i g n e d t o i t , i t s l o a d
address w i l l b e z e r o . * /
}
2005-09-30 16:16:52 +10:00
# ifdef C O N F I G _ P P C 6 4
OUTPUT_ A R C H ( p o w e r p c : c o m m o n 6 4 )
jiffies = j i f f i e s _ 6 4 ;
# else
2005-09-26 16:04:21 +10:00
OUTPUT_ A R C H ( p o w e r p c : c o m m o n )
jiffies = j i f f i e s _ 6 4 + 4 ;
2005-09-30 16:16:52 +10:00
# endif
2005-09-26 16:04:21 +10:00
SECTIONS
{
2006-03-28 23:15:54 +11:00
. = KERNELBASE;
2005-09-26 16:04:21 +10:00
2006-03-28 23:15:54 +11:00
/ *
* Text, r e a d o n l y d a t a a n d o t h e r p e r m a n e n t r e a d - o n l y s e c t i o n s
* /
2016-09-28 11:31:48 +10:00
_ text = . ;
_ stext = . ;
/ *
* Head t e x t .
* This n e e d s t o b e i n i t s o w n o u t p u t s e c t i o n t o a v o i d l d p l a c i n g
* branch t r a m p o l i n e s t u b s r a n d o m l y t h r o u g h o u t t h e f i x e d s e c t i o n s ,
* which i t w i l l d o ( e v e n i f t h e b r a n c h c o m e s f r o m a n o t h e r s e c t i o n )
* in o r d e r t o o p t i m i z e s t u b g e n e r a t i o n .
* /
.head .text : AT( A D D R ( . h e a d . t e x t ) - L O A D _ O F F S E T ) {
# ifdef C O N F I G _ P P C 6 4
KEEP( * ( . h e a d . t e x t . f i r s t _ 2 5 6 B ) ) ;
# ifdef C O N F I G _ P P C _ B O O K 3 E
# define E N D _ F I X E D 0 x10 0
# else
KEEP( * ( . h e a d . t e x t . r e a l _ v e c t o r s ) ) ;
* ( .head .text .real_trampolines ) ;
KEEP( * ( . h e a d . t e x t . v i r t _ v e c t o r s ) ) ;
* ( .head .text .virt_trampolines ) ;
# if d e f i n e d ( C O N F I G _ P P C _ P S E R I E S ) | | d e f i n e d ( C O N F I G _ P P C _ P O W E R N V )
KEEP( * ( . h e a d . d a t a . f w n m i _ p a g e ) ) ;
# define E N D _ F I X E D 0 x80 0 0
# else
# define E N D _ F I X E D 0 x70 0 0
# endif
# endif
ASSERT( ( . = = E N D _ F I X E D ) , " v m l i n u x . l d s . S : f i x e d s e c t i o n o v e r f l o w e r r o r " ) ;
# else / * ! C O N F I G _ P P C 6 4 * /
HEAD_ T E X T
# endif
} : kernel
2017-04-19 20:59:51 +05:30
_ _ head_ e n d = . ;
2016-09-28 11:31:48 +10:00
/ *
* If t h e b u i l d d i e s h e r e , i t ' s l i k e l y c o d e i n h e a d _ 6 4 . S i s r e f e r e n c i n g
* labels i t c a n ' t r e a c h , a n d t h e l i n k e r i n s e r t i n g s t u b s w i t h o u t t h e
* assembler' s k n o w l e d g e . T o d e b u g , r e m o v e t h e a b o v e a s s e r t a n d
* rebuild. L o o k f o r b r a n c h s t u b s i n t h e f i x e d s e c t i o n r e g i o n .
*
* Linker s t u b g e n e r a t i o n c o u l d b e a l l o w e d i n " t r a m p o l i n e "
* sections i f a b s o l u t e l y n e c e s s a r y , b u t t h i s w o u l d r e q u i r e
* some r e w o r k o f t h e f i x e d s e c t i o n s . B e f o r e r e s o r t i n g t o t h i s ,
* consider r e f e r e n c e s t h a t h a v e s u f f i c i e n t a d d r e s s i n g r a n g e ,
* ( e. g . , h a n d c o d e d t r a m p o l i n e s ) s o t h e l i n k e r d o e s n o t h a v e
* to a d d s t u b s .
*
* Linker s t u b s a t t h e t o p o f t h e m a i n t e x t s e c t i o n a r e c u r r e n t l y n o t
* detected, a n d w i l l r e s u l t i n a c r a s h a t b o o t d u e t o o f f s e t s b e i n g
* wrong.
* /
2016-11-26 14:20:31 +11:00
# ifdef C O N F I G _ P P C 6 4
/ *
* BLOCK( 0 ) o v e r r i d e s t h e d e f a u l t o u t p u t s e c t i o n a l i g n m e n t b e c a u s e
* this n e e d s t o s t a r t r i g h t a f t e r . h e a d . t e x t i n o r d e r f o r f i x e d
* section p l a c e m e n t t o w o r k .
* /
.text BLOCK( 0 ) : A T ( A D D R ( . t e x t ) - L O A D _ O F F S E T ) {
# else
2008-04-16 05:52:28 +10:00
.text : AT( A D D R ( . t e x t ) - L O A D _ O F F S E T ) {
2007-09-13 15:42:35 -05:00
ALIGN_ F U N C T I O N ( ) ;
2016-11-26 14:20:31 +11:00
# endif
2009-04-28 11:47:15 -04:00
/* careful! __ftr_alt_* sections need to be close to .text */
* ( .text .fixup _ _ ftr_ a l t _ * . r e f . t e x t )
2006-03-28 23:15:54 +11:00
SCHED_ T E X T
2016-10-07 17:02:55 -07:00
CPUIDLE_ T E X T
2006-03-28 23:15:54 +11:00
LOCK_ T E X T
KPROBES_ T E X T
2009-02-09 21:10:27 -08:00
IRQENTRY_ T E X T
2016-03-25 14:22:05 -07:00
SOFTIRQENTRY_ T E X T
powerpc: Ensure .mem(init|exit).text are within _stext/_etext
In our linker script we open code the list of text sections, because we
need to include the __ftr_alt sections, which are arch-specific.
This means we can't use TEXT_TEXT as defined in vmlinux.lds.h, and so we
don't have the MEM_KEEP() logic for memory hotplug sections.
If we build the kernel with the gold linker, and with CONFIG_MEMORY_HOTPLUG=y,
we see that functions marked __meminit can end up outside of the
_stext/_etext range, and also outside of _sinittext/_einittext, eg:
c000000000000000 T _stext
c0000000009e0000 A _etext
c0000000009e3f18 T hash__vmemmap_create_mapping
c000000000ca0000 T _sinittext
c000000000d00844 T _einittext
This causes them to not be recognised as text by is_kernel_text(), and
prevents them being patched by jump_label (and presumably ftrace/kprobes
etc.).
Fix it by adding MEM_KEEP() directives, mirroring what TEXT_TEXT does.
This isn't a problem when CONFIG_MEMORY_HOTPLUG=n, because we use the
standard INIT_TEXT_SECTION() and EXIT_TEXT macros from vmlinux.lds.h.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Tested-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-09-15 15:11:59 +10:00
MEM_ K E E P ( i n i t . t e x t )
MEM_ K E E P ( e x i t . t e x t )
2005-09-26 16:04:21 +10:00
2006-03-28 23:15:54 +11:00
# ifdef C O N F I G _ P P C 3 2
* ( .got1 )
_ _ got2 _ s t a r t = . ;
* ( .got2 )
_ _ got2 _ e n d = . ;
# endif / * C O N F I G _ P P C 3 2 * /
2008-07-22 09:03:45 +10:00
} : kernel
2006-03-28 23:15:54 +11:00
2008-09-02 15:04:09 +10:00
. = ALIGN( P A G E _ S I Z E ) ;
_ etext = . ;
PROVIDE3 2 ( e t e x t = . ) ;
2006-03-28 23:15:54 +11:00
/* Read-only data */
RODATA
2009-09-24 10:36:24 -04:00
EXCEPTION_ T A B L E ( 0 )
2005-09-26 16:04:21 +10:00
2008-07-22 09:03:45 +10:00
NOTES : k e r n e l : n o t e s
/ * The d u m m y s e g m e n t c o n t e n t s f o r t h e b u g w o r k a r o u n d m e n t i o n e d a b o v e
near P H D R S . * /
2008-07-25 10:08:41 +10:00
.dummy : AT( A D D R ( . d u m m y ) - L O A D _ O F F S E T ) {
2009-01-02 10:46:04 +00:00
LONG( 0 )
LONG( 0 )
LONG( 0 )
2008-07-22 09:03:45 +10:00
} : kernel : d u m m y
2007-07-19 01:48:38 -07:00
2006-03-28 23:15:54 +11:00
/ *
* Init s e c t i o n s d i s c a r d e d a t r u n t i m e
* /
. = ALIGN( P A G E _ S I Z E ) ;
_ _ init_ b e g i n = . ;
2009-09-24 10:36:24 -04:00
INIT_ T E X T _ S E C T I O N ( P A G E _ S I Z E ) : k e r n e l
2006-03-28 23:15:54 +11:00
/ * .exit .text is discarded a t r u n t i m e , n o t l i n k t i m e ,
* to d e a l w i t h r e f e r e n c e s f r o m _ _ b u g _ t a b l e
* /
2008-04-16 05:52:28 +10:00
.exit .text : AT( A D D R ( . e x i t . t e x t ) - L O A D _ O F F S E T ) {
2008-01-20 14:15:03 +01:00
EXIT_ T E X T
}
2006-03-28 23:15:54 +11:00
2008-04-16 05:52:28 +10:00
.init .data : AT( A D D R ( . i n i t . d a t a ) - L O A D _ O F F S E T ) {
2008-01-20 14:15:03 +01:00
INIT_ D A T A
2006-03-28 23:15:54 +11:00
_ _ vtop_ t a b l e _ b e g i n = . ;
* ( .vtop_fixup ) ;
_ _ vtop_ t a b l e _ e n d = . ;
_ _ ptov_ t a b l e _ b e g i n = . ;
* ( .ptov_fixup ) ;
_ _ ptov_ t a b l e _ e n d = . ;
}
2008-04-16 05:52:28 +10:00
.init .setup : AT( A D D R ( . i n i t . s e t u p ) - L O A D _ O F F S E T ) {
2009-09-24 10:36:24 -04:00
INIT_ S E T U P ( 1 6 )
2006-03-28 23:15:54 +11:00
}
2008-04-16 05:52:28 +10:00
.initcall .init : AT( A D D R ( . i n i t c a l l . i n i t ) - L O A D _ O F F S E T ) {
2009-09-24 10:36:24 -04:00
INIT_ C A L L S
}
2006-03-28 23:15:54 +11:00
2008-04-16 05:52:28 +10:00
.con_initcall .init : AT( A D D R ( . c o n _ i n i t c a l l . i n i t ) - L O A D _ O F F S E T ) {
2009-09-24 10:36:24 -04:00
CON_ I N I T C A L L
2006-03-28 23:15:54 +11:00
}
SECURITY_ I N I T
. = ALIGN( 8 ) ;
2008-04-16 05:52:28 +10:00
_ _ ftr_ f i x u p : A T ( A D D R ( _ _ f t r _ f i x u p ) - L O A D _ O F F S E T ) {
2005-09-30 16:16:52 +10:00
_ _ start_ _ _ f t r _ f i x u p = . ;
* ( _ _ ftr_ f i x u p )
_ _ stop_ _ _ f t r _ f i x u p = . ;
}
2008-07-02 01:16:40 +10:00
. = ALIGN( 8 ) ;
2008-12-18 19:13:32 +00:00
_ _ mmu_ f t r _ f i x u p : A T ( A D D R ( _ _ m m u _ f t r _ f i x u p ) - L O A D _ O F F S E T ) {
_ _ start_ _ _ m m u _ f t r _ f i x u p = . ;
* ( _ _ mmu_ f t r _ f i x u p )
_ _ stop_ _ _ m m u _ f t r _ f i x u p = . ;
}
. = ALIGN( 8 ) ;
2008-07-02 01:16:40 +10:00
_ _ lwsync_ f i x u p : A T ( A D D R ( _ _ l w s y n c _ f i x u p ) - L O A D _ O F F S E T ) {
_ _ start_ _ _ l w s y n c _ f i x u p = . ;
* ( _ _ lwsync_ f i x u p )
_ _ stop_ _ _ l w s y n c _ f i x u p = . ;
}
2006-09-25 18:19:00 +10:00
# ifdef C O N F I G _ P P C 6 4
. = ALIGN( 8 ) ;
2008-04-16 05:52:28 +10:00
_ _ fw_ f t r _ f i x u p : A T ( A D D R ( _ _ f w _ f t r _ f i x u p ) - L O A D _ O F F S E T ) {
2006-09-25 18:19:00 +10:00
_ _ start_ _ _ f w _ f t r _ f i x u p = . ;
* ( _ _ fw_ f t r _ f i x u p )
_ _ stop_ _ _ f w _ f t r _ f i x u p = . ;
}
# endif
2008-04-16 05:52:28 +10:00
.init .ramfs : AT( A D D R ( . i n i t . r a m f s ) - L O A D _ O F F S E T ) {
2009-09-24 10:36:24 -04:00
INIT_ R A M _ F S
2006-03-28 23:15:54 +11:00
}
2009-09-24 10:36:24 -04:00
2011-03-24 18:50:09 +01:00
PERCPU_ S E C T I O N ( L 1 _ C A C H E _ B Y T E S )
2005-09-26 16:04:21 +10:00
2006-03-28 23:15:54 +11:00
. = ALIGN( 8 ) ;
2008-04-16 05:52:28 +10:00
.machine .desc : AT( A D D R ( . m a c h i n e . d e s c ) - L O A D _ O F F S E T ) {
2006-03-28 23:15:54 +11:00
_ _ machine_ d e s c _ s t a r t = . ;
* ( .machine .desc )
_ _ machine_ d e s c _ e n d = . ;
}
2008-10-22 18:43:45 +00:00
# ifdef C O N F I G _ R E L O C A T A B L E
powerpc: Make the 64-bit kernel as a position-independent executable
This implements CONFIG_RELOCATABLE for 64-bit by making the kernel as
a position-independent executable (PIE) when it is set. This involves
processing the dynamic relocations in the image in the early stages of
booting, even if the kernel is being run at the address it is linked at,
since the linker does not necessarily fill in words in the image for
which there are dynamic relocations. (In fact the linker does fill in
such words for 64-bit executables, though not for 32-bit executables,
so in principle we could avoid calling relocate() entirely when we're
running a 64-bit kernel at the linked address.)
The dynamic relocations are processed by a new function relocate(addr),
where the addr parameter is the virtual address where the image will be
run. In fact we call it twice; once before calling prom_init, and again
when starting the main kernel. This means that reloc_offset() returns
0 in prom_init (since it has been relocated to the address it is running
at), which necessitated a few adjustments.
This also changes __va and __pa to use an equivalent definition that is
simpler. With the relocatable kernel, PAGE_OFFSET and MEMORY_START are
constants (for 64-bit) whereas PHYSICAL_START is a variable (and
KERNELBASE ideally should be too, but isn't yet).
With this, relocatable kernels still copy themselves down to physical
address 0 and run there.
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-08-30 11:43:47 +10:00
. = ALIGN( 8 ) ;
2011-12-14 22:58:12 +00:00
.dynsym : AT( A D D R ( . d y n s y m ) - L O A D _ O F F S E T )
{
2016-07-13 09:14:40 +08:00
# ifdef C O N F I G _ P P C 3 2
2011-12-14 22:58:12 +00:00
_ _ dynamic_ s y m t a b = . ;
# endif
* ( .dynsym )
}
powerpc: Make the 64-bit kernel as a position-independent executable
This implements CONFIG_RELOCATABLE for 64-bit by making the kernel as
a position-independent executable (PIE) when it is set. This involves
processing the dynamic relocations in the image in the early stages of
booting, even if the kernel is being run at the address it is linked at,
since the linker does not necessarily fill in words in the image for
which there are dynamic relocations. (In fact the linker does fill in
such words for 64-bit executables, though not for 32-bit executables,
so in principle we could avoid calling relocate() entirely when we're
running a 64-bit kernel at the linked address.)
The dynamic relocations are processed by a new function relocate(addr),
where the addr parameter is the virtual address where the image will be
run. In fact we call it twice; once before calling prom_init, and again
when starting the main kernel. This means that reloc_offset() returns
0 in prom_init (since it has been relocated to the address it is running
at), which necessitated a few adjustments.
This also changes __va and __pa to use an equivalent definition that is
simpler. With the relocatable kernel, PAGE_OFFSET and MEMORY_START are
constants (for 64-bit) whereas PHYSICAL_START is a variable (and
KERNELBASE ideally should be too, but isn't yet).
With this, relocatable kernels still copy themselves down to physical
address 0 and run there.
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-08-30 11:43:47 +10:00
.dynstr : AT( A D D R ( . d y n s t r ) - L O A D _ O F F S E T ) { * ( . d y n s t r ) }
.dynamic : AT( A D D R ( . d y n a m i c ) - L O A D _ O F F S E T )
{
_ _ dynamic_ s t a r t = . ;
* ( .dynamic )
}
.hash : AT( A D D R ( . h a s h ) - L O A D _ O F F S E T ) { * ( . h a s h ) }
.interp : AT( A D D R ( . i n t e r p ) - L O A D _ O F F S E T ) { * ( . i n t e r p ) }
.rela .dyn : AT( A D D R ( . r e l a . d y n ) - L O A D _ O F F S E T )
{
_ _ rela_ d y n _ s t a r t = . ;
* ( .rela * )
}
2008-10-22 18:43:45 +00:00
# endif
2015-10-08 10:28:28 +11:00
/ * .exit .data is discarded a t r u n t i m e , n o t l i n k t i m e ,
* to d e a l w i t h r e f e r e n c e s f r o m . e x i t . t e x t
* /
.exit .data : AT( A D D R ( . e x i t . d a t a ) - L O A D _ O F F S E T ) {
EXIT_ D A T A
}
2006-03-28 23:15:54 +11:00
/* freed after init ends here */
. = ALIGN( P A G E _ S I Z E ) ;
_ _ init_ e n d = . ;
/ *
* And n o w t h e v a r i o u s r e a d / w r i t e d a t a
* /
. = ALIGN( P A G E _ S I Z E ) ;
_ sdata = . ;
2005-09-26 16:04:21 +10:00
2005-09-30 16:16:52 +10:00
# ifdef C O N F I G _ P P C 3 2
2008-04-16 05:52:28 +10:00
.data : AT( A D D R ( . d a t a ) - L O A D _ O F F S E T ) {
2007-05-17 13:38:44 +02:00
DATA_ D A T A
2006-03-28 23:15:54 +11:00
* ( .sdata )
* ( .got .plt ) * ( .got )
}
2005-09-30 16:16:52 +10:00
# else
2008-04-16 05:52:28 +10:00
.data : AT( A D D R ( . d a t a ) - L O A D _ O F F S E T ) {
2007-06-16 22:29:04 -04:00
DATA_ D A T A
* ( .data .rel * )
* ( .toc1 )
2006-03-28 23:15:54 +11:00
* ( .branch_lt )
}
2005-09-26 16:04:21 +10:00
2008-04-16 05:52:28 +10:00
.opd : AT( A D D R ( . o p d ) - L O A D _ O F F S E T ) {
2006-03-28 23:15:54 +11:00
* ( .opd )
}
2015-05-14 14:45:40 +10:00
. = ALIGN( 2 5 6 ) ;
2008-04-16 05:52:28 +10:00
.got : AT( A D D R ( . g o t ) - L O A D _ O F F S E T ) {
2006-03-28 23:15:54 +11:00
_ _ toc_ s t a r t = . ;
2012-11-26 17:39:03 +00:00
# ifndef C O N F I G _ R E L O C A T A B L E
_ _ prom_ i n i t _ t o c _ s t a r t = . ;
arch/ p o w e r p c / k e r n e l / p r o m _ i n i t . o * ( . t o c . g o t )
_ _ prom_ i n i t _ t o c _ e n d = . ;
# endif
2006-03-28 23:15:54 +11:00
* ( .got )
* ( .toc )
}
2005-09-30 16:16:52 +10:00
# endif
2005-09-26 16:04:21 +10:00
2006-03-28 23:15:54 +11:00
/* The initial task and kernel stack */
2010-02-20 01:03:35 +01:00
INIT_ T A S K _ D A T A _ S E C T I O N ( T H R E A D _ S I Z E )
2005-09-26 16:04:21 +10:00
2010-02-20 01:03:37 +01:00
.data . .page_aligned : AT( A D D R ( . d a t a . . p a g e _ a l i g n e d ) - L O A D _ O F F S E T ) {
2009-09-24 10:36:24 -04:00
PAGE_ A L I G N E D _ D A T A ( P A G E _ S I Z E )
2006-03-28 23:15:54 +11:00
}
2005-09-26 16:04:21 +10:00
2010-02-20 01:03:34 +01:00
.data . .cacheline_aligned : AT( A D D R ( . d a t a . . c a c h e l i n e _ a l i g n e d ) - L O A D _ O F F S E T ) {
2009-09-24 10:36:24 -04:00
CACHELINE_ A L I G N E D _ D A T A ( L 1 _ C A C H E _ B Y T E S )
2006-03-28 23:15:54 +11:00
}
2005-09-26 16:04:21 +10:00
2010-02-20 01:03:44 +01:00
.data . .read_mostly : AT( A D D R ( . d a t a . . r e a d _ m o s t l y ) - L O A D _ O F F S E T ) {
2009-09-24 10:36:24 -04:00
READ_ M O S T L Y _ D A T A ( L 1 _ C A C H E _ B Y T E S )
2007-07-04 14:04:31 +10:00
}
2009-09-29 06:00:06 +00:00
. = ALIGN( P A G E _ S I Z E ) ;
2008-04-16 05:52:28 +10:00
.data_nosave : AT( A D D R ( . d a t a _ n o s a v e ) - L O A D _ O F F S E T ) {
2009-09-24 10:36:24 -04:00
NOSAVE_ D A T A
2006-03-28 23:15:54 +11:00
}
2005-10-10 22:38:46 +10:00
2017-03-30 17:49:27 +02:00
BUG_ T A B L E
2009-08-09 19:06:24 +00:00
. = ALIGN( P A G E _ S I Z E ) ;
_ edata = . ;
PROVIDE3 2 ( e d a t a = . ) ;
2006-03-28 23:15:54 +11:00
/ *
* And f i n a l l y t h e b s s
* /
2009-09-24 10:36:24 -04:00
BSS_ S E C T I O N ( 0 , 0 , 0 )
2005-09-26 16:04:21 +10:00
2006-03-28 23:15:54 +11:00
. = ALIGN( P A G E _ S I Z E ) ;
_ end = . ;
PROVIDE3 2 ( e n d = . ) ;
linker script: unify usage of discard definition
Discarded sections in different archs share some commonality but have
considerable differences. This led to linker script for each arch
implementing its own /DISCARD/ definition, which makes maintaining
tedious and adding new entries error-prone.
This patch makes all linker scripts to move discard definitions to the
end of the linker script and use the common DISCARDS macro. As ld
uses the first matching section definition, archs can include default
discarded sections by including them earlier in the linker script.
ia64 is notable because it first throws away some ia64 specific
subsections and then include the rest of the sections into the final
image, so those sections must be discarded before the inclusion.
defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
alpha, sparc, sparc64 and s390. Michal Simek tested microblaze.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Tony Luck <tony.luck@intel.com>
2009-07-09 11:27:40 +09:00
/* Sections to be discarded. */
DISCARDS
2005-09-26 16:04:21 +10:00
}