Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
clear bss
Browse files Browse the repository at this point in the history
  • Loading branch information
misson20000 committed Feb 19, 2018
1 parent e79f9ce commit 4db87d3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/crt0.nro.S
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ IS_NRO:
.section .text, "e"
.global start
start:
// clear .bss
adrp x5, NORELOC_BSS_START_
adrp x6, NORELOC_BSS_END_

bssloop:
cmp x5, x6
b.eq run
str xzr, [x5]
add x5, x5, 8
b bssloop

run:
adrp x2, _start // aslr base

// set LR to svcExitProcess if it's null
Expand Down

0 comments on commit 4db87d3

Please sign in to comment.