Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reform
reform-boundary-uboot
Commits
24762f05
Commit
24762f05
authored
7 years ago
by
Troy Kisky
Browse files
Options
Downloads
Patches
Plain Diff
arch: arm: relocate: print invalid relocation entries
Signed-off-by:
Troy Kisky
<
troy.kisky@boundarydevices.com
>
parent
41a5c481
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arch/arm/lib/relocate.S
+90
-1
90 additions, 1 deletion
arch/arm/lib/relocate.S
with
90 additions
and
1 deletion
arch/arm/lib/relocate.S
+
90
−
1
View file @
24762f05
...
@@ -77,6 +77,7 @@ ENDPROC(relocate_vectors)
...
@@ -77,6 +77,7 @@ ENDPROC(relocate_vectors)
*/
*/
ENTRY
(
relocate_code
)
ENTRY
(
relocate_code
)
stmdb
sp
!,
{
lr
}
ldr
r1
,
=
__image_copy_start
/*
r1
<-
SRC
&
__image_copy_start
*/
ldr
r1
,
=
__image_copy_start
/*
r1
<-
SRC
&
__image_copy_start
*/
subs
r4
,
r0
,
r1
/*
r4
<-
relocation
offset
*/
subs
r4
,
r0
,
r1
/*
r4
<-
relocation
offset
*/
beq
relocate_done
/*
skip
relocation
*/
beq
relocate_done
/*
skip
relocation
*/
...
@@ -99,6 +100,20 @@ fixloop:
...
@@ -99,6 +100,20 @@ fixloop:
cmp
r1
,
#
R_ARM_RELATIVE
cmp
r1
,
#
R_ARM_RELATIVE
bne
fixnext
bne
fixnext
tst
r0
,
#
3
beq
1
f
sub
r0
,
r2
,
#
8
bl
prhex
mov
r0
,
#
':'
bl
pr_c
ldr
r0
,[
r2
,
#-
8
]
bl
prhex
mov
r0
,
#
'_'
bl
pr_c
ldr
r0
,[
r2
,
#-
4
]
bl
prhex
b
fixnext
1
:
/
*
relative
fix
:
increase
location
by
offset
*/
/
*
relative
fix
:
increase
location
by
offset
*/
add
r0
,
r0
,
r4
add
r0
,
r0
,
r4
ldr
r1
,
[
r0
]
ldr
r1
,
[
r0
]
...
@@ -124,7 +139,81 @@ relocate_done:
...
@@ -124,7 +139,81 @@ relocate_done:
#ifdef __ARM_ARCH_4__
#ifdef __ARM_ARCH_4__
mov
pc
,
lr
mov
pc
,
lr
#else
#else
bx
lr
ldmia
sp
!,
{
pc
}
#endif
#endif
ENDPROC
(
relocate_code
)
ENDPROC
(
relocate_code
)
ENTRY
(
prhex
)
stmdb
sp
!,
{
r0
-
r6
,
lr
}
mov
r6
,
#
8
mov
r5
,
r0
1
:
mov
r0
,
r5
,
lsr
#
28
cmp
r0
,
#
10
addlt
r0
,
r0
,
#
'0'
addge
r0
,
r0
,
#
'a'
-
10
bl
pr_c
mov
r5
,
r5
,
lsl
#
4
subs
r6
,
r6
,
#
1
bne
1
b
mov
r0
,#
'\n'
bl
pr_c
mov
r0
,#
'\r'
bl
pr_c
ldmia
sp
!,
{
r0
-
r6
,
pc
}
ENDPROC
(
prhex
)
#define UTXD 0x40
#define UTS 0xb4
#define UTS_TXEMPTY (1<<6)
ENTRY
(
pr_c
)
stmdb
sp
!,
{
r0
-
r1
,
lr
}
ldr
r1
,
=
CONFIG_MXC_UART_BASE
str
r0
,
[
r1
,#
UTXD
]
1
:
ldr
r0
,
[
r1
,#
UTS
]
tst
r0
,
#
UTS_TXEMPTY
beq
1
b
ldmia
sp
!,
{
r0
-
r1
,
pc
}
ENDPROC
(
pr_c
)
#if 0
ENTRY
(
verify_relocate_table
)
stmdb
sp
!,
{
lr
}
/
*
*
check
.
rel
.
dyn
relocations
*/
ldr
r2
,
=
__rel_dyn_start
/*
r2
<-
SRC
&
__rel_dyn_start
*/
ldr
r3
,
=
__rel_dyn_end
/*
r3
<-
SRC
&
__rel_dyn_end
*/
1
:
ldmia
r2
!,
{
r0
-
r1
}
/*
(
r0
,
r1
)
<-
(
SRC
location
,
fixup
)
*/
and
r1
,
r1
,
#
0xff
cmp
r1
,
#
R_ARM_RELATIVE
bne
3
f
tst
r0
,
#
3
beq
2
f
sub
r0
,
r2
,
#
8
bl
prhex
mov
r0
,
#
':'
bl
pr_c
ldr
r0
,[
r2
,
#-
8
]
bl
prhex
mov
r0
,
#
'_'
bl
pr_c
ldr
r0
,[
r2
,
#-
4
]
bl
prhex
mov
r0
,
#
1
ldmia
sp
!,
{
pc
}
2
:
3
:
cmp
r2
,
r3
blo
1
b
mov
r0
,
#
0
ldmia
sp
!,
{
pc
}
ENDPROC
(
verify_relocate_table
)
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment