diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2014-01-20 10:42:02 +0100 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2014-01-20 10:42:02 +0100 |
commit | b3abcb807b7f6202158a47668af7f2505b6dd25e (patch) | |
tree | 1795684ff751a65083aff0d296f4759ff1b82f5d | |
parent | cc64d9eb3bb74e987093d59c6a4af4b7bc76076d (diff) | |
download | rockbox-b3abcb807b7f6202158a47668af7f2505b6dd25e.tar.gz rockbox-b3abcb807b7f6202158a47668af7f2505b6dd25e.zip |
rombox: Do not copy .init section to ram on startup.
This is pointless to copy this code as it can be run in-place.
Change-Id: I73b4f4a3337a88434af457c3f1e40b8d55a5a79e
-rw-r--r-- | firmware/rom.lds | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/firmware/rom.lds b/firmware/rom.lds index 7770ce9e5e..c959bf272d 100644 --- a/firmware/rom.lds +++ b/firmware/rom.lds | |||
@@ -56,18 +56,11 @@ STARTUP(crt0.o) | |||
56 | #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) | 56 | #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) |
57 | #define CODECORIG ENDAUDIOADDR | 57 | #define CODECORIG ENDAUDIOADDR |
58 | 58 | ||
59 | /* .init is copied to codec buffer */ | ||
60 | #define INITORIG CODECORIG | ||
61 | #define INITSIZE CODECSIZE | ||
62 | |||
63 | MEMORY | 59 | MEMORY |
64 | { | 60 | { |
65 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | 61 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE |
66 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | 62 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE |
67 | FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE | 63 | FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE |
68 | #ifdef HAVE_INIT_ATTR | ||
69 | INIT : ORIGIN = INITORIG, LENGTH = INITSIZE | ||
70 | #endif | ||
71 | } | 64 | } |
72 | 65 | ||
73 | SECTIONS | 66 | SECTIONS |
@@ -93,6 +86,9 @@ SECTIONS | |||
93 | KEEP(*(.resetvectors)); | 86 | KEEP(*(.resetvectors)); |
94 | KEEP(*(.vectors)); | 87 | KEEP(*(.vectors)); |
95 | . = ALIGN(0x200); | 88 | . = ALIGN(0x200); |
89 | #ifdef HAVE_INIT_ATTR | ||
90 | *(.initdata*) | ||
91 | #endif | ||
96 | *(.data*) | 92 | *(.data*) |
97 | . = ALIGN(0x4); | 93 | . = ALIGN(0x4); |
98 | _dataend = .; | 94 | _dataend = .; |
@@ -111,6 +107,14 @@ SECTIONS | |||
111 | { | 107 | { |
112 | *(.init.text) | 108 | *(.init.text) |
113 | KEEP(*(.startup*)); | 109 | KEEP(*(.startup*)); |
110 | #ifdef HAVE_INIT_ATTR | ||
111 | /* all this symbols are set to the same address so .init copy loop | ||
112 | will be skiped in crt0.S */ | ||
113 | _initstart = .; | ||
114 | _initend = .; | ||
115 | _initcopy = .; | ||
116 | *(.init*) | ||
117 | #endif | ||
114 | *(.text*) | 118 | *(.text*) |
115 | . = ALIGN(0x4); | 119 | . = ALIGN(0x4); |
116 | } > FLASH | 120 | } > FLASH |
@@ -133,17 +137,6 @@ SECTIONS | |||
133 | _iramend = .; | 137 | _iramend = .; |
134 | } > IRAM | 138 | } > IRAM |
135 | 139 | ||
136 | #ifdef HAVE_INIT_ATTR | ||
137 | .init INITORIG : AT ( _iramcopy + SIZEOF(.iram) ) | ||
138 | { | ||
139 | _initstart = .; | ||
140 | *(.init*) | ||
141 | *(.initdata*) | ||
142 | _initend = .; | ||
143 | } > INIT | ||
144 | _initcopy = LOADADDR(.init); | ||
145 | #endif | ||
146 | |||
147 | .ibss (NOLOAD) : | 140 | .ibss (NOLOAD) : |
148 | { | 141 | { |
149 | _iedata = .; | 142 | _iedata = .; |