2005-07-27 22:44:44 +04:00
/ * ld s c r i p t t o m a k e t h e L i n u x / C R I S k e r n e l
* Authors : Bjorn W e s e n ( b j o r n w @axis.com)
*
* It i s V E R Y D A N G E R O U S t o f i d d l e a r o u n d w i t h t h e s y m b o l s i n t h i s
* script. I t i s f o r e x a m p l e q u i t e v i t a l t h a t a l l g e n e r a t e d s e c t i o n s
* that a r e u s e d a r e a c t u a l l y n a m e d h e r e , o t h e r w i s e t h e l i n k e r w i l l
* put t h e m a t t h e e n d , w h e r e t h e i n i t s t u f f i s w h i c h i s F R E E D a f t e r
* the k e r n e l h a s b o o t e d .
* /
# include < a s m - g e n e r i c / v m l i n u x . l d s . h >
2008-01-30 14:57:31 +03:00
# include < a s m / p a g e . h >
# ifdef C O N F I G _ E T R A X _ V M E M _ S I Z E
# define _ _ C O N F I G _ E T R A X _ V M E M _ S I Z E C O N F I G _ E T R A X _ V M E M _ S I Z E
# else
# define _ _ C O N F I G _ E T R A X _ V M E M _ S I Z E 0
# endif
2005-07-27 22:44:44 +04:00
2008-10-23 01:57:53 +04:00
2005-07-27 22:44:44 +04:00
jiffies = j i f f i e s _ 6 4 ;
SECTIONS
{
. = DRAM_ V I R T U A L _ B A S E ;
dram_ s t a r t = . ;
2008-10-23 01:57:53 +04:00
# ifdef C O N F I G _ E T R A X _ A R C H _ V 1 0
ibr_ s t a r t = . ;
# else
2005-07-27 22:44:44 +04:00
ebp_ s t a r t = . ;
2008-01-30 14:57:31 +03:00
/* The boot section is only necessary until the VCS top */
/* level testbench includes both flash and DRAM. */
2005-07-27 22:44:44 +04:00
.boot : { * ( .boot ) }
2008-10-23 01:57:53 +04:00
# endif
2005-07-27 22:44:44 +04:00
2008-10-23 01:57:53 +04:00
/* see head.S and pages reserved at the start */
2008-01-30 14:57:31 +03:00
. = DRAM_ V I R T U A L _ B A S E + 0 x40 0 0 ;
2005-07-27 22:44:44 +04:00
2008-10-23 01:57:53 +04:00
_ text = . ; /* Text and read-only data. */
text_ s t a r t = . ; /* Lots of aliases. */
2005-07-27 22:44:44 +04:00
_ stext = . ;
_ _ stext = . ;
.text : {
2008-01-30 14:57:31 +03:00
TEXT_ T E X T
2005-07-27 22:44:44 +04:00
SCHED_ T E X T
LOCK_ T E X T
* ( .fixup )
* ( .text .__ * )
}
2008-10-23 01:57:53 +04:00
_ etext = . ; /* End of text section. */
2005-07-27 22:44:44 +04:00
_ _ etext = . ;
2009-09-23 15:21:57 +04:00
EXCEPTION_ T A B L E ( 4 )
2005-07-27 22:44:44 +04:00
RODATA
. = ALIGN ( 4 ) ;
_ _ _ data_ s t a r t = . ;
_ _ Sdata = . ;
2008-10-23 01:57:53 +04:00
.data : { /* Data */
2010-08-04 16:01:28 +04:00
CACHELINE_ A L I G N E D _ D A T A ( 3 2 )
READ_ M O S T L Y _ D A T A ( 3 2 )
2007-06-17 06:28:26 +04:00
DATA_ D A T A
2005-07-27 22:44:44 +04:00
}
2008-10-23 01:57:53 +04:00
_ _ edata = . ; /* End of data section. */
2005-07-27 22:44:44 +04:00
_ edata = . ;
2009-09-23 15:21:57 +04:00
INIT_ T A S K _ D A T A _ S E C T I O N ( P A G E _ S I Z E )
2005-07-27 22:44:44 +04:00
2008-10-23 01:57:53 +04:00
. = ALIGN( P A G E _ S I Z E ) ; /* Init code and data. */
2008-01-30 14:57:31 +03:00
_ _ init_ b e g i n = . ;
2009-09-23 15:21:57 +04:00
INIT_ T E X T _ S E C T I O N ( P A G E _ S I Z E )
2008-01-20 16:15:03 +03:00
.init .data : { INIT_ D A T A }
2009-09-23 15:21:57 +04:00
.init .setup : { INIT_ S E T U P ( 1 6 ) }
2008-01-30 14:57:31 +03:00
.initcall .init : {
2009-09-23 15:21:57 +04:00
INIT_ C A L L S
2005-07-27 22:44:44 +04:00
}
.con_initcall .init : {
2009-09-23 15:21:57 +04:00
CON_ I N I T C A L L
2005-07-27 22:44:44 +04:00
}
SECURITY_ I N I T
2010-08-04 16:10:04 +04: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
* /
.exit .text : {
EXIT_ T E X T
}
.exit .data : {
EXIT_ D A T A
}
2008-10-23 01:57:53 +04:00
# ifdef C O N F I G _ E T R A X _ A R C H _ V 1 0
# ifdef C O N F I G _ B L K _ D E V _ I N I T R D
.init .ramfs : {
_ _ initramfs_ s t a r t = . ;
* ( .init .ramfs )
_ _ initramfs_ e n d = . ;
}
# endif
# endif
_ _ vmlinux_ e n d = . ; /* Last address of the physical file. */
# ifdef C O N F I G _ E T R A X _ A R C H _ V 3 2
2011-03-24 20:50:09 +03:00
PERCPU_ S E C T I O N ( 3 2 )
2005-07-27 22:44:44 +04:00
.init .ramfs : {
2009-09-23 15:21:57 +04:00
INIT_ R A M _ F S
2005-07-27 22:44:44 +04:00
}
2008-10-23 01:57:53 +04:00
# endif
2005-07-27 22:44:44 +04:00
2008-01-30 14:57:31 +03:00
/ *
* We f i l l t o t h e n e x t p a g e , s o w e c a n d i s c a r d a l l i n i t
* pages w i t h o u t n e e d i n g t o c o n s i d e r w h a t p a y l o a d m i g h t b e
* appended t o t h e k e r n e l i m a g e .
* /
2008-10-23 01:57:53 +04:00
. = ALIGN( P A G E _ S I Z E ) ;
2008-01-30 14:57:31 +03:00
_ _ init_ e n d = . ;
2005-07-27 22:44:44 +04:00
2008-10-23 01:57:53 +04:00
_ _ data_ e n d = . ; /* Move to _edata ? */
2010-08-04 20:30:01 +04:00
BSS_ S E C T I O N ( 1 , 1 , 1 )
2005-07-27 22:44:44 +04:00
. = ALIGN ( 0 x20 ) ;
_ end = . ;
_ _ end = . ;
2008-01-30 14:57:31 +03:00
dram_ e n d = d r a m _ s t a r t + ( C O N F I G _ E T R A X _ D R A M _ S I Z E - _ _ C O N F I G _ E T R A X _ V M E M _ S I Z E ) * 1 0 2 4 * 1 0 2 4 ;
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 06:27:40 +04:00
DISCARDS
2005-07-27 22:44:44 +04:00
}