2006-02-02 14:31:16 +00:00
# include < a s m / a s m - o f f s e t s . h >
2012-07-19 09:11:14 +02:00
# include < a s m / t h r e a d _ i n f o . h >
2012-08-14 11:08:01 -07:00
2012-12-28 15:15:25 +01:00
# define P A G E _ S I Z E _ P A G E _ S I Z E
2012-08-14 11:08:01 -07:00
/ *
* Put . b s s . . s w a p p e r _ p g _ d i r a s t h e f i r s t t h i n g i n . b s s . T h i s w i l l
* ensure t h a t i t h a s . b s s a l i g n m e n t ( 6 4 K ) .
* /
# define B S S _ F I R S T _ S E C T I O N S * ( . b s s . . s w a p p e r _ p g _ d i r )
2005-04-16 15:20:36 -07:00
# include < a s m - g e n e r i c / v m l i n u x . l d s . h >
2006-04-05 09:45:45 +01:00
# undef m i p s
2005-04-16 15:20:36 -07:00
# define m i p s m i p s
OUTPUT_ A R C H ( m i p s )
ENTRY( k e r n e l _ e n t r y )
2007-10-14 22:49:01 +01:00
PHDRS {
text P T _ L O A D F L A G S ( 7 ) ; /* RWX */
2015-10-30 00:54:48 +02:00
# ifndef C O N F I G _ C A V I U M _ O C T E O N _ S O C
2007-10-14 22:49:01 +01:00
note P T _ N O T E F L A G S ( 4 ) ; /* R__ */
2015-10-30 00:54:48 +02:00
# endif / * C A V I U M _ O C T E O N _ S O C * /
2007-10-14 22:49:01 +01:00
}
2009-09-20 12:28:22 +02:00
2009-09-24 21:44:24 +02:00
# ifdef C O N F I G _ 3 2 B I T
# ifdef C O N F I G _ C P U _ L I T T L E _ E N D I A N
2013-01-22 12:59:30 +01:00
jiffies = j i f f i e s _ 6 4 ;
2009-09-24 21:44:24 +02:00
# else
2013-01-22 12:59:30 +01:00
jiffies = j i f f i e s _ 6 4 + 4 ;
2009-09-24 21:44:24 +02:00
# endif
# else
2013-01-22 12:59:30 +01:00
jiffies = j i f f i e s _ 6 4 ;
2009-09-24 21:44:24 +02:00
# endif
2007-09-15 23:35:53 +02:00
2005-04-16 15:20:36 -07:00
SECTIONS
{
# ifdef C O N F I G _ B O O T _ E L F 6 4
2007-09-15 23:35:53 +02:00
/* Read-only sections, merged into text segment: */
/* . = 0xc000000000000000; */
2005-04-16 15:20:36 -07:00
2007-09-15 23:35:53 +02:00
/* This is the value for an Origin kernel, taken from an IRIX kernel. */
/* . = 0xc00000000001c000; */
2005-04-16 15:20:36 -07:00
2007-09-15 23:35:53 +02:00
/ * Set t h e v a d d r f o r t h e t e x t s e g m e n t t o a v a l u e
* > = 0 xa8 0 0 0 0 0 0 0 0 0 1 9 0 0 0 i f n o s y m m o n i s g o i n g t o c o n f i g u r e d
* > = 0 xa8 0 0 0 0 0 0 0 0 3 0 0 0 0 0 o t h e r w i s e
* /
2005-04-16 15:20:36 -07:00
2007-09-15 23:35:53 +02:00
/* . = 0xa800000000300000; */
. = 0 xffffffff8 0 3 0 0 0 0 0 ;
2005-04-16 15:20:36 -07:00
# endif
2009-09-20 12:28:22 +02:00
. = VMLINUX_ L O A D _ A D D R E S S ;
2007-09-15 23:35:53 +02:00
/* read-only */
_ text = . ; /* Text and read-only data */
.text : {
TEXT_ T E X T
SCHED_ T E X T
LOCK_ T E X T
2007-10-14 22:50:05 +01:00
KPROBES_ T E X T
2009-11-20 20:34:33 +08:00
IRQENTRY_ T E X T
2016-03-25 14:22:05 -07:00
SOFTIRQENTRY_ T E X T
2008-08-05 23:45:14 +09:00
* ( .text . * )
2007-09-15 23:35:53 +02:00
* ( .fixup )
* ( .gnu .warning )
2007-10-14 22:49:01 +01:00
} : text = 0
2007-09-15 23:35:53 +02:00
_ etext = . ; /* End of text section */
2009-07-31 16:58:19 -04:00
EXCEPTION_ T A B L E ( 1 6 )
2007-09-15 23:35:53 +02:00
/* Exception table for data bus errors */
_ _ dbe_ t a b l e : {
_ _ start_ _ _ d b e _ t a b l e = . ;
* ( _ _ dbe_ t a b l e )
_ _ stop_ _ _ d b e _ t a b l e = . ;
}
2007-10-14 22:49:01 +01:00
2015-10-30 00:54:48 +02:00
# ifdef C O N F I G _ C A V I U M _ O C T E O N _ S O C
# define N O T E S _ H E A D E R
# else / * C O N F I G _ C A V I U M _ O C T E O N _ S O C * /
# define N O T E S _ H E A D E R : n o t e
# endif / * C O N F I G _ C A V I U M _ O C T E O N _ S O C * /
NOTES : t e x t N O T E S _ H E A D E R
2007-10-14 22:49:01 +01:00
.dummy : { * ( .dummy ) } : text
2011-05-19 21:34:58 -04:00
_ sdata = . ; /* Start of data section */
2007-09-15 23:35:53 +02:00
RODATA
/* writeable */
.data : { /* Data */
2007-10-18 23:12:32 +02:00
. = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
2007-09-15 23:35:53 +02:00
2012-07-19 09:11:14 +02:00
INIT_ T A S K _ D A T A ( T H R E A D _ S I Z E )
2009-07-31 16:58:19 -04:00
NOSAVE_ D A T A
CACHELINE_ A L I G N E D _ D A T A ( 1 < < C O N F I G _ M I P S _ L 1 _ C A C H E _ S H I F T )
2011-03-29 11:40:06 +01:00
READ_ M O S T L Y _ D A T A ( 1 < < C O N F I G _ M I P S _ L 1 _ C A C H E _ S H I F T )
2007-10-18 23:12:32 +02:00
DATA_ D A T A
CONSTRUCTORS
2007-09-15 23:35:53 +02:00
}
_ gp = . + 0 x80 0 0 ;
.lit8 : {
* ( .lit8 )
}
.lit4 : {
* ( .lit4 )
}
/ * We w a n t t h e s m a l l d a t a s e c t i o n s t o g e t h e r , s o s i n g l e - i n s t r u c t i o n o f f s e t s
can a c c e s s t h e m a l l , a n d i n i t i a l i z e d d a t a a l l b e f o r e u n i n i t i a l i z e d , s o
we c a n s h o r t e n t h e o n - d i s k s e g m e n t s i z e . * /
.sdata : {
* ( .sdata )
}
_ edata = . ; /* End of data section */
/* will be freed after init */
2009-07-31 16:58:18 -04:00
. = ALIGN( P A G E _ S I Z E ) ; /* Init code and data */
2007-09-15 23:35:53 +02:00
_ _ init_ b e g i n = . ;
2009-07-31 16:58:19 -04:00
INIT_ T E X T _ S E C T I O N ( P A G E _ S I Z E )
INIT_ D A T A _ S E C T I O N ( 1 6 )
2007-09-15 23:35:53 +02:00
2010-11-23 16:06:25 +01:00
. = ALIGN( 4 ) ;
.mips .machines .init : AT( A D D R ( . m i p s . m a c h i n e s . i n i t ) - L O A D _ O F F S E T ) {
_ _ mips_ m a c h i n e s _ s t a r t = . ;
* ( .mips .machines .init )
_ _ mips_ m a c h i n e s _ e n d = . ;
}
2007-09-15 23:35:53 +02: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 , t o d e a l w i t h
* references f r o m . r o d a t a
* /
.exit .text : {
2008-01-20 14:15:03 +01:00
EXIT_ T E X T
2007-09-15 23:35:53 +02:00
}
.exit .data : {
2008-01-20 14:15:03 +01:00
EXIT_ D A T A
2007-09-15 23:35:53 +02:00
}
2015-04-12 12:24:58 +02:00
# ifdef C O N F I G _ S M P
2011-03-24 18:50:09 +01:00
PERCPU_ S E C T I O N ( 1 < < C O N F I G _ M I P S _ L 1 _ C A C H E _ S H I F T )
2015-04-12 12:24:58 +02:00
# endif
2016-03-31 10:05:34 +01:00
# ifdef C O N F I G _ R E L O C A T A B L E
. = ALIGN( 4 ) ;
.data .reloc : {
_ relocation_ s t a r t = . ;
/ *
* Space f o r r e l o c a t i o n t a b l e
* This n e e d s t o b e f i l l e d s o t h a t t h e
* relocs t o o l c a n o v e r w r i t e t h e c o n t e n t .
* An i n v a l i d v a l u e i s l e f t a t t h e s t a r t o f t h e
* section t o a b o r t r e l o c a t i o n i f t h e t a b l e
* has n o t b e e n f i l l e d i n .
* /
LONG( 0 x F F F F F F F F ) ;
FILL( 0 ) ;
. + = CONFIG_ R E L O C A T I O N _ T A B L E _ S I Z E - 4 ;
_ relocation_ e n d = . ;
}
# endif
2015-04-12 12:24:58 +02:00
# ifdef C O N F I G _ M I P S _ R A W _ A P P E N D E D _ D T B
_ _ appended_ d t b = . ;
/* leave space for appended DTB */
. + = 0 x1 0 0 0 0 0 ;
2015-09-11 17:46:14 +03:00
# elif d e f i n e d ( C O N F I G _ M I P S _ E L F _ A P P E N D E D _ D T B )
.appended_dtb : AT( A D D R ( . a p p e n d e d _ d t b ) - L O A D _ O F F S E T ) {
* ( .appended_dtb )
KEEP( * ( . a p p e n d e d _ d t b ) )
}
2015-04-12 12:24:58 +02:00
# endif
2012-08-14 11:08:01 -07:00
/ *
* Align t o 6 4 K i n a t t e m p t t o e l i m i n a t e h o l e s b e f o r e t h e
* .bss . .swapper_pg_dir section at t h e s t a r t o f . b s s . T h i s
* also s a t i s f i e s P A G E _ S I Z E a l i g n m e n t a s t h e l a r g e s t p a g e s i z e
* allowed i s 6 4 K .
* /
. = ALIGN( 0 x10 0 0 0 ) ;
2007-09-15 23:35:53 +02:00
_ _ init_ e n d = . ;
/* freed after init ends here */
2012-08-14 11:08:01 -07:00
/ *
* Force . b s s t o 6 4 K a l i g n m e n t s o t h a t . b s s . . s w a p p e r _ p g _ d i r
2013-01-22 12:59:30 +01:00
* gets t h a t a l i g n m e n t . . s b s s s h o u l d b e e m p t y , s o t h e r e w i l l b e
2012-08-14 11:08:01 -07:00
* no h o l e s a f t e r _ _ i n i t _ e n d . * /
BSS_ S E C T I O N ( 0 , 0 x10 0 0 0 , 0 )
2007-09-15 23:35:53 +02:00
_ end = . ;
/* These mark the ABI of the kernel for debuggers. */
.mdebug .abi32 : {
KEEP( * ( . m d e b u g . a b i 3 2 ) )
}
.mdebug .abi64 : {
KEEP( * ( . m d e b u g . a b i 6 4 ) )
}
/* This is the MIPS specific mdebug section. */
.mdebug : {
* ( .mdebug )
}
STABS_ D E B U G
DWARF_ D E B U G
/* These must appear regardless of . */
.gptab .sdata : {
* ( .gptab .data )
* ( .gptab .sdata )
}
.gptab .sbss : {
* ( .gptab .bss )
* ( .gptab .sbss )
}
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
/ DISCARD/ : {
/* ABI crap starts here */
2015-10-30 00:54:47 +02:00
* ( .MIPS .abiflags )
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
* ( .MIPS .options )
* ( .options )
* ( .pdr )
* ( .reginfo )
2013-08-08 11:40:49 -07:00
* ( .eh_frame )
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
}
2005-04-16 15:20:36 -07:00
}