remove_unnecessary_inits.patch 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819
  1. From b60eff31f3bd71a6f14b6c6efc8ad5fb3705de6d Mon Sep 17 00:00:00 2001
  2. From: Albert ARIBAUD <albert.u.boot@aribaud.net>
  3. Date: Sat, 22 Feb 2014 17:53:43 +0100
  4. Subject: [PATCH] arm: remove unneeded symbol offsets and _TEXT_BASE
  5. Remove the last uses of symbol offsets in ARM U-Boot.
  6. Remove some needless uses of _TEXT_BASE.
  7. Remove all _TEXT_BASE definitions.
  8. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
  9. ---
  10. README | 6 ------
  11. arch/arm/cpu/arm1136/start.S | 27 ---------------------------
  12. arch/arm/cpu/arm1176/start.S | 27 ---------------------------
  13. arch/arm/cpu/arm720t/start.S | 26 --------------------------
  14. arch/arm/cpu/arm920t/start.S | 26 --------------------------
  15. arch/arm/cpu/arm926ejs/at91/lowlevel_init.S | 14 +-------------
  16. arch/arm/cpu/arm926ejs/mxs/start.S | 27 ---------------------------
  17. arch/arm/cpu/arm926ejs/start.S | 27 ---------------------------
  18. arch/arm/cpu/arm946es/start.S | 26 --------------------------
  19. arch/arm/cpu/arm_intcm/start.S | 26 --------------------------
  20. arch/arm/cpu/armv7/omap3/lowlevel_init.S | 3 ---
  21. arch/arm/cpu/armv7/start.S | 23 -----------------------
  22. arch/arm/cpu/pxa/start.S | 27 ---------------------------
  23. arch/arm/cpu/sa1100/start.S | 26 --------------------------
  24. arch/arm/lib/board.c | 12 ++++++------
  25. board/armltd/integrator/lowlevel_init.S | 2 +-
  26. board/cm4008/flash.c | 2 +-
  27. board/cm41xx/flash.c | 2 +-
  28. board/mpl/vcma9/lowlevel_init.S | 5 +----
  29. board/samsung/goni/lowlevel_init.S | 3 ---
  30. board/samsung/smdk2410/lowlevel_init.S | 5 +----
  31. board/samsung/smdkc100/lowlevel_init.S | 3 ---
  32. board/ti/omap5912osk/lowlevel_init.S | 4 ----
  33. common/board_f.c | 14 +++-----------
  34. common/board_r.c | 4 ++--
  35. include/asm-generic/sections.h | 26 +++++++-------------------
  36. 26 files changed, 24 insertions(+), 369 deletions(-)
  37. diff --git a/README b/README
  38. index d4eb099..5b7dec9 100644
  39. --- a/README
  40. +++ b/README
  41. @@ -3707,12 +3707,6 @@ Configuration Settings:
  42. its config.mk file). If you find problems enabling this option on
  43. your board please report the problem and send patches!
  44. -- CONFIG_SYS_SYM_OFFSETS
  45. - This is set by architectures that use offsets for link symbols
  46. - instead of absolute values. So bss_start is obtained using an
  47. - offset _bss_start_ofs from CONFIG_SYS_TEXT_BASE, rather than
  48. - directly. You should not need to touch this setting.
  49. -
  50. - CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC (OMAP only)
  51. This is set by OMAP boards for the max time that reset should
  52. be asserted. See doc/README.omap-reset-time for details on how
  53. diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
  54. index 00d1b30..3e2358e 100644
  55. --- a/arch/arm/cpu/arm1136/start.S
  56. +++ b/arch/arm/cpu/arm1136/start.S
  57. @@ -70,32 +70,6 @@ _end_vect:
  58. *************************************************************************
  59. */
  60. -.globl _TEXT_BASE
  61. -_TEXT_BASE:
  62. -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
  63. - .word CONFIG_SPL_TEXT_BASE
  64. -#else
  65. - .word CONFIG_SYS_TEXT_BASE
  66. -#endif
  67. -
  68. -/*
  69. - * These are defined in the board-specific linker script.
  70. - * Subtracting _start from them lets the linker put their
  71. - * relative position in the executable instead of leaving
  72. - * them null.
  73. - */
  74. -.globl _bss_start_ofs
  75. -_bss_start_ofs:
  76. - .word __bss_start - _start
  77. -
  78. -.globl _bss_end_ofs
  79. -_bss_end_ofs:
  80. - .word __bss_end - _start
  81. -
  82. -.globl _end_ofs
  83. -_end_ofs:
  84. - .word _end - _start
  85. -
  86. #ifdef CONFIG_USE_IRQ
  87. /* IRQ stack memory (calculated at run-time) */
  88. .globl IRQ_STACK_START
  89. @@ -295,7 +269,6 @@ cpu_init_crit:
  90. #ifdef CONFIG_SPL_BUILD
  91. .align 5
  92. do_hang:
  93. - ldr sp, _TEXT_BASE /* use 32 words about stack */
  94. bl hang /* hang and never return */
  95. #else /* !CONFIG_SPL_BUILD */
  96. .align 5
  97. diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
  98. index ffd7dd0..ce62011 100644
  99. --- a/arch/arm/cpu/arm1176/start.S
  100. +++ b/arch/arm/cpu/arm1176/start.S
  101. @@ -77,33 +77,6 @@ _end_vect:
  102. *************************************************************************
  103. */
  104. -.globl _TEXT_BASE
  105. -_TEXT_BASE:
  106. -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
  107. - .word CONFIG_SPL_TEXT_BASE
  108. -#else
  109. - .word CONFIG_SYS_TEXT_BASE
  110. -#endif
  111. -
  112. -/*
  113. - * These are defined in the board-specific linker script.
  114. - * Subtracting _start from them lets the linker put their
  115. - * relative position in the executable instead of leaving
  116. - * them null.
  117. - */
  118. -
  119. -.globl _bss_start_ofs
  120. -_bss_start_ofs:
  121. - .word __bss_start - _start
  122. -
  123. -.globl _bss_end_ofs
  124. -_bss_end_ofs:
  125. - .word __bss_end - _start
  126. -
  127. -.globl _end_ofs
  128. -_end_ofs:
  129. - .word _end - _start
  130. -
  131. /* IRQ stack memory (calculated at run-time) + 8 bytes */
  132. .globl IRQ_STACK_START_IN
  133. IRQ_STACK_START_IN:
  134. diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
  135. index f180eb8..1a34842 100644
  136. --- a/arch/arm/cpu/arm720t/start.S
  137. +++ b/arch/arm/cpu/arm720t/start.S
  138. @@ -67,32 +67,6 @@ _pad: .word 0x12345678 /* now 16*4=64 */
  139. *************************************************************************
  140. */
  141. -.globl _TEXT_BASE
  142. -_TEXT_BASE:
  143. -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
  144. - .word CONFIG_SPL_TEXT_BASE
  145. -#else
  146. - .word CONFIG_SYS_TEXT_BASE
  147. -#endif
  148. -
  149. -/*
  150. - * These are defined in the board-specific linker script.
  151. - * Subtracting _start from them lets the linker put their
  152. - * relative position in the executable instead of leaving
  153. - * them null.
  154. - */
  155. -.globl _bss_start_ofs
  156. -_bss_start_ofs:
  157. - .word __bss_start - _start
  158. -
  159. -.globl _bss_end_ofs
  160. -_bss_end_ofs:
  161. - .word __bss_end - _start
  162. -
  163. -.globl _end_ofs
  164. -_end_ofs:
  165. - .word _end - _start
  166. -
  167. #ifdef CONFIG_USE_IRQ
  168. /* IRQ stack memory (calculated at run-time) */
  169. .globl IRQ_STACK_START
  170. diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
  171. index a67b659..7bf094a 100644
  172. --- a/arch/arm/cpu/arm920t/start.S
  173. +++ b/arch/arm/cpu/arm920t/start.S
  174. @@ -55,32 +55,6 @@ _fiq: .word fiq
  175. *************************************************************************
  176. */
  177. -.globl _TEXT_BASE
  178. -_TEXT_BASE:
  179. -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
  180. - .word CONFIG_SPL_TEXT_BASE
  181. -#else
  182. - .word CONFIG_SYS_TEXT_BASE
  183. -#endif
  184. -
  185. -/*
  186. - * These are defined in the board-specific linker script.
  187. - * Subtracting _start from them lets the linker put their
  188. - * relative position in the executable instead of leaving
  189. - * them null.
  190. - */
  191. -.globl _bss_start_ofs
  192. -_bss_start_ofs:
  193. - .word __bss_start - _start
  194. -
  195. -.globl _bss_end_ofs
  196. -_bss_end_ofs:
  197. - .word __bss_end - _start
  198. -
  199. -.globl _end_ofs
  200. -_end_ofs:
  201. - .word _end - _start
  202. -
  203. #ifdef CONFIG_USE_IRQ
  204. /* IRQ stack memory (calculated at run-time) */
  205. .globl IRQ_STACK_START
  206. diff --git a/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S b/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
  207. index e83968f..a9ec81a 100644
  208. --- a/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
  209. +++ b/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
  210. @@ -26,27 +26,18 @@
  211. #define CONFIG_SYS_MATRIX_EBICSA_VAL CONFIG_SYS_MATRIX_EBI0CSA_VAL
  212. #endif
  213. -_TEXT_BASE:
  214. - .word CONFIG_SYS_TEXT_BASE
  215. -
  216. .globl lowlevel_init
  217. .type lowlevel_init,function
  218. lowlevel_init:
  219. - mov r5, pc /* r5 = POS1 + 4 current */
  220. POS1:
  221. + adr r5, POS1 /* r5 = POS1 run time */
  222. ldr r0, =POS1 /* r0 = POS1 compile */
  223. - ldr r2, _TEXT_BASE
  224. - sub r0, r0, r2 /* r0 = POS1-_TEXT_BASE (POS1 relative) */
  225. sub r5, r5, r0 /* r0 = CONFIG_SYS_TEXT_BASE-1 */
  226. - sub r5, r5, #4 /* r1 = text base - current */
  227. /* memory control configuration 1 */
  228. ldr r0, =SMRDATA
  229. ldr r2, =SMRDATA1
  230. - ldr r1, _TEXT_BASE
  231. - sub r0, r0, r1
  232. - sub r2, r2, r1
  233. add r0, r0, r5
  234. add r2, r2, r5
  235. 0:
  236. @@ -149,9 +140,6 @@ PLL_setup_end:
  237. ldr r0, =SMRDATA1
  238. ldr r2, =SMRDATA2
  239. - ldr r1, _TEXT_BASE
  240. - sub r0, r0, r1
  241. - sub r2, r2, r1
  242. add r0, r0, r5
  243. add r2, r2, r5
  244. 2:
  245. diff --git a/arch/arm/cpu/arm926ejs/mxs/start.S b/arch/arm/cpu/arm926ejs/mxs/start.S
  246. index 5de2bad..34a0fcb 100644
  247. --- a/arch/arm/cpu/arm926ejs/mxs/start.S
  248. +++ b/arch/arm/cpu/arm926ejs/mxs/start.S
  249. @@ -101,32 +101,6 @@ fiq:
  250. *************************************************************************
  251. */
  252. -.globl _TEXT_BASE
  253. -_TEXT_BASE:
  254. -#ifdef CONFIG_SPL_TEXT_BASE
  255. - .word CONFIG_SPL_TEXT_BASE
  256. -#else
  257. - .word CONFIG_SYS_TEXT_BASE
  258. -#endif
  259. -
  260. -/*
  261. - * These are defined in the board-specific linker script.
  262. - * Subtracting _start from them lets the linker put their
  263. - * relative position in the executable instead of leaving
  264. - * them null.
  265. - */
  266. -.globl _bss_start_ofs
  267. -_bss_start_ofs:
  268. - .word __bss_start - _start
  269. -
  270. -.globl _bss_end_ofs
  271. -_bss_end_ofs:
  272. - .word __bss_end - _start
  273. -
  274. -.globl _end_ofs
  275. -_end_ofs:
  276. - .word _end - _start
  277. -
  278. #ifdef CONFIG_USE_IRQ
  279. /* IRQ stack memory (calculated at run-time) */
  280. .globl IRQ_STACK_START
  281. @@ -207,6 +181,5 @@ _reset:
  282. bx lr
  283. _hang:
  284. - ldr sp, _TEXT_BASE /* switch to abort stack */
  285. 1:
  286. bl 1b /* hang and never return */
  287. diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
  288. index 5360f55..0717327 100644
  289. --- a/arch/arm/cpu/arm926ejs/start.S
  290. +++ b/arch/arm/cpu/arm926ejs/start.S
  291. @@ -102,32 +102,6 @@ _fiq:
  292. *************************************************************************
  293. */
  294. -.globl _TEXT_BASE
  295. -_TEXT_BASE:
  296. -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
  297. - .word CONFIG_SPL_TEXT_BASE
  298. -#else
  299. - .word CONFIG_SYS_TEXT_BASE
  300. -#endif
  301. -
  302. -/*
  303. - * These are defined in the board-specific linker script.
  304. - * Subtracting _start from them lets the linker put their
  305. - * relative position in the executable instead of leaving
  306. - * them null.
  307. - */
  308. -.globl _bss_start_ofs
  309. -_bss_start_ofs:
  310. - .word __bss_start - _start
  311. -
  312. -.globl _bss_end_ofs
  313. -_bss_end_ofs:
  314. - .word __bss_end - _start
  315. -
  316. -.globl _end_ofs
  317. -_end_ofs:
  318. - .word _end - _start
  319. -
  320. #ifdef CONFIG_USE_IRQ
  321. /* IRQ stack memory (calculated at run-time) */
  322. .globl IRQ_STACK_START
  323. @@ -330,7 +304,6 @@ flush_dcache:
  324. #ifdef CONFIG_SPL_BUILD
  325. .align 5
  326. do_hang:
  327. - ldr sp, _TEXT_BASE /* switch to abort stack */
  328. 1:
  329. bl 1b /* hang and never return */
  330. #else /* !CONFIG_SPL_BUILD */
  331. diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
  332. index e16b088..7d50145 100644
  333. --- a/arch/arm/cpu/arm946es/start.S
  334. +++ b/arch/arm/cpu/arm946es/start.S
  335. @@ -71,32 +71,6 @@ _vectors_end:
  336. *************************************************************************
  337. */
  338. -.globl _TEXT_BASE
  339. -_TEXT_BASE:
  340. -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
  341. - .word CONFIG_SPL_TEXT_BASE
  342. -#else
  343. - .word CONFIG_SYS_TEXT_BASE
  344. -#endif
  345. -
  346. -/*
  347. - * These are defined in the board-specific linker script.
  348. - * Subtracting _start from them lets the linker put their
  349. - * relative position in the executable instead of leaving
  350. - * them null.
  351. - */
  352. -.globl _bss_start_ofs
  353. -_bss_start_ofs:
  354. - .word __bss_start - _start
  355. -
  356. -.globl _bss_end_ofs
  357. -_bss_end_ofs:
  358. - .word __bss_end - _start
  359. -
  360. -.globl _end_ofs
  361. -_end_ofs:
  362. - .word _end - _start
  363. -
  364. #ifdef CONFIG_USE_IRQ
  365. /* IRQ stack memory (calculated at run-time) */
  366. .globl IRQ_STACK_START
  367. diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
  368. index 5783df1..7404ea7 100644
  369. --- a/arch/arm/cpu/arm_intcm/start.S
  370. +++ b/arch/arm/cpu/arm_intcm/start.S
  371. @@ -67,32 +67,6 @@ _fiq:
  372. *************************************************************************
  373. */
  374. -.globl _TEXT_BASE
  375. -_TEXT_BASE:
  376. -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
  377. - .word CONFIG_SPL_TEXT_BASE
  378. -#else
  379. - .word CONFIG_SYS_TEXT_BASE
  380. -#endif
  381. -
  382. -/*
  383. - * These are defined in the board-specific linker script.
  384. - * Subtracting _start from them lets the linker put their
  385. - * relative position in the executable instead of leaving
  386. - * them null.
  387. - */
  388. -.globl _bss_start_ofs
  389. -_bss_start_ofs:
  390. - .word __bss_start - _start
  391. -
  392. -.globl _bss_end_ofs
  393. -_bss_end_ofs:
  394. - .word __bss_end - _start
  395. -
  396. -.globl _end_ofs
  397. -_end_ofs:
  398. - .word _end - _start
  399. -
  400. #ifdef CONFIG_USE_IRQ
  401. /* IRQ stack memory (calculated at run-time) */
  402. .globl IRQ_STACK_START
  403. diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
  404. index 6f7261b..78577b1 100644
  405. --- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S
  406. +++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
  407. @@ -17,9 +17,6 @@
  408. #include <asm/arch/clocks_omap3.h>
  409. #include <linux/linkage.h>
  410. -_TEXT_BASE:
  411. - .word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */
  412. -
  413. #ifdef CONFIG_SPL_BUILD
  414. ENTRY(save_boot_params)
  415. ldr r4, =omap3_boot_device
  416. diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
  417. index 5aac773..ac1e55a 100644
  418. --- a/arch/arm/cpu/armv7/start.S
  419. +++ b/arch/arm/cpu/armv7/start.S
  420. @@ -70,29 +70,6 @@ _end_vect:
  421. *
  422. *************************************************************************/
  423. -.globl _TEXT_BASE
  424. -_TEXT_BASE:
  425. -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
  426. - .word CONFIG_SPL_TEXT_BASE
  427. -#else
  428. - .word CONFIG_SYS_TEXT_BASE
  429. -#endif
  430. -
  431. -/*
  432. - * These are defined in the board-specific linker script.
  433. - */
  434. -.globl _bss_start_ofs
  435. -_bss_start_ofs:
  436. - .word __bss_start - _start
  437. -
  438. -.globl _bss_end_ofs
  439. -_bss_end_ofs:
  440. - .word __bss_end - _start
  441. -
  442. -.globl _end_ofs
  443. -_end_ofs:
  444. - .word _end - _start
  445. -
  446. #ifdef CONFIG_USE_IRQ
  447. /* IRQ stack memory (calculated at run-time) */
  448. .globl IRQ_STACK_START
  449. diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
  450. index d8fb812..ae0d13c 100644
  451. --- a/arch/arm/cpu/pxa/start.S
  452. +++ b/arch/arm/cpu/pxa/start.S
  453. @@ -84,32 +84,6 @@ _end_vect:
  454. *************************************************************************
  455. */
  456. -.globl _TEXT_BASE
  457. -_TEXT_BASE:
  458. -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
  459. - .word CONFIG_SPL_TEXT_BASE
  460. -#else
  461. - .word CONFIG_SYS_TEXT_BASE
  462. -#endif
  463. -
  464. -/*
  465. - * These are defined in the board-specific linker script.
  466. - * Subtracting _start from them lets the linker put their
  467. - * relative position in the executable instead of leaving
  468. - * them null.
  469. - */
  470. -.globl _bss_start_ofs
  471. -_bss_start_ofs:
  472. - .word __bss_start - _start
  473. -
  474. -.globl _bss_end_ofs
  475. -_bss_end_ofs:
  476. - .word __bss_end - _start
  477. -
  478. -.globl _end_ofs
  479. -_end_ofs:
  480. - .word _end - _start
  481. -
  482. #ifdef CONFIG_USE_IRQ
  483. /* IRQ stack memory (calculated at run-time) */
  484. .globl IRQ_STACK_START
  485. @@ -316,7 +290,6 @@ cpu_init_crit:
  486. #ifdef CONFIG_SPL_BUILD
  487. .align 5
  488. do_hang:
  489. - ldr sp, _TEXT_BASE /* use 32 words about stack */
  490. bl hang /* hang and never return */
  491. #else /* !CONFIG_SPL_BUILD */
  492. .align 5
  493. diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S
  494. index 27bcda5..bf80937 100644
  495. --- a/arch/arm/cpu/sa1100/start.S
  496. +++ b/arch/arm/cpu/sa1100/start.S
  497. @@ -56,32 +56,6 @@ _fiq: .word fiq
  498. *************************************************************************
  499. */
  500. -.globl _TEXT_BASE
  501. -_TEXT_BASE:
  502. -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
  503. - .word CONFIG_SPL_TEXT_BASE
  504. -#else
  505. - .word CONFIG_SYS_TEXT_BASE
  506. -#endif
  507. -
  508. -/*
  509. - * These are defined in the board-specific linker script.
  510. - * Subtracting _start from them lets the linker put their
  511. - * relative position in the executable instead of leaving
  512. - * them null.
  513. - */
  514. -.globl _bss_start_ofs
  515. -_bss_start_ofs:
  516. - .word __bss_start - _start
  517. -
  518. -.globl _bss_end_ofs
  519. -_bss_end_ofs:
  520. - .word __bss_end - _start
  521. -
  522. -.globl _end_ofs
  523. -_end_ofs:
  524. - .word _end - _start
  525. -
  526. #ifdef CONFIG_USE_IRQ
  527. /* IRQ stack memory (calculated at run-time) */
  528. .globl IRQ_STACK_START
  529. diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
  530. index c320a35..1de5812 100644
  531. --- a/arch/arm/lib/board.c
  532. +++ b/arch/arm/lib/board.c
  533. @@ -105,8 +105,8 @@ static int display_banner(void)
  534. {
  535. printf("\n\n%s\n\n", version_string);
  536. debug("U-Boot code: %08lX -> %08lX BSS: -> %08lX\n",
  537. - _TEXT_BASE,
  538. - _bss_start_ofs + _TEXT_BASE, _bss_end_ofs + _TEXT_BASE);
  539. + (ulong)&_start,
  540. + (ulong)&__bss_start, (ulong)&__bss_end);
  541. #ifdef CONFIG_MODEM_SUPPORT
  542. debug("Modem Support enabled\n");
  543. #endif
  544. @@ -277,13 +277,13 @@ void board_init_f(ulong bootflag)
  545. memset((void *)gd, 0, sizeof(gd_t));
  546. - gd->mon_len = _bss_end_ofs;
  547. + gd->mon_len = (ulong)&__bss_end - (ulong)_start;
  548. #ifdef CONFIG_OF_EMBED
  549. /* Get a pointer to the FDT */
  550. gd->fdt_blob = _binary_dt_dtb_start;
  551. #elif defined CONFIG_OF_SEPARATE
  552. /* FDT is at end of image */
  553. - gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
  554. + gd->fdt_blob = &_end;
  555. #endif
  556. /* Allow the early environment to override the fdt address */
  557. gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
  558. @@ -451,7 +451,7 @@ void board_init_f(ulong bootflag)
  559. gd->relocaddr = addr;
  560. gd->start_addr_sp = addr_sp;
  561. - gd->reloc_off = addr - _TEXT_BASE;
  562. + gd->reloc_off = addr - (ulong)&_start;
  563. debug("relocation Offset is: %08lx\n", gd->reloc_off);
  564. if (new_fdt) {
  565. memcpy(new_fdt, gd->fdt_blob, fdt_size);
  566. @@ -516,7 +516,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
  567. gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
  568. bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
  569. - monitor_flash_len = _end_ofs;
  570. + monitor_flash_len = (ulong)&__rel_dyn_end - (ulong)_start;
  571. /* Enable caches */
  572. enable_caches();
  573. diff --git a/board/armltd/integrator/lowlevel_init.S b/board/armltd/integrator/lowlevel_init.S
  574. index 389d5e9..0fb42ad 100644
  575. --- a/board/armltd/integrator/lowlevel_init.S
  576. +++ b/board/armltd/integrator/lowlevel_init.S
  577. @@ -183,7 +183,7 @@ cm_remap:
  578. /* Now 0x00000000 is writeable, replace the vectors */
  579. ldr r0, =_start /* r0 <- start of vectors */
  580. - ldr r2, =_TEXT_BASE /* r2 <- past vectors */
  581. + add r2, r0, #64 /* r2 <- past vectors */
  582. sub r1,r1,r1 /* destination 0x00000000 */
  583. copy_vec:
  584. diff --git a/board/cm4008/flash.c b/board/cm4008/flash.c
  585. index 2511928..8315a57 100644
  586. --- a/board/cm4008/flash.c
  587. +++ b/board/cm4008/flash.c
  588. @@ -57,7 +57,7 @@ unsigned long flash_init (void)
  589. */
  590. flash_protect (FLAG_PROTECT_SET,
  591. CONFIG_SYS_FLASH_BASE,
  592. - CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
  593. + CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start),
  594. &flash_info[0]);
  595. return size;
  596. diff --git a/board/cm41xx/flash.c b/board/cm41xx/flash.c
  597. index 2511928..8315a57 100644
  598. --- a/board/cm41xx/flash.c
  599. +++ b/board/cm41xx/flash.c
  600. @@ -57,7 +57,7 @@ unsigned long flash_init (void)
  601. */
  602. flash_protect (FLAG_PROTECT_SET,
  603. CONFIG_SYS_FLASH_BASE,
  604. - CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
  605. + CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start),
  606. &flash_info[0]);
  607. return size;
  608. diff --git a/board/mpl/vcma9/lowlevel_init.S b/board/mpl/vcma9/lowlevel_init.S
  609. index b889cf9..cca9c0c 100644
  610. --- a/board/mpl/vcma9/lowlevel_init.S
  611. +++ b/board/mpl/vcma9/lowlevel_init.S
  612. @@ -197,13 +197,10 @@
  613. #define REFCNT_266 0
  614. /**************************************/
  615. -_TEXT_BASE:
  616. - .word CONFIG_SYS_TEXT_BASE
  617. -
  618. .globl lowlevel_init
  619. lowlevel_init:
  620. /* use r0 to relocate DATA read/write to flash rather than memory ! */
  621. - ldr r0, _TEXT_BASE
  622. + ldr r0, =CONFIG_SYS_TEXT_BASE
  623. ldr r13, =BWSCON
  624. /* enable minimal access to PLD */
  625. diff --git a/board/samsung/goni/lowlevel_init.S b/board/samsung/goni/lowlevel_init.S
  626. index 726211a..d52bc09 100644
  627. --- a/board/samsung/goni/lowlevel_init.S
  628. +++ b/board/samsung/goni/lowlevel_init.S
  629. @@ -22,9 +22,6 @@
  630. * r9 has Mobile DDR size, 1 means 1GiB, 2 means 2GiB and so on
  631. */
  632. -_TEXT_BASE:
  633. - .word CONFIG_SYS_TEXT_BASE
  634. -
  635. .globl lowlevel_init
  636. lowlevel_init:
  637. mov r11, lr
  638. diff --git a/board/samsung/smdk2410/lowlevel_init.S b/board/samsung/smdk2410/lowlevel_init.S
  639. index c7b78fd..5de04f1 100644
  640. --- a/board/samsung/smdk2410/lowlevel_init.S
  641. +++ b/board/samsung/smdk2410/lowlevel_init.S
  642. @@ -110,16 +110,13 @@
  643. #define REFCNT 1113 /* period=15.6us, HCLK=60Mhz, (2048+1-15.6*60) */
  644. /**************************************/
  645. -_TEXT_BASE:
  646. - .word CONFIG_SYS_TEXT_BASE
  647. -
  648. .globl lowlevel_init
  649. lowlevel_init:
  650. /* memory control configuration */
  651. /* make r0 relative the current location so that it */
  652. /* reads SMRDATA out of FLASH rather than memory ! */
  653. ldr r0, =SMRDATA
  654. - ldr r1, _TEXT_BASE
  655. + ldr r1, =CONFIG_SYS_TEXT_BASE
  656. sub r0, r0, r1
  657. ldr r1, =BWSCON /* Bus Width Status Controller */
  658. add r2, r0, #13*4
  659. diff --git a/board/samsung/smdkc100/lowlevel_init.S b/board/samsung/smdkc100/lowlevel_init.S
  660. index 4df0974..65e6b7a 100644
  661. --- a/board/samsung/smdkc100/lowlevel_init.S
  662. +++ b/board/samsung/smdkc100/lowlevel_init.S
  663. @@ -17,9 +17,6 @@
  664. * r5 has zero always
  665. */
  666. -_TEXT_BASE:
  667. - .word CONFIG_SYS_TEXT_BASE
  668. -
  669. .globl lowlevel_init
  670. lowlevel_init:
  671. mov r9, lr
  672. diff --git a/board/ti/omap5912osk/lowlevel_init.S b/board/ti/omap5912osk/lowlevel_init.S
  673. index cad0a5a..e05a1c7 100644
  674. --- a/board/ti/omap5912osk/lowlevel_init.S
  675. +++ b/board/ti/omap5912osk/lowlevel_init.S
  676. @@ -18,10 +18,6 @@
  677. #include <./configs/omap1510.h>
  678. #endif
  679. -
  680. -_TEXT_BASE:
  681. - .word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */
  682. -
  683. .globl lowlevel_init
  684. lowlevel_init:
  685. diff --git a/common/board_f.c b/common/board_f.c
  686. index 02965b0..5b9ba07 100644
  687. --- a/common/board_f.c
  688. +++ b/common/board_f.c
  689. @@ -149,13 +149,9 @@ static int display_text_info(void)
  690. #ifndef CONFIG_SANDBOX
  691. ulong bss_start, bss_end;
  692. -#ifdef CONFIG_SYS_SYM_OFFSETS
  693. - bss_start = _bss_start_ofs + _TEXT_BASE;
  694. - bss_end = _bss_end_ofs + _TEXT_BASE;
  695. -#else
  696. bss_start = (ulong)&__bss_start;
  697. bss_end = (ulong)&__bss_end;
  698. -#endif
  699. +
  700. debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n",
  701. CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
  702. #endif
  703. @@ -279,8 +275,8 @@ static int zero_global_data(void)
  704. static int setup_mon_len(void)
  705. {
  706. -#ifdef CONFIG_SYS_SYM_OFFSETS
  707. - gd->mon_len = _bss_end_ofs;
  708. +#ifdef __ARM__
  709. + gd->mon_len = (ulong)&__bss_end - (ulong)_start;
  710. #elif defined(CONFIG_SANDBOX)
  711. gd->mon_len = (ulong)&_end - (ulong)_init;
  712. #else
  713. @@ -363,11 +359,7 @@ static int setup_fdt(void)
  714. gd->fdt_blob = __dtb_dt_begin;
  715. #elif defined CONFIG_OF_SEPARATE
  716. /* FDT is at end of image */
  717. -# ifdef CONFIG_SYS_SYM_OFFSETS
  718. - gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE);
  719. -# else
  720. gd->fdt_blob = (ulong *)&_end;
  721. -# endif
  722. #elif defined(CONFIG_OF_HOSTFILE)
  723. if (read_fdt_from_file()) {
  724. puts("Failed to read control FDT\n");
  725. diff --git a/common/board_r.c b/common/board_r.c
  726. index c2d0763..899f377 100644
  727. --- a/common/board_r.c
  728. +++ b/common/board_r.c
  729. @@ -128,8 +128,8 @@ __weak int fixup_cpu(void)
  730. static int initr_reloc_global_data(void)
  731. {
  732. -#ifdef CONFIG_SYS_SYM_OFFSETS
  733. - monitor_flash_len = _end_ofs;
  734. +#ifdef __ARM__
  735. + monitor_flash_len = _end - __image_copy_start;
  736. #elif !defined(CONFIG_SANDBOX)
  737. monitor_flash_len = (ulong)&__init_end - gd->relocaddr;
  738. #endif
  739. diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
  740. index 7e1eb4b..458952f 100644
  741. --- a/include/asm-generic/sections.h
  742. +++ b/include/asm-generic/sections.h
  743. @@ -63,28 +63,16 @@ extern char __image_copy_end[];
  744. extern void _start(void);
  745. /*
  746. - * ARM needs to use offsets for symbols, since the values of some symbols
  747. - * are not resolved prior to relocation (and are just 0). Maybe this can be
  748. - * resolved, or maybe other architectures are similar, iwc this should be
  749. - * promoted to an architecture option.
  750. + * ARM defines its symbols as char[]. Other arches define them as ulongs.
  751. */
  752. #ifdef CONFIG_ARM
  753. -#define CONFIG_SYS_SYM_OFFSETS
  754. -#endif
  755. -
  756. -#ifdef CONFIG_SYS_SYM_OFFSETS
  757. -/* Start/end of the relocation entries, as an offset from _start */
  758. -extern ulong _rel_dyn_start_ofs;
  759. -extern ulong _rel_dyn_end_ofs;
  760. -
  761. -/* End of the region to be relocated, as an offset form _start */
  762. -extern ulong _image_copy_end_ofs;
  763. -extern ulong _bss_start_ofs; /* BSS start relative to _start */
  764. -extern ulong _bss_end_ofs; /* BSS end relative to _start */
  765. -extern ulong _end_ofs; /* end of image relative to _start */
  766. -
  767. -extern ulong _TEXT_BASE; /* code start */
  768. +extern char __bss_start[];
  769. +extern char __bss_end[];
  770. +extern char __image_copy_start[];
  771. +extern char __image_copy_end[];
  772. +extern char __rel_dyn_start[];
  773. +extern char __rel_dyn_end[];
  774. #else /* don't use offsets: */