2005-04-17 05:20:36 +07:00
|
|
|
/* ld script to make ARM Linux kernel
|
|
|
|
* taken from the i386 version by Russell King
|
|
|
|
* Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <asm-generic/vmlinux.lds.h>
|
2005-05-05 19:11:00 +07:00
|
|
|
#include <asm/thread_info.h>
|
2005-10-30 03:44:56 +07:00
|
|
|
#include <asm/memory.h>
|
2009-06-25 05:38:56 +07:00
|
|
|
#include <asm/page.h>
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2010-10-01 21:37:05 +07:00
|
|
|
#define PROC_INFO \
|
|
|
|
VMLINUX_SYMBOL(__proc_info_begin) = .; \
|
|
|
|
*(.proc.info.init) \
|
|
|
|
VMLINUX_SYMBOL(__proc_info_end) = .;
|
|
|
|
|
|
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
|
|
#define ARM_CPU_DISCARD(x)
|
|
|
|
#define ARM_CPU_KEEP(x) x
|
|
|
|
#else
|
|
|
|
#define ARM_CPU_DISCARD(x) x
|
|
|
|
#define ARM_CPU_KEEP(x)
|
|
|
|
#endif
|
|
|
|
|
2011-02-21 17:13:36 +07:00
|
|
|
#if defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)
|
|
|
|
#define ARM_EXIT_KEEP(x) x
|
ARM: fix vmlinux.lds.S discarding sections
We are seeing linker errors caused by sections being discarded, despite
the linker script trying to keep them. The result is (eg):
`.exit.text' referenced in section `.alt.smp.init' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
`.exit.text' referenced in section `.alt.smp.init' of net/built-in.o: defined in discarded section `.exit.text' of net/built-in.o
This is the relevent part of the linker script (reformatted to make it
clearer):
| SECTIONS
| {
| /*
| * unwind exit sections must be discarded before the rest of the
| * unwind sections get included.
| */
| /DISCARD/ : {
| *(.ARM.exidx.exit.text)
| *(.ARM.extab.exit.text)
| }
| ...
| .exit.text : {
| *(.exit.text)
| *(.memexit.text)
| }
| ...
| /DISCARD/ : {
| *(.exit.text)
| *(.memexit.text)
| *(.exit.data)
| *(.memexit.data)
| *(.memexit.rodata)
| *(.exitcall.exit)
| *(.discard)
| *(.discard.*)
| }
| }
Now, this is what the linker manual says about discarded output sections:
| The special output section name `/DISCARD/' may be used to discard
| input sections. Any input sections which are assigned to an output
| section named `/DISCARD/' are not included in the output file.
No questions, no exceptions. It doesn't say "unless they are listed
before the /DISCARD/ section." Now, this is what asn-generic/vmlinux.lds.S
says:
| /*
| * Default discarded sections.
| *
| * Some archs want to discard exit text/data at runtime rather than
| * link time due to cross-section references such as alt instructions,
| * bug table, eh_frame, etc. DISCARDS must be the last of output
| * section definitions so that such archs put those in earlier section
| * definitions.
| */
And guess what - the list _always_ includes .exit.text etc.
Now, what's actually happening is that the linker is reading the script,
and it finds the first /DISCARD/ output section at the beginning of the
script. It continues reading the script, and finds the 'DISCARD' macro
at the end, which having been postprocessed results in another
/DISCARD/ output section. As the linker already contains the earlier
/DISCARD/ output section, it adds it to that existing section, so it
effectively is placed at the start. This can be seen by using the -M
option to ld:
| Linker script and memory map
|
| 0xc037c080 jiffies = jiffies_64
|
| /DISCARD/
| *(.ARM.exidx.exit.text)
| *(.ARM.extab.exit.text)
| *(.exit.text)
| *(.memexit.text)
| *(.exit.data)
| *(.memexit.data)
| *(.memexit.rodata)
| *(.exitcall.exit)
| *(.discard)
| *(.discard.*)
|
| 0xc0008000 . = 0xc0008000
|
| .head.text 0xc0008000 0x1d0
| 0xc0008000 _text = .
| *(.head.text)
| .head.text 0xc0008000 0x1d0 arch/arm/kernel/head.o
| 0xc0008000 stext
|
| .text 0xc0008200 0x2d78d0
| 0xc0008200 _stext = .
| 0xc0008200 __exception_text_start = .
| *(.exception.text)
| .exception.text
| ...
As you can see, all the discarded sections are grouped together - and
as a result of it being the first output section, they all appear before
any other section.
The result is that not only is the unwind information discarded (as
intended), but also the .exit.text, despite us wanting to have the
.exit.text preserved.
We can't move the unwind information elsewhere, because it'll then be
included even when we do actually discard the .exit.text (and similar)
sections.
So, work around this by avoiding the generic DISCARDS macro, and instead
conditionalize the sections to be discarded ourselves. This avoids the
ambiguity in how the linker assigns input sections to output sections,
making our script less dependent on undocumented linker behaviour.
Reported-by: Rob Herring <robherring2@gmail.com>
Tested-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-09-21 05:35:15 +07:00
|
|
|
#define ARM_EXIT_DISCARD(x)
|
2011-02-21 17:13:36 +07:00
|
|
|
#else
|
|
|
|
#define ARM_EXIT_KEEP(x)
|
ARM: fix vmlinux.lds.S discarding sections
We are seeing linker errors caused by sections being discarded, despite
the linker script trying to keep them. The result is (eg):
`.exit.text' referenced in section `.alt.smp.init' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
`.exit.text' referenced in section `.alt.smp.init' of net/built-in.o: defined in discarded section `.exit.text' of net/built-in.o
This is the relevent part of the linker script (reformatted to make it
clearer):
| SECTIONS
| {
| /*
| * unwind exit sections must be discarded before the rest of the
| * unwind sections get included.
| */
| /DISCARD/ : {
| *(.ARM.exidx.exit.text)
| *(.ARM.extab.exit.text)
| }
| ...
| .exit.text : {
| *(.exit.text)
| *(.memexit.text)
| }
| ...
| /DISCARD/ : {
| *(.exit.text)
| *(.memexit.text)
| *(.exit.data)
| *(.memexit.data)
| *(.memexit.rodata)
| *(.exitcall.exit)
| *(.discard)
| *(.discard.*)
| }
| }
Now, this is what the linker manual says about discarded output sections:
| The special output section name `/DISCARD/' may be used to discard
| input sections. Any input sections which are assigned to an output
| section named `/DISCARD/' are not included in the output file.
No questions, no exceptions. It doesn't say "unless they are listed
before the /DISCARD/ section." Now, this is what asn-generic/vmlinux.lds.S
says:
| /*
| * Default discarded sections.
| *
| * Some archs want to discard exit text/data at runtime rather than
| * link time due to cross-section references such as alt instructions,
| * bug table, eh_frame, etc. DISCARDS must be the last of output
| * section definitions so that such archs put those in earlier section
| * definitions.
| */
And guess what - the list _always_ includes .exit.text etc.
Now, what's actually happening is that the linker is reading the script,
and it finds the first /DISCARD/ output section at the beginning of the
script. It continues reading the script, and finds the 'DISCARD' macro
at the end, which having been postprocessed results in another
/DISCARD/ output section. As the linker already contains the earlier
/DISCARD/ output section, it adds it to that existing section, so it
effectively is placed at the start. This can be seen by using the -M
option to ld:
| Linker script and memory map
|
| 0xc037c080 jiffies = jiffies_64
|
| /DISCARD/
| *(.ARM.exidx.exit.text)
| *(.ARM.extab.exit.text)
| *(.exit.text)
| *(.memexit.text)
| *(.exit.data)
| *(.memexit.data)
| *(.memexit.rodata)
| *(.exitcall.exit)
| *(.discard)
| *(.discard.*)
|
| 0xc0008000 . = 0xc0008000
|
| .head.text 0xc0008000 0x1d0
| 0xc0008000 _text = .
| *(.head.text)
| .head.text 0xc0008000 0x1d0 arch/arm/kernel/head.o
| 0xc0008000 stext
|
| .text 0xc0008200 0x2d78d0
| 0xc0008200 _stext = .
| 0xc0008200 __exception_text_start = .
| *(.exception.text)
| .exception.text
| ...
As you can see, all the discarded sections are grouped together - and
as a result of it being the first output section, they all appear before
any other section.
The result is that not only is the unwind information discarded (as
intended), but also the .exit.text, despite us wanting to have the
.exit.text preserved.
We can't move the unwind information elsewhere, because it'll then be
included even when we do actually discard the .exit.text (and similar)
sections.
So, work around this by avoiding the generic DISCARDS macro, and instead
conditionalize the sections to be discarded ourselves. This avoids the
ambiguity in how the linker assigns input sections to output sections,
making our script less dependent on undocumented linker behaviour.
Reported-by: Rob Herring <robherring2@gmail.com>
Tested-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-09-21 05:35:15 +07:00
|
|
|
#define ARM_EXIT_DISCARD(x) x
|
2011-02-21 17:13:36 +07:00
|
|
|
#endif
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
OUTPUT_ARCH(arm)
|
|
|
|
ENTRY(stext)
|
2005-10-30 03:44:56 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
#ifndef __ARMEB__
|
|
|
|
jiffies = jiffies_64;
|
|
|
|
#else
|
|
|
|
jiffies = jiffies_64 + 4;
|
|
|
|
#endif
|
2005-10-30 03:44:56 +07:00
|
|
|
|
2006-01-04 00:28:33 +07:00
|
|
|
SECTIONS
|
|
|
|
{
|
2011-05-26 17:25:33 +07:00
|
|
|
/*
|
ARM: fix vmlinux.lds.S discarding sections
We are seeing linker errors caused by sections being discarded, despite
the linker script trying to keep them. The result is (eg):
`.exit.text' referenced in section `.alt.smp.init' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
`.exit.text' referenced in section `.alt.smp.init' of net/built-in.o: defined in discarded section `.exit.text' of net/built-in.o
This is the relevent part of the linker script (reformatted to make it
clearer):
| SECTIONS
| {
| /*
| * unwind exit sections must be discarded before the rest of the
| * unwind sections get included.
| */
| /DISCARD/ : {
| *(.ARM.exidx.exit.text)
| *(.ARM.extab.exit.text)
| }
| ...
| .exit.text : {
| *(.exit.text)
| *(.memexit.text)
| }
| ...
| /DISCARD/ : {
| *(.exit.text)
| *(.memexit.text)
| *(.exit.data)
| *(.memexit.data)
| *(.memexit.rodata)
| *(.exitcall.exit)
| *(.discard)
| *(.discard.*)
| }
| }
Now, this is what the linker manual says about discarded output sections:
| The special output section name `/DISCARD/' may be used to discard
| input sections. Any input sections which are assigned to an output
| section named `/DISCARD/' are not included in the output file.
No questions, no exceptions. It doesn't say "unless they are listed
before the /DISCARD/ section." Now, this is what asn-generic/vmlinux.lds.S
says:
| /*
| * Default discarded sections.
| *
| * Some archs want to discard exit text/data at runtime rather than
| * link time due to cross-section references such as alt instructions,
| * bug table, eh_frame, etc. DISCARDS must be the last of output
| * section definitions so that such archs put those in earlier section
| * definitions.
| */
And guess what - the list _always_ includes .exit.text etc.
Now, what's actually happening is that the linker is reading the script,
and it finds the first /DISCARD/ output section at the beginning of the
script. It continues reading the script, and finds the 'DISCARD' macro
at the end, which having been postprocessed results in another
/DISCARD/ output section. As the linker already contains the earlier
/DISCARD/ output section, it adds it to that existing section, so it
effectively is placed at the start. This can be seen by using the -M
option to ld:
| Linker script and memory map
|
| 0xc037c080 jiffies = jiffies_64
|
| /DISCARD/
| *(.ARM.exidx.exit.text)
| *(.ARM.extab.exit.text)
| *(.exit.text)
| *(.memexit.text)
| *(.exit.data)
| *(.memexit.data)
| *(.memexit.rodata)
| *(.exitcall.exit)
| *(.discard)
| *(.discard.*)
|
| 0xc0008000 . = 0xc0008000
|
| .head.text 0xc0008000 0x1d0
| 0xc0008000 _text = .
| *(.head.text)
| .head.text 0xc0008000 0x1d0 arch/arm/kernel/head.o
| 0xc0008000 stext
|
| .text 0xc0008200 0x2d78d0
| 0xc0008200 _stext = .
| 0xc0008200 __exception_text_start = .
| *(.exception.text)
| .exception.text
| ...
As you can see, all the discarded sections are grouped together - and
as a result of it being the first output section, they all appear before
any other section.
The result is that not only is the unwind information discarded (as
intended), but also the .exit.text, despite us wanting to have the
.exit.text preserved.
We can't move the unwind information elsewhere, because it'll then be
included even when we do actually discard the .exit.text (and similar)
sections.
So, work around this by avoiding the generic DISCARDS macro, and instead
conditionalize the sections to be discarded ourselves. This avoids the
ambiguity in how the linker assigns input sections to output sections,
making our script less dependent on undocumented linker behaviour.
Reported-by: Rob Herring <robherring2@gmail.com>
Tested-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-09-21 05:35:15 +07:00
|
|
|
* XXX: The linker does not define how output sections are
|
|
|
|
* assigned to input sections when there are multiple statements
|
|
|
|
* matching the same input section name. There is no documented
|
|
|
|
* order of matching.
|
|
|
|
*
|
2011-05-26 17:25:33 +07:00
|
|
|
* unwind exit sections must be discarded before the rest of the
|
|
|
|
* unwind sections get included.
|
|
|
|
*/
|
|
|
|
/DISCARD/ : {
|
|
|
|
*(.ARM.exidx.exit.text)
|
|
|
|
*(.ARM.extab.exit.text)
|
|
|
|
ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
|
|
|
|
ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
|
ARM: fix vmlinux.lds.S discarding sections
We are seeing linker errors caused by sections being discarded, despite
the linker script trying to keep them. The result is (eg):
`.exit.text' referenced in section `.alt.smp.init' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
`.exit.text' referenced in section `.alt.smp.init' of net/built-in.o: defined in discarded section `.exit.text' of net/built-in.o
This is the relevent part of the linker script (reformatted to make it
clearer):
| SECTIONS
| {
| /*
| * unwind exit sections must be discarded before the rest of the
| * unwind sections get included.
| */
| /DISCARD/ : {
| *(.ARM.exidx.exit.text)
| *(.ARM.extab.exit.text)
| }
| ...
| .exit.text : {
| *(.exit.text)
| *(.memexit.text)
| }
| ...
| /DISCARD/ : {
| *(.exit.text)
| *(.memexit.text)
| *(.exit.data)
| *(.memexit.data)
| *(.memexit.rodata)
| *(.exitcall.exit)
| *(.discard)
| *(.discard.*)
| }
| }
Now, this is what the linker manual says about discarded output sections:
| The special output section name `/DISCARD/' may be used to discard
| input sections. Any input sections which are assigned to an output
| section named `/DISCARD/' are not included in the output file.
No questions, no exceptions. It doesn't say "unless they are listed
before the /DISCARD/ section." Now, this is what asn-generic/vmlinux.lds.S
says:
| /*
| * Default discarded sections.
| *
| * Some archs want to discard exit text/data at runtime rather than
| * link time due to cross-section references such as alt instructions,
| * bug table, eh_frame, etc. DISCARDS must be the last of output
| * section definitions so that such archs put those in earlier section
| * definitions.
| */
And guess what - the list _always_ includes .exit.text etc.
Now, what's actually happening is that the linker is reading the script,
and it finds the first /DISCARD/ output section at the beginning of the
script. It continues reading the script, and finds the 'DISCARD' macro
at the end, which having been postprocessed results in another
/DISCARD/ output section. As the linker already contains the earlier
/DISCARD/ output section, it adds it to that existing section, so it
effectively is placed at the start. This can be seen by using the -M
option to ld:
| Linker script and memory map
|
| 0xc037c080 jiffies = jiffies_64
|
| /DISCARD/
| *(.ARM.exidx.exit.text)
| *(.ARM.extab.exit.text)
| *(.exit.text)
| *(.memexit.text)
| *(.exit.data)
| *(.memexit.data)
| *(.memexit.rodata)
| *(.exitcall.exit)
| *(.discard)
| *(.discard.*)
|
| 0xc0008000 . = 0xc0008000
|
| .head.text 0xc0008000 0x1d0
| 0xc0008000 _text = .
| *(.head.text)
| .head.text 0xc0008000 0x1d0 arch/arm/kernel/head.o
| 0xc0008000 stext
|
| .text 0xc0008200 0x2d78d0
| 0xc0008200 _stext = .
| 0xc0008200 __exception_text_start = .
| *(.exception.text)
| .exception.text
| ...
As you can see, all the discarded sections are grouped together - and
as a result of it being the first output section, they all appear before
any other section.
The result is that not only is the unwind information discarded (as
intended), but also the .exit.text, despite us wanting to have the
.exit.text preserved.
We can't move the unwind information elsewhere, because it'll then be
included even when we do actually discard the .exit.text (and similar)
sections.
So, work around this by avoiding the generic DISCARDS macro, and instead
conditionalize the sections to be discarded ourselves. This avoids the
ambiguity in how the linker assigns input sections to output sections,
making our script less dependent on undocumented linker behaviour.
Reported-by: Rob Herring <robherring2@gmail.com>
Tested-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-09-21 05:35:15 +07:00
|
|
|
ARM_EXIT_DISCARD(EXIT_TEXT)
|
|
|
|
ARM_EXIT_DISCARD(EXIT_DATA)
|
|
|
|
EXIT_CALL
|
2011-05-26 17:25:33 +07:00
|
|
|
#ifndef CONFIG_HOTPLUG
|
|
|
|
*(.ARM.exidx.devexit.text)
|
|
|
|
*(.ARM.extab.devexit.text)
|
|
|
|
#endif
|
|
|
|
#ifndef CONFIG_MMU
|
|
|
|
*(.fixup)
|
|
|
|
*(__ex_table)
|
|
|
|
#endif
|
|
|
|
#ifndef CONFIG_SMP_ON_UP
|
|
|
|
*(.alt.smp.init)
|
|
|
|
#endif
|
ARM: fix vmlinux.lds.S discarding sections
We are seeing linker errors caused by sections being discarded, despite
the linker script trying to keep them. The result is (eg):
`.exit.text' referenced in section `.alt.smp.init' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
`.exit.text' referenced in section `.alt.smp.init' of net/built-in.o: defined in discarded section `.exit.text' of net/built-in.o
This is the relevent part of the linker script (reformatted to make it
clearer):
| SECTIONS
| {
| /*
| * unwind exit sections must be discarded before the rest of the
| * unwind sections get included.
| */
| /DISCARD/ : {
| *(.ARM.exidx.exit.text)
| *(.ARM.extab.exit.text)
| }
| ...
| .exit.text : {
| *(.exit.text)
| *(.memexit.text)
| }
| ...
| /DISCARD/ : {
| *(.exit.text)
| *(.memexit.text)
| *(.exit.data)
| *(.memexit.data)
| *(.memexit.rodata)
| *(.exitcall.exit)
| *(.discard)
| *(.discard.*)
| }
| }
Now, this is what the linker manual says about discarded output sections:
| The special output section name `/DISCARD/' may be used to discard
| input sections. Any input sections which are assigned to an output
| section named `/DISCARD/' are not included in the output file.
No questions, no exceptions. It doesn't say "unless they are listed
before the /DISCARD/ section." Now, this is what asn-generic/vmlinux.lds.S
says:
| /*
| * Default discarded sections.
| *
| * Some archs want to discard exit text/data at runtime rather than
| * link time due to cross-section references such as alt instructions,
| * bug table, eh_frame, etc. DISCARDS must be the last of output
| * section definitions so that such archs put those in earlier section
| * definitions.
| */
And guess what - the list _always_ includes .exit.text etc.
Now, what's actually happening is that the linker is reading the script,
and it finds the first /DISCARD/ output section at the beginning of the
script. It continues reading the script, and finds the 'DISCARD' macro
at the end, which having been postprocessed results in another
/DISCARD/ output section. As the linker already contains the earlier
/DISCARD/ output section, it adds it to that existing section, so it
effectively is placed at the start. This can be seen by using the -M
option to ld:
| Linker script and memory map
|
| 0xc037c080 jiffies = jiffies_64
|
| /DISCARD/
| *(.ARM.exidx.exit.text)
| *(.ARM.extab.exit.text)
| *(.exit.text)
| *(.memexit.text)
| *(.exit.data)
| *(.memexit.data)
| *(.memexit.rodata)
| *(.exitcall.exit)
| *(.discard)
| *(.discard.*)
|
| 0xc0008000 . = 0xc0008000
|
| .head.text 0xc0008000 0x1d0
| 0xc0008000 _text = .
| *(.head.text)
| .head.text 0xc0008000 0x1d0 arch/arm/kernel/head.o
| 0xc0008000 stext
|
| .text 0xc0008200 0x2d78d0
| 0xc0008200 _stext = .
| 0xc0008200 __exception_text_start = .
| *(.exception.text)
| .exception.text
| ...
As you can see, all the discarded sections are grouped together - and
as a result of it being the first output section, they all appear before
any other section.
The result is that not only is the unwind information discarded (as
intended), but also the .exit.text, despite us wanting to have the
.exit.text preserved.
We can't move the unwind information elsewhere, because it'll then be
included even when we do actually discard the .exit.text (and similar)
sections.
So, work around this by avoiding the generic DISCARDS macro, and instead
conditionalize the sections to be discarded ourselves. This avoids the
ambiguity in how the linker assigns input sections to output sections,
making our script less dependent on undocumented linker behaviour.
Reported-by: Rob Herring <robherring2@gmail.com>
Tested-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-09-21 05:35:15 +07:00
|
|
|
*(.discard)
|
|
|
|
*(.discard.*)
|
2011-05-26 17:25:33 +07:00
|
|
|
}
|
|
|
|
|
2005-10-30 03:44:56 +07:00
|
|
|
#ifdef CONFIG_XIP_KERNEL
|
2006-01-04 00:28:33 +07:00
|
|
|
. = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
|
2005-10-30 03:44:56 +07:00
|
|
|
#else
|
2006-01-04 00:28:33 +07:00
|
|
|
. = PAGE_OFFSET + TEXT_OFFSET;
|
2005-10-30 03:44:56 +07:00
|
|
|
#endif
|
2011-07-06 04:56:41 +07:00
|
|
|
.head.text : {
|
2011-07-06 16:53:22 +07:00
|
|
|
_text = .;
|
2011-07-06 04:56:41 +07:00
|
|
|
HEAD_TEXT
|
|
|
|
}
|
2011-07-06 16:39:34 +07:00
|
|
|
.text : { /* Real text segment */
|
2011-07-06 16:53:22 +07:00
|
|
|
_stext = .; /* Text and read-only data */
|
2011-07-06 16:39:34 +07:00
|
|
|
__exception_text_start = .;
|
|
|
|
*(.exception.text)
|
|
|
|
__exception_text_end = .;
|
|
|
|
IRQENTRY_TEXT
|
|
|
|
TEXT_TEXT
|
|
|
|
SCHED_TEXT
|
|
|
|
LOCK_TEXT
|
|
|
|
KPROBES_TEXT
|
|
|
|
#ifdef CONFIG_MMU
|
|
|
|
*(.fixup)
|
|
|
|
#endif
|
|
|
|
*(.gnu.warning)
|
|
|
|
*(.glue_7)
|
|
|
|
*(.glue_7t)
|
|
|
|
. = ALIGN(4);
|
|
|
|
*(.got) /* Global offset table */
|
|
|
|
ARM_CPU_KEEP(PROC_INFO)
|
|
|
|
}
|
|
|
|
|
|
|
|
RO_DATA(PAGE_SIZE)
|
|
|
|
|
|
|
|
#ifdef CONFIG_ARM_UNWIND
|
|
|
|
/*
|
|
|
|
* Stack unwinding tables
|
|
|
|
*/
|
|
|
|
. = ALIGN(8);
|
|
|
|
.ARM.unwind_idx : {
|
|
|
|
__start_unwind_idx = .;
|
|
|
|
*(.ARM.exidx*)
|
|
|
|
__stop_unwind_idx = .;
|
|
|
|
}
|
|
|
|
.ARM.unwind_tab : {
|
|
|
|
__start_unwind_tab = .;
|
|
|
|
*(.ARM.extab*)
|
|
|
|
__stop_unwind_tab = .;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
_etext = .; /* End of text and rodata section */
|
|
|
|
|
|
|
|
#ifndef CONFIG_XIP_KERNEL
|
|
|
|
. = ALIGN(PAGE_SIZE);
|
|
|
|
__init_begin = .;
|
|
|
|
#endif
|
|
|
|
|
2011-07-06 04:56:41 +07:00
|
|
|
INIT_TEXT_SECTION(8)
|
|
|
|
.exit.text : {
|
|
|
|
ARM_EXIT_KEEP(EXIT_TEXT)
|
|
|
|
}
|
|
|
|
.init.proc.info : {
|
2010-10-01 21:37:05 +07:00
|
|
|
ARM_CPU_DISCARD(PROC_INFO)
|
2011-07-06 04:56:41 +07:00
|
|
|
}
|
|
|
|
.init.arch.info : {
|
2005-04-17 05:20:36 +07:00
|
|
|
__arch_info_begin = .;
|
2011-07-06 04:56:41 +07:00
|
|
|
*(.arch.info.init)
|
2005-04-17 05:20:36 +07:00
|
|
|
__arch_info_end = .;
|
2011-07-06 04:56:41 +07:00
|
|
|
}
|
|
|
|
.init.tagtable : {
|
2005-04-17 05:20:36 +07:00
|
|
|
__tagtable_begin = .;
|
2011-07-06 04:56:41 +07:00
|
|
|
*(.taglist.init)
|
2005-04-17 05:20:36 +07:00
|
|
|
__tagtable_end = .;
|
2011-07-06 04:56:41 +07:00
|
|
|
}
|
2010-09-04 16:47:48 +07:00
|
|
|
#ifdef CONFIG_SMP_ON_UP
|
2011-07-06 04:56:41 +07:00
|
|
|
.init.smpalt : {
|
2010-09-04 16:47:48 +07:00
|
|
|
__smpalt_begin = .;
|
2011-07-06 04:56:41 +07:00
|
|
|
*(.alt.smp.init)
|
2010-09-04 16:47:48 +07:00
|
|
|
__smpalt_end = .;
|
2011-07-06 04:56:41 +07:00
|
|
|
}
|
2010-09-04 16:47:48 +07:00
|
|
|
#endif
|
2011-07-06 04:56:41 +07:00
|
|
|
.init.pv_table : {
|
ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching
This idea came from Nicolas, Eric Miao produced an initial version,
which was then rewritten into this.
Patch the physical to virtual translations at runtime. As we modify
the code, this makes it incompatible with XIP kernels, but allows us
to achieve this with minimal loss of performance.
As many translations are of the form:
physical = virtual + (PHYS_OFFSET - PAGE_OFFSET)
virtual = physical - (PHYS_OFFSET - PAGE_OFFSET)
we generate an 'add' instruction for __virt_to_phys(), and a 'sub'
instruction for __phys_to_virt(). We calculate at run time (PHYS_OFFSET
- PAGE_OFFSET) by comparing the address prior to MMU initialization with
where it should be once the MMU has been initialized, and place this
constant into the above add/sub instructions.
Once we have (PHYS_OFFSET - PAGE_OFFSET), we can calculate the real
PHYS_OFFSET as PAGE_OFFSET is a build-time constant, and save this for
the C-mode PHYS_OFFSET variable definition to use.
At present, we are unable to support Realview with Sparsemem enabled
as this uses a complex mapping function, and MSM as this requires a
constant which will not fit in our math instruction.
Add a module version magic string for this feature to prevent
incompatible modules being loaded.
Tested-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Tested-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-05 02:09:43 +07:00
|
|
|
__pv_table_begin = .;
|
2011-07-06 04:56:41 +07:00
|
|
|
*(.pv_table)
|
ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching
This idea came from Nicolas, Eric Miao produced an initial version,
which was then rewritten into this.
Patch the physical to virtual translations at runtime. As we modify
the code, this makes it incompatible with XIP kernels, but allows us
to achieve this with minimal loss of performance.
As many translations are of the form:
physical = virtual + (PHYS_OFFSET - PAGE_OFFSET)
virtual = physical - (PHYS_OFFSET - PAGE_OFFSET)
we generate an 'add' instruction for __virt_to_phys(), and a 'sub'
instruction for __phys_to_virt(). We calculate at run time (PHYS_OFFSET
- PAGE_OFFSET) by comparing the address prior to MMU initialization with
where it should be once the MMU has been initialized, and place this
constant into the above add/sub instructions.
Once we have (PHYS_OFFSET - PAGE_OFFSET), we can calculate the real
PHYS_OFFSET as PAGE_OFFSET is a build-time constant, and save this for
the C-mode PHYS_OFFSET variable definition to use.
At present, we are unable to support Realview with Sparsemem enabled
as this uses a complex mapping function, and MSM as this requires a
constant which will not fit in our math instruction.
Add a module version magic string for this feature to prevent
incompatible modules being loaded.
Tested-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Tested-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-05 02:09:43 +07:00
|
|
|
__pv_table_end = .;
|
2011-07-06 04:56:41 +07:00
|
|
|
}
|
|
|
|
.init.data : {
|
|
|
|
#ifndef CONFIG_XIP_KERNEL
|
|
|
|
INIT_DATA
|
|
|
|
#endif
|
2009-10-03 03:32:47 +07:00
|
|
|
INIT_SETUP(16)
|
|
|
|
INIT_CALLS
|
|
|
|
CON_INITCALL
|
|
|
|
SECURITY_INITCALL
|
|
|
|
INIT_RAM_FS
|
2011-07-06 04:56:41 +07:00
|
|
|
}
|
2005-04-17 05:20:36 +07:00
|
|
|
#ifndef CONFIG_XIP_KERNEL
|
2011-07-06 04:56:41 +07:00
|
|
|
.exit.data : {
|
2011-02-21 17:13:36 +07:00
|
|
|
ARM_EXIT_KEEP(EXIT_DATA)
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
2011-07-06 04:56:41 +07:00
|
|
|
#endif
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2011-03-25 00:50:09 +07:00
|
|
|
PERCPU_SECTION(32)
|
2009-10-03 03:32:47 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
#ifdef CONFIG_XIP_KERNEL
|
|
|
|
__data_loc = ALIGN(4); /* location in binary */
|
2006-01-04 00:28:33 +07:00
|
|
|
. = PAGE_OFFSET + TEXT_OFFSET;
|
2005-04-17 05:20:36 +07:00
|
|
|
#else
|
2011-07-06 16:39:34 +07:00
|
|
|
__init_end = .;
|
2005-05-05 19:11:00 +07:00
|
|
|
. = ALIGN(THREAD_SIZE);
|
2005-04-17 05:20:36 +07:00
|
|
|
__data_loc = .;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
.data : AT(__data_loc) {
|
2008-12-01 18:53:07 +07:00
|
|
|
_data = .; /* address in memory */
|
2009-05-30 20:00:17 +07:00
|
|
|
_sdata = .;
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* first, the init task union, aligned
|
|
|
|
* to an 8192 byte boundary.
|
|
|
|
*/
|
2009-10-03 03:32:47 +07:00
|
|
|
INIT_TASK_DATA(THREAD_SIZE)
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
#ifdef CONFIG_XIP_KERNEL
|
2009-06-25 05:38:56 +07:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2005-04-17 05:20:36 +07:00
|
|
|
__init_begin = .;
|
2008-01-20 20:15:03 +07:00
|
|
|
INIT_DATA
|
2011-02-21 17:13:36 +07:00
|
|
|
ARM_EXIT_KEEP(EXIT_DATA)
|
2009-06-25 05:38:56 +07:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2005-04-17 05:20:36 +07:00
|
|
|
__init_end = .;
|
|
|
|
#endif
|
|
|
|
|
2009-10-03 03:32:47 +07:00
|
|
|
NOSAVE_DATA
|
|
|
|
CACHELINE_ALIGNED_DATA(32)
|
2010-12-05 00:08:32 +07:00
|
|
|
READ_MOSTLY_DATA(32)
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-10-14 04:04:37 +07:00
|
|
|
/*
|
|
|
|
* The exception fixup table (might need resorting at runtime)
|
|
|
|
*/
|
|
|
|
. = ALIGN(32);
|
|
|
|
__start___ex_table = .;
|
2006-06-22 02:38:17 +07:00
|
|
|
#ifdef CONFIG_MMU
|
2005-10-14 04:04:37 +07:00
|
|
|
*(__ex_table)
|
2006-06-22 02:38:17 +07:00
|
|
|
#endif
|
2005-10-14 04:04:37 +07:00
|
|
|
__stop___ex_table = .;
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* and the usual data section
|
|
|
|
*/
|
2007-05-17 18:38:44 +07:00
|
|
|
DATA_DATA
|
2005-04-17 05:20:36 +07:00
|
|
|
CONSTRUCTORS
|
|
|
|
|
|
|
|
_edata = .;
|
|
|
|
}
|
2007-02-22 22:18:09 +07:00
|
|
|
_edata_loc = __data_loc + SIZEOF(.data);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2009-09-15 23:30:37 +07:00
|
|
|
#ifdef CONFIG_HAVE_TCM
|
|
|
|
/*
|
|
|
|
* We align everything to a page boundary so we can
|
|
|
|
* free it after init has commenced and TCM contents have
|
|
|
|
* been copied to its destination.
|
|
|
|
*/
|
|
|
|
.tcm_start : {
|
|
|
|
. = ALIGN(PAGE_SIZE);
|
|
|
|
__tcm_start = .;
|
|
|
|
__itcm_start = .;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Link these to the ITCM RAM
|
|
|
|
* Put VMA to the TCM address and LMA to the common RAM
|
|
|
|
* and we'll upload the contents from RAM to TCM and free
|
|
|
|
* the used RAM after that.
|
|
|
|
*/
|
|
|
|
.text_itcm ITCM_OFFSET : AT(__itcm_start)
|
|
|
|
{
|
|
|
|
__sitcm_text = .;
|
|
|
|
*(.tcm.text)
|
|
|
|
*(.tcm.rodata)
|
|
|
|
. = ALIGN(4);
|
|
|
|
__eitcm_text = .;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Reset the dot pointer, this is needed to create the
|
|
|
|
* relative __dtcm_start below (to be used as extern in code).
|
|
|
|
*/
|
|
|
|
. = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm);
|
|
|
|
|
|
|
|
.dtcm_start : {
|
|
|
|
__dtcm_start = .;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* TODO: add remainder of ITCM as well, that can be used for data! */
|
|
|
|
.data_dtcm DTCM_OFFSET : AT(__dtcm_start)
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
__sdtcm_data = .;
|
|
|
|
*(.tcm.data)
|
|
|
|
. = ALIGN(4);
|
|
|
|
__edtcm_data = .;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Reset the dot pointer or the linker gets confused */
|
|
|
|
. = ADDR(.dtcm_start) + SIZEOF(.data_dtcm);
|
|
|
|
|
|
|
|
/* End marker for freeing TCM copy in linked object */
|
|
|
|
.tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){
|
|
|
|
. = ALIGN(PAGE_SIZE);
|
|
|
|
__tcm_end = .;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-02-17 00:54:01 +07:00
|
|
|
NOTES
|
|
|
|
|
2009-10-03 03:32:47 +07:00
|
|
|
BSS_SECTION(0, 0, 0)
|
|
|
|
_end = .;
|
|
|
|
|
|
|
|
STABS_DEBUG
|
2005-04-17 05:20:36 +07:00
|
|
|
.comment 0 : { *(.comment) }
|
|
|
|
}
|
|
|
|
|
2005-11-17 23:43:14 +07:00
|
|
|
/*
|
|
|
|
* These must never be empty
|
|
|
|
* If you have to comment these two assert statements out, your
|
|
|
|
* binutils is too old (for other reasons as well)
|
|
|
|
*/
|
2005-04-17 05:20:36 +07:00
|
|
|
ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
|
|
|
|
ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")
|