arm: Clear the gp register alias at the end of functions

We reset .Lpic_gp to zero at the start of each function, which means
that the logic within movrelx for clearing gp when necessary will
be missed.

This fixes using movrelx in different functions with a different
helper register.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2016-11-10 13:23:38 +02:00
parent 905cdcaa9d
commit 824e8c2840
1 changed files with 3 additions and 0 deletions

View File

@ -83,6 +83,9 @@ ELF .section .note.GNU-stack,"",%progbits @ Mark stack as non-executable
put_pic %(.Lpic_idx - 1) put_pic %(.Lpic_idx - 1)
.noaltmacro .noaltmacro
.endif .endif
.if .Lpic_gp
.unreq gp
.endif
ELF .size \name, . - \name ELF .size \name, . - \name
FUNC .endfunc FUNC .endfunc
.purgem endfunc .purgem endfunc