2005-04-17 02:20:36 +04:00
/ * Kernel l i n k l a y o u t f o r v a r i o u s " s e c t i o n s "
*
* Copyright ( C ) 1 9 9 9 - 2 0 0 3 M a t t h e w W i l c o x < w i l l y a t p a r i s c - l i n u x . o r g >
* Copyright ( C ) 2 0 0 0 - 2 0 0 3 P a u l B a m e < b a m e a t p a r i s c - l i n u x . o r g >
* Copyright ( C ) 2 0 0 0 J o h n M a r v i n < j s m a t p a r i s c - l i n u x . o r g >
* Copyright ( C ) 2 0 0 0 M i c h a e l A n g < m a n g w i t h s u b c a r r i e r . o r g >
* Copyright ( C ) 2 0 0 2 R a n d o l p h C h u n g < t a u s q w i t h p a r i s c - l i n u x . o r g >
* Copyright ( C ) 2 0 0 3 J a m e s B o t t o m l e y < j e j b w i t h p a r i s c - l i n u x . o r g >
2006-04-21 00:40:23 +04:00
* Copyright ( C ) 2 0 0 6 H e l g e D e l l e r < d e l l e r @gmx.de>
2005-04-17 02:20:36 +04:00
*
*
* This p r o g r a m i s f r e e s o f t w a r e ; you can redistribute it and/or modify
* it u n d e r t h e t e r m s o f t h e G N U G e n e r a l P u b l i c L i c e n s e a s p u b l i s h e d b y
* the F r e e S o f t w a r e F o u n d a t i o n ; either version 2 of the License, or
* ( at y o u r o p t i o n ) a n y l a t e r v e r s i o n .
*
* This p r o g r a m i s d i s t r i b u t e d i n t h e h o p e t h a t i t w i l l b e u s e f u l ,
* but W I T H O U T A N Y W A R R A N T Y ; without even the implied warranty of
* MERCHANTABILITY o r F I T N E S S F O R A P A R T I C U L A R P U R P O S E . S e e t h e
* GNU G e n e r a l P u b l i c L i c e n s e f o r m o r e d e t a i l s .
*
* You s h o u l d h a v e r e c e i v e d a c o p y o f t h e G N U G e n e r a l P u b l i c L i c e n s e
* along w i t h t h i s p r o g r a m ; if not, write to the Free Software
* Foundation, I n c . , 5 9 T e m p l e P l a c e , S u i t e 3 3 0 , B o s t o n , M A 0 2 1 1 1 - 1 3 0 7 U S A
* /
# include < a s m - g e n e r i c / v m l i n u x . l d s . h >
/* needed for the processor specific cache alignment size */
# include < a s m / c a c h e . h >
# include < a s m / p a g e . h >
2006-04-21 00:40:23 +04:00
# include < a s m / a s m - o f f s e t s . h >
2009-09-28 02:39:47 +04:00
# include < a s m / t h r e a d _ i n f o . h >
2005-04-17 02:20:36 +04:00
/* ld script to make hppa Linux kernel */
# ifndef C O N F I G _ 6 4 B I T
OUTPUT_ F O R M A T ( " e l f32 - h p p a - l i n u x " )
OUTPUT_ A R C H ( h p p a )
# else
OUTPUT_ F O R M A T ( " e l f64 - h p p a - l i n u x " )
OUTPUT_ A R C H ( h p p a : h p p a2 . 0 w )
# endif
ENTRY( _ s t e x t )
# ifndef C O N F I G _ 6 4 B I T
jiffies = j i f f i e s _ 6 4 + 4 ;
# else
jiffies = j i f f i e s _ 6 4 ;
# endif
SECTIONS
{
2007-10-18 11:04:25 +04:00
. = KERNEL_ B I N A R Y _ T E X T _ S T A R T ;
2005-04-17 02:20:36 +04:00
2007-10-18 11:04:25 +04:00
_ text = . ; /* Text and read-only data */
2012-05-17 18:34:34 +04:00
.head ALIGN( 1 6 ) : {
2008-05-22 22:38:26 +04:00
HEAD_ T E X T
2012-05-17 18:34:34 +04:00
} = 0
.text ALIGN( 1 6 ) : {
2007-10-18 11:04:25 +04:00
TEXT_ T E X T
SCHED_ T E X T
LOCK_ T E X T
2009-02-09 02:43:36 +03:00
KPROBES_ T E X T
IRQENTRY_ T E X T
2007-10-18 11:04:25 +04:00
* ( .text .do_softirq )
* ( .text .sys_exit )
* ( .text .do_sigaltstack )
* ( .text .do_fork )
* ( .text . * )
* ( .fixup )
* ( .lock .text ) /* out-of-line lock text */
* ( .gnu .warning )
2012-05-17 18:34:34 +04:00
}
2007-10-18 11:04:25 +04:00
/* End of text section */
_ etext = . ;
2005-04-17 02:20:36 +04:00
2011-05-20 05:34:58 +04:00
/* Start of data section */
_ sdata = . ;
2007-10-18 11:04:25 +04:00
RODATA
2005-04-17 02:20:36 +04:00
2007-10-18 11:04:25 +04:00
/* writeable */
/ * Make s u r e t h i s i s p a g e a l i g n e d s o
* that w e c a n p r o p e r l y l e a v e t h e s e
* as w r i t a b l e
* /
2007-10-18 11:04:34 +04:00
. = ALIGN( P A G E _ S I Z E ) ;
2007-10-18 11:04:25 +04:00
data_ s t a r t = . ;
2007-08-27 07:28:34 +04:00
2007-10-18 11:04:25 +04:00
/* unwind info */
.PARISC .unwind : {
_ _ start_ _ _ u n w i n d = . ;
* ( .PARISC .unwind )
_ _ stop_ _ _ u n w i n d = . ;
}
2006-04-21 00:40:23 +04:00
2009-11-28 23:33:11 +03:00
EXCEPTION_ T A B L E ( 1 6 )
NOTES
2007-10-18 11:04:25 +04:00
/* Data */
2009-09-24 18:36:17 +04:00
RW_ D A T A _ S E C T I O N ( 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 )
2005-04-17 02:20:36 +04:00
2007-10-18 11:04:25 +04:00
/* PA-RISC locks requires 16-byte alignment */
. = ALIGN( 1 6 ) ;
2010-02-20 03:03:55 +03:00
.data . .lock_aligned : {
* ( .data . .lock_aligned )
2007-10-18 11:04:25 +04:00
}
2005-04-17 02:20:36 +04:00
2007-10-18 11:04:25 +04:00
/* End of data section */
_ edata = . ;
2005-04-17 02:20:36 +04:00
2007-10-18 11:04:25 +04:00
/* BSS */
_ _ bss_ s t a r t = . ;
/* page table entries need to be PAGE_SIZE aligned */
2007-10-18 11:04:34 +04:00
. = ALIGN( P A G E _ S I Z E ) ;
2010-02-20 03:03:45 +03:00
.data . .vmpages : {
* ( .data . .vm0 .pmd )
* ( .data . .vm0 .pgd )
* ( .data . .vm0 .pte )
2007-10-18 11:04:25 +04:00
}
.bss : {
* ( .bss )
* ( COMMON)
2006-04-21 00:40:23 +04:00
}
2007-10-18 11:04:25 +04:00
_ _ bss_ s t o p = . ;
2006-04-21 00:40:23 +04:00
2005-04-17 02:20:36 +04:00
# ifdef C O N F I G _ 6 4 B I T
2007-10-18 11:04:25 +04:00
. = ALIGN( 1 6 ) ;
/* Linkage tables */
.opd : {
* ( .opd )
} PROVIDE ( _ _ g p = . ) ;
.plt : {
* ( .plt )
}
.dlt : {
* ( .dlt )
}
2005-04-17 02:20:36 +04:00
# endif
2007-10-18 11:04:25 +04:00
/* reserve space for interrupt stack by aligning __init* to 16k */
. = ALIGN( 1 6 3 8 4 ) ;
_ _ init_ b e g i n = . ;
2009-09-24 18:36:17 +04:00
INIT_ T E X T _ S E C T I O N ( 1 6 3 8 4 )
2011-04-15 03:25:21 +04:00
. = ALIGN( P A G E _ S I Z E ) ;
2009-09-24 18:36:17 +04:00
INIT_ D A T A _ S E C T I O N ( 1 6 )
2009-09-28 02:39:47 +04:00
/* we have to discard exit text and such at runtime, not link time */
.exit .text :
{
EXIT_ T E X T
}
.exit .data :
{
EXIT_ D A T A
}
2007-10-18 11:04:25 +04:00
2011-03-24 20:50:09 +03:00
PERCPU_ S E C T I O N ( L 1 _ C A C H E _ B Y T E S )
2007-10-18 11:04:34 +04:00
. = ALIGN( P A G E _ S I Z E ) ;
2007-10-18 11:04:25 +04:00
_ _ init_ e n d = . ;
/* freed after init ends here */
_ end = . ;
2007-07-19 12:48:12 +04:00
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
STABS_ D E B U G
.note 0 : { * ( .note ) }
2007-10-18 11:04:25 +04:00
/* Sections to be discarded */
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
2007-10-18 11:04:25 +04:00
/ DISCARD/ : {
2005-04-17 02:20:36 +04:00
# ifdef C O N F I G _ 6 4 B I T
2007-10-18 11:04:25 +04:00
/ * temporary h a c k u n t i l b i n u t i l s i s f i x e d t o n o t e m i t t h e s e
* for s t a t i c b i n a r i e s
* /
* ( .interp )
* ( .dynsym )
* ( .dynstr )
* ( .dynamic )
* ( .hash )
* ( .gnu .hash )
2005-04-17 02:20:36 +04:00
# endif
}
}