Commit b60eff31f3bd71a6f14b6c6efc8ad5fb3705de6d

Authored by Albert ARIBAUD
1 parent d0b5d9da5d

arm: remove unneeded symbol offsets and _TEXT_BASE

Remove the last uses of symbol offsets in ARM U-Boot.
Remove some needless uses of _TEXT_BASE.
Remove all _TEXT_BASE definitions.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>

Showing 26 changed files with 24 additions and 369 deletions Side-by-side Diff

... ... @@ -3707,12 +3707,6 @@
3707 3707 its config.mk file). If you find problems enabling this option on
3708 3708 your board please report the problem and send patches!
3709 3709  
3710   -- CONFIG_SYS_SYM_OFFSETS
3711   - This is set by architectures that use offsets for link symbols
3712   - instead of absolute values. So bss_start is obtained using an
3713   - offset _bss_start_ofs from CONFIG_SYS_TEXT_BASE, rather than
3714   - directly. You should not need to touch this setting.
3715   -
3716 3710 - CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC (OMAP only)
3717 3711 This is set by OMAP boards for the max time that reset should
3718 3712 be asserted. See doc/README.omap-reset-time for details on how
arch/arm/cpu/arm1136/start.S
... ... @@ -70,32 +70,6 @@
70 70 *************************************************************************
71 71 */
72 72  
73   -.globl _TEXT_BASE
74   -_TEXT_BASE:
75   -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
76   - .word CONFIG_SPL_TEXT_BASE
77   -#else
78   - .word CONFIG_SYS_TEXT_BASE
79   -#endif
80   -
81   -/*
82   - * These are defined in the board-specific linker script.
83   - * Subtracting _start from them lets the linker put their
84   - * relative position in the executable instead of leaving
85   - * them null.
86   - */
87   -.globl _bss_start_ofs
88   -_bss_start_ofs:
89   - .word __bss_start - _start
90   -
91   -.globl _bss_end_ofs
92   -_bss_end_ofs:
93   - .word __bss_end - _start
94   -
95   -.globl _end_ofs
96   -_end_ofs:
97   - .word _end - _start
98   -
99 73 #ifdef CONFIG_USE_IRQ
100 74 /* IRQ stack memory (calculated at run-time) */
101 75 .globl IRQ_STACK_START
... ... @@ -295,7 +269,6 @@
295 269 #ifdef CONFIG_SPL_BUILD
296 270 .align 5
297 271 do_hang:
298   - ldr sp, _TEXT_BASE /* use 32 words about stack */
299 272 bl hang /* hang and never return */
300 273 #else /* !CONFIG_SPL_BUILD */
301 274 .align 5
arch/arm/cpu/arm1176/start.S
... ... @@ -77,33 +77,6 @@
77 77 *************************************************************************
78 78 */
79 79  
80   -.globl _TEXT_BASE
81   -_TEXT_BASE:
82   -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
83   - .word CONFIG_SPL_TEXT_BASE
84   -#else
85   - .word CONFIG_SYS_TEXT_BASE
86   -#endif
87   -
88   -/*
89   - * These are defined in the board-specific linker script.
90   - * Subtracting _start from them lets the linker put their
91   - * relative position in the executable instead of leaving
92   - * them null.
93   - */
94   -
95   -.globl _bss_start_ofs
96   -_bss_start_ofs:
97   - .word __bss_start - _start
98   -
99   -.globl _bss_end_ofs
100   -_bss_end_ofs:
101   - .word __bss_end - _start
102   -
103   -.globl _end_ofs
104   -_end_ofs:
105   - .word _end - _start
106   -
107 80 /* IRQ stack memory (calculated at run-time) + 8 bytes */
108 81 .globl IRQ_STACK_START_IN
109 82 IRQ_STACK_START_IN:
arch/arm/cpu/arm720t/start.S
... ... @@ -67,32 +67,6 @@
67 67 *************************************************************************
68 68 */
69 69  
70   -.globl _TEXT_BASE
71   -_TEXT_BASE:
72   -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
73   - .word CONFIG_SPL_TEXT_BASE
74   -#else
75   - .word CONFIG_SYS_TEXT_BASE
76   -#endif
77   -
78   -/*
79   - * These are defined in the board-specific linker script.
80   - * Subtracting _start from them lets the linker put their
81   - * relative position in the executable instead of leaving
82   - * them null.
83   - */
84   -.globl _bss_start_ofs
85   -_bss_start_ofs:
86   - .word __bss_start - _start
87   -
88   -.globl _bss_end_ofs
89   -_bss_end_ofs:
90   - .word __bss_end - _start
91   -
92   -.globl _end_ofs
93   -_end_ofs:
94   - .word _end - _start
95   -
96 70 #ifdef CONFIG_USE_IRQ
97 71 /* IRQ stack memory (calculated at run-time) */
98 72 .globl IRQ_STACK_START
arch/arm/cpu/arm920t/start.S
... ... @@ -55,32 +55,6 @@
55 55 *************************************************************************
56 56 */
57 57  
58   -.globl _TEXT_BASE
59   -_TEXT_BASE:
60   -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
61   - .word CONFIG_SPL_TEXT_BASE
62   -#else
63   - .word CONFIG_SYS_TEXT_BASE
64   -#endif
65   -
66   -/*
67   - * These are defined in the board-specific linker script.
68   - * Subtracting _start from them lets the linker put their
69   - * relative position in the executable instead of leaving
70   - * them null.
71   - */
72   -.globl _bss_start_ofs
73   -_bss_start_ofs:
74   - .word __bss_start - _start
75   -
76   -.globl _bss_end_ofs
77   -_bss_end_ofs:
78   - .word __bss_end - _start
79   -
80   -.globl _end_ofs
81   -_end_ofs:
82   - .word _end - _start
83   -
84 58 #ifdef CONFIG_USE_IRQ
85 59 /* IRQ stack memory (calculated at run-time) */
86 60 .globl IRQ_STACK_START
arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
... ... @@ -26,27 +26,18 @@
26 26 #define CONFIG_SYS_MATRIX_EBICSA_VAL CONFIG_SYS_MATRIX_EBI0CSA_VAL
27 27 #endif
28 28  
29   -_TEXT_BASE:
30   - .word CONFIG_SYS_TEXT_BASE
31   -
32 29 .globl lowlevel_init
33 30 .type lowlevel_init,function
34 31 lowlevel_init:
35 32  
36   - mov r5, pc /* r5 = POS1 + 4 current */
37 33 POS1:
  34 + adr r5, POS1 /* r5 = POS1 run time */
38 35 ldr r0, =POS1 /* r0 = POS1 compile */
39   - ldr r2, _TEXT_BASE
40   - sub r0, r0, r2 /* r0 = POS1-_TEXT_BASE (POS1 relative) */
41 36 sub r5, r5, r0 /* r0 = CONFIG_SYS_TEXT_BASE-1 */
42   - sub r5, r5, #4 /* r1 = text base - current */
43 37  
44 38 /* memory control configuration 1 */
45 39 ldr r0, =SMRDATA
46 40 ldr r2, =SMRDATA1
47   - ldr r1, _TEXT_BASE
48   - sub r0, r0, r1
49   - sub r2, r2, r1
50 41 add r0, r0, r5
51 42 add r2, r2, r5
52 43 0:
... ... @@ -149,9 +140,6 @@
149 140  
150 141 ldr r0, =SMRDATA1
151 142 ldr r2, =SMRDATA2
152   - ldr r1, _TEXT_BASE
153   - sub r0, r0, r1
154   - sub r2, r2, r1
155 143 add r0, r0, r5
156 144 add r2, r2, r5
157 145 2:
arch/arm/cpu/arm926ejs/mxs/start.S
... ... @@ -101,32 +101,6 @@
101 101 *************************************************************************
102 102 */
103 103  
104   -.globl _TEXT_BASE
105   -_TEXT_BASE:
106   -#ifdef 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   -.globl _bss_start_ofs
119   -_bss_start_ofs:
120   - .word __bss_start - _start
121   -
122   -.globl _bss_end_ofs
123   -_bss_end_ofs:
124   - .word __bss_end - _start
125   -
126   -.globl _end_ofs
127   -_end_ofs:
128   - .word _end - _start
129   -
130 104 #ifdef CONFIG_USE_IRQ
131 105 /* IRQ stack memory (calculated at run-time) */
132 106 .globl IRQ_STACK_START
... ... @@ -207,7 +181,6 @@
207 181 bx lr
208 182  
209 183 _hang:
210   - ldr sp, _TEXT_BASE /* switch to abort stack */
211 184 1:
212 185 bl 1b /* hang and never return */
arch/arm/cpu/arm926ejs/start.S
... ... @@ -102,32 +102,6 @@
102 102 *************************************************************************
103 103 */
104 104  
105   -.globl _TEXT_BASE
106   -_TEXT_BASE:
107   -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
108   - .word CONFIG_SPL_TEXT_BASE
109   -#else
110   - .word CONFIG_SYS_TEXT_BASE
111   -#endif
112   -
113   -/*
114   - * These are defined in the board-specific linker script.
115   - * Subtracting _start from them lets the linker put their
116   - * relative position in the executable instead of leaving
117   - * them null.
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 105 #ifdef CONFIG_USE_IRQ
132 106 /* IRQ stack memory (calculated at run-time) */
133 107 .globl IRQ_STACK_START
... ... @@ -330,7 +304,6 @@
330 304 #ifdef CONFIG_SPL_BUILD
331 305 .align 5
332 306 do_hang:
333   - ldr sp, _TEXT_BASE /* switch to abort stack */
334 307 1:
335 308 bl 1b /* hang and never return */
336 309 #else /* !CONFIG_SPL_BUILD */
arch/arm/cpu/arm946es/start.S
... ... @@ -71,32 +71,6 @@
71 71 *************************************************************************
72 72 */
73 73  
74   -.globl _TEXT_BASE
75   -_TEXT_BASE:
76   -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
77   - .word CONFIG_SPL_TEXT_BASE
78   -#else
79   - .word CONFIG_SYS_TEXT_BASE
80   -#endif
81   -
82   -/*
83   - * These are defined in the board-specific linker script.
84   - * Subtracting _start from them lets the linker put their
85   - * relative position in the executable instead of leaving
86   - * them null.
87   - */
88   -.globl _bss_start_ofs
89   -_bss_start_ofs:
90   - .word __bss_start - _start
91   -
92   -.globl _bss_end_ofs
93   -_bss_end_ofs:
94   - .word __bss_end - _start
95   -
96   -.globl _end_ofs
97   -_end_ofs:
98   - .word _end - _start
99   -
100 74 #ifdef CONFIG_USE_IRQ
101 75 /* IRQ stack memory (calculated at run-time) */
102 76 .globl IRQ_STACK_START
arch/arm/cpu/arm_intcm/start.S
... ... @@ -67,32 +67,6 @@
67 67 *************************************************************************
68 68 */
69 69  
70   -.globl _TEXT_BASE
71   -_TEXT_BASE:
72   -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
73   - .word CONFIG_SPL_TEXT_BASE
74   -#else
75   - .word CONFIG_SYS_TEXT_BASE
76   -#endif
77   -
78   -/*
79   - * These are defined in the board-specific linker script.
80   - * Subtracting _start from them lets the linker put their
81   - * relative position in the executable instead of leaving
82   - * them null.
83   - */
84   -.globl _bss_start_ofs
85   -_bss_start_ofs:
86   - .word __bss_start - _start
87   -
88   -.globl _bss_end_ofs
89   -_bss_end_ofs:
90   - .word __bss_end - _start
91   -
92   -.globl _end_ofs
93   -_end_ofs:
94   - .word _end - _start
95   -
96 70 #ifdef CONFIG_USE_IRQ
97 71 /* IRQ stack memory (calculated at run-time) */
98 72 .globl IRQ_STACK_START
arch/arm/cpu/armv7/omap3/lowlevel_init.S
... ... @@ -17,9 +17,6 @@
17 17 #include <asm/arch/clocks_omap3.h>
18 18 #include <linux/linkage.h>
19 19  
20   -_TEXT_BASE:
21   - .word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */
22   -
23 20 #ifdef CONFIG_SPL_BUILD
24 21 ENTRY(save_boot_params)
25 22 ldr r4, =omap3_boot_device
arch/arm/cpu/armv7/start.S
... ... @@ -70,29 +70,6 @@
70 70 *
71 71 *************************************************************************/
72 72  
73   -.globl _TEXT_BASE
74   -_TEXT_BASE:
75   -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
76   - .word CONFIG_SPL_TEXT_BASE
77   -#else
78   - .word CONFIG_SYS_TEXT_BASE
79   -#endif
80   -
81   -/*
82   - * These are defined in the board-specific linker script.
83   - */
84   -.globl _bss_start_ofs
85   -_bss_start_ofs:
86   - .word __bss_start - _start
87   -
88   -.globl _bss_end_ofs
89   -_bss_end_ofs:
90   - .word __bss_end - _start
91   -
92   -.globl _end_ofs
93   -_end_ofs:
94   - .word _end - _start
95   -
96 73 #ifdef CONFIG_USE_IRQ
97 74 /* IRQ stack memory (calculated at run-time) */
98 75 .globl IRQ_STACK_START
arch/arm/cpu/pxa/start.S
... ... @@ -84,32 +84,6 @@
84 84 *************************************************************************
85 85 */
86 86  
87   -.globl _TEXT_BASE
88   -_TEXT_BASE:
89   -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
90   - .word CONFIG_SPL_TEXT_BASE
91   -#else
92   - .word CONFIG_SYS_TEXT_BASE
93   -#endif
94   -
95   -/*
96   - * These are defined in the board-specific linker script.
97   - * Subtracting _start from them lets the linker put their
98   - * relative position in the executable instead of leaving
99   - * them null.
100   - */
101   -.globl _bss_start_ofs
102   -_bss_start_ofs:
103   - .word __bss_start - _start
104   -
105   -.globl _bss_end_ofs
106   -_bss_end_ofs:
107   - .word __bss_end - _start
108   -
109   -.globl _end_ofs
110   -_end_ofs:
111   - .word _end - _start
112   -
113 87 #ifdef CONFIG_USE_IRQ
114 88 /* IRQ stack memory (calculated at run-time) */
115 89 .globl IRQ_STACK_START
... ... @@ -316,7 +290,6 @@
316 290 #ifdef CONFIG_SPL_BUILD
317 291 .align 5
318 292 do_hang:
319   - ldr sp, _TEXT_BASE /* use 32 words about stack */
320 293 bl hang /* hang and never return */
321 294 #else /* !CONFIG_SPL_BUILD */
322 295 .align 5
arch/arm/cpu/sa1100/start.S
... ... @@ -56,32 +56,6 @@
56 56 *************************************************************************
57 57 */
58 58  
59   -.globl _TEXT_BASE
60   -_TEXT_BASE:
61   -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
62   - .word CONFIG_SPL_TEXT_BASE
63   -#else
64   - .word CONFIG_SYS_TEXT_BASE
65   -#endif
66   -
67   -/*
68   - * These are defined in the board-specific linker script.
69   - * Subtracting _start from them lets the linker put their
70   - * relative position in the executable instead of leaving
71   - * them null.
72   - */
73   -.globl _bss_start_ofs
74   -_bss_start_ofs:
75   - .word __bss_start - _start
76   -
77   -.globl _bss_end_ofs
78   -_bss_end_ofs:
79   - .word __bss_end - _start
80   -
81   -.globl _end_ofs
82   -_end_ofs:
83   - .word _end - _start
84   -
85 59 #ifdef CONFIG_USE_IRQ
86 60 /* IRQ stack memory (calculated at run-time) */
87 61 .globl IRQ_STACK_START
arch/arm/lib/board.c
... ... @@ -105,8 +105,8 @@
105 105 {
106 106 printf("\n\n%s\n\n", version_string);
107 107 debug("U-Boot code: %08lX -> %08lX BSS: -> %08lX\n",
108   - _TEXT_BASE,
109   - _bss_start_ofs + _TEXT_BASE, _bss_end_ofs + _TEXT_BASE);
  108 + (ulong)&_start,
  109 + (ulong)&__bss_start, (ulong)&__bss_end);
110 110 #ifdef CONFIG_MODEM_SUPPORT
111 111 debug("Modem Support enabled\n");
112 112 #endif
113 113  
... ... @@ -273,13 +273,13 @@
273 273  
274 274 memset((void *)gd, 0, sizeof(gd_t));
275 275  
276   - gd->mon_len = _bss_end_ofs;
  276 + gd->mon_len = (ulong)&__bss_end - (ulong)_start;
277 277 #ifdef CONFIG_OF_EMBED
278 278 /* Get a pointer to the FDT */
279 279 gd->fdt_blob = __dtb_db_begin;
280 280 #elif defined CONFIG_OF_SEPARATE
281 281 /* FDT is at end of image */
282   - gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
  282 + gd->fdt_blob = &_end;
283 283 #endif
284 284 /* Allow the early environment to override the fdt address */
285 285 gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
... ... @@ -451,7 +451,7 @@
451 451  
452 452 gd->relocaddr = addr;
453 453 gd->start_addr_sp = addr_sp;
454   - gd->reloc_off = addr - _TEXT_BASE;
  454 + gd->reloc_off = addr - (ulong)&_start;
455 455 debug("relocation Offset is: %08lx\n", gd->reloc_off);
456 456 if (new_fdt) {
457 457 memcpy(new_fdt, gd->fdt_blob, fdt_size);
... ... @@ -516,7 +516,7 @@
516 516 gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
517 517 bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
518 518  
519   - monitor_flash_len = _end_ofs;
  519 + monitor_flash_len = (ulong)&__rel_dyn_end - (ulong)_start;
520 520  
521 521 /* Enable caches */
522 522 enable_caches();
board/armltd/integrator/lowlevel_init.S
... ... @@ -183,7 +183,7 @@
183 183  
184 184 /* Now 0x00000000 is writeable, replace the vectors */
185 185 ldr r0, =_start /* r0 <- start of vectors */
186   - ldr r2, =_TEXT_BASE /* r2 <- past vectors */
  186 + add r2, r0, #64 /* r2 <- past vectors */
187 187 sub r1,r1,r1 /* destination 0x00000000 */
188 188  
189 189 copy_vec:
board/cm4008/flash.c
... ... @@ -57,7 +57,7 @@
57 57 */
58 58 flash_protect (FLAG_PROTECT_SET,
59 59 CONFIG_SYS_FLASH_BASE,
60   - CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
  60 + CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start),
61 61 &flash_info[0]);
62 62  
63 63 return size;
board/cm41xx/flash.c
... ... @@ -57,7 +57,7 @@
57 57 */
58 58 flash_protect (FLAG_PROTECT_SET,
59 59 CONFIG_SYS_FLASH_BASE,
60   - CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
  60 + CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start),
61 61 &flash_info[0]);
62 62  
63 63 return size;
board/mpl/vcma9/lowlevel_init.S
... ... @@ -197,13 +197,10 @@
197 197 #define REFCNT_266 0
198 198 /**************************************/
199 199  
200   -_TEXT_BASE:
201   - .word CONFIG_SYS_TEXT_BASE
202   -
203 200 .globl lowlevel_init
204 201 lowlevel_init:
205 202 /* use r0 to relocate DATA read/write to flash rather than memory ! */
206   - ldr r0, _TEXT_BASE
  203 + ldr r0, =CONFIG_SYS_TEXT_BASE
207 204 ldr r13, =BWSCON
208 205  
209 206 /* enable minimal access to PLD */
board/samsung/goni/lowlevel_init.S
... ... @@ -22,9 +22,6 @@
22 22 * r9 has Mobile DDR size, 1 means 1GiB, 2 means 2GiB and so on
23 23 */
24 24  
25   -_TEXT_BASE:
26   - .word CONFIG_SYS_TEXT_BASE
27   -
28 25 .globl lowlevel_init
29 26 lowlevel_init:
30 27 mov r11, lr
board/samsung/smdk2410/lowlevel_init.S
... ... @@ -110,16 +110,13 @@
110 110 #define REFCNT 1113 /* period=15.6us, HCLK=60Mhz, (2048+1-15.6*60) */
111 111 /**************************************/
112 112  
113   -_TEXT_BASE:
114   - .word CONFIG_SYS_TEXT_BASE
115   -
116 113 .globl lowlevel_init
117 114 lowlevel_init:
118 115 /* memory control configuration */
119 116 /* make r0 relative the current location so that it */
120 117 /* reads SMRDATA out of FLASH rather than memory ! */
121 118 ldr r0, =SMRDATA
122   - ldr r1, _TEXT_BASE
  119 + ldr r1, =CONFIG_SYS_TEXT_BASE
123 120 sub r0, r0, r1
124 121 ldr r1, =BWSCON /* Bus Width Status Controller */
125 122 add r2, r0, #13*4
board/samsung/smdkc100/lowlevel_init.S
... ... @@ -17,9 +17,6 @@
17 17 * r5 has zero always
18 18 */
19 19  
20   -_TEXT_BASE:
21   - .word CONFIG_SYS_TEXT_BASE
22   -
23 20 .globl lowlevel_init
24 21 lowlevel_init:
25 22 mov r9, lr
board/ti/omap5912osk/lowlevel_init.S
... ... @@ -18,10 +18,6 @@
18 18 #include <./configs/omap1510.h>
19 19 #endif
20 20  
21   -
22   -_TEXT_BASE:
23   - .word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */
24   -
25 21 .globl lowlevel_init
26 22 lowlevel_init:
27 23  
... ... @@ -149,13 +149,9 @@
149 149 #ifndef CONFIG_SANDBOX
150 150 ulong bss_start, bss_end;
151 151  
152   -#ifdef CONFIG_SYS_SYM_OFFSETS
153   - bss_start = _bss_start_ofs + _TEXT_BASE;
154   - bss_end = _bss_end_ofs + _TEXT_BASE;
155   -#else
156 152 bss_start = (ulong)&__bss_start;
157 153 bss_end = (ulong)&__bss_end;
158   -#endif
  154 +
159 155 debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n",
160 156 CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
161 157 #endif
... ... @@ -279,8 +275,8 @@
279 275  
280 276 static int setup_mon_len(void)
281 277 {
282   -#ifdef CONFIG_SYS_SYM_OFFSETS
283   - gd->mon_len = _bss_end_ofs;
  278 +#ifdef __ARM__
  279 + gd->mon_len = (ulong)&__bss_end - (ulong)_start;
284 280 #elif defined(CONFIG_SANDBOX)
285 281 gd->mon_len = (ulong)&_end - (ulong)_init;
286 282 #else
287 283  
... ... @@ -363,11 +359,7 @@
363 359 gd->fdt_blob = __dtb_dt_begin;
364 360 #elif defined CONFIG_OF_SEPARATE
365 361 /* FDT is at end of image */
366   -# ifdef CONFIG_SYS_SYM_OFFSETS
367   - gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE);
368   -# else
369 362 gd->fdt_blob = (ulong *)&_end;
370   -# endif
371 363 #elif defined(CONFIG_OF_HOSTFILE)
372 364 if (read_fdt_from_file()) {
373 365 puts("Failed to read control FDT\n");
... ... @@ -128,8 +128,8 @@
128 128  
129 129 static int initr_reloc_global_data(void)
130 130 {
131   -#ifdef CONFIG_SYS_SYM_OFFSETS
132   - monitor_flash_len = _end_ofs;
  131 +#ifdef __ARM__
  132 + monitor_flash_len = _end - __image_copy_start;
133 133 #elif !defined(CONFIG_SANDBOX)
134 134 monitor_flash_len = (ulong)&__init_end - gd->relocaddr;
135 135 #endif
include/asm-generic/sections.h
... ... @@ -63,28 +63,16 @@
63 63 extern void _start(void);
64 64  
65 65 /*
66   - * ARM needs to use offsets for symbols, since the values of some symbols
67   - * are not resolved prior to relocation (and are just 0). Maybe this can be
68   - * resolved, or maybe other architectures are similar, iwc this should be
69   - * promoted to an architecture option.
  66 + * ARM defines its symbols as char[]. Other arches define them as ulongs.
70 67 */
71 68 #ifdef CONFIG_ARM
72   -#define CONFIG_SYS_SYM_OFFSETS
73   -#endif
74 69  
75   -#ifdef CONFIG_SYS_SYM_OFFSETS
76   -/* Start/end of the relocation entries, as an offset from _start */
77   -extern ulong _rel_dyn_start_ofs;
78   -extern ulong _rel_dyn_end_ofs;
79   -
80   -/* End of the region to be relocated, as an offset form _start */
81   -extern ulong _image_copy_end_ofs;
82   -
83   -extern ulong _bss_start_ofs; /* BSS start relative to _start */
84   -extern ulong _bss_end_ofs; /* BSS end relative to _start */
85   -extern ulong _end_ofs; /* end of image relative to _start */
86   -
87   -extern ulong _TEXT_BASE; /* code start */
  70 +extern char __bss_start[];
  71 +extern char __bss_end[];
  72 +extern char __image_copy_start[];
  73 +extern char __image_copy_end[];
  74 +extern char __rel_dyn_start[];
  75 +extern char __rel_dyn_end[];
88 76  
89 77 #else /* don't use offsets: */
90 78