blob: f10c4c84693848627ef0ac847dba661b55874688 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#include <linux/linkage.h>
#include <asm/assembler.h>
.section ".text_bare_init","ax"
/*
* Get the offset between the link address and the address
* we are currently running at.
*/
ENTRY(get_runtime_offset)
1: adr r0, 1b
ldr r1, linkadr
subs r0, r1, r0
THUMB( subs r0, r0, #1)
mov pc, lr
linkadr:
.word get_runtime_offset
ENDPROC(get_runtime_offset)
.globl __ld_var_base
__ld_var_base:
/*
* Functions to calculate selected linker supplied variables during runtime.
* This is needed for relocatable binaries when the linker variables are
* needed before finxing up the relocations.
*/
.macro ld_var_entry name
ENTRY(__ld_var_\name)
ldr r0, __\name
b 1f
__\name: .word \name - __ld_var_base
ENDPROC(__ld_var_\name)
.endm
ld_var_entry _text
ld_var_entry __rel_dyn_start
ld_var_entry __rel_dyn_end
ld_var_entry __dynsym_start
ld_var_entry __dynsym_end
ld_var_entry _barebox_image_size
ld_var_entry __bss_start
ld_var_entry __bss_stop
#ifdef __PBL__
ld_var_entry __image_end
#endif
1:
ldr r1, =__ld_var_base
adds r0, r0, r1
mov pc, lr
|