arm: lib: Split asm symbols into different .text subsections

Split each symbol in lib1funcs into different .text.foo section instead
of placing all of them into plain .text . This allows the linker to collect
and discard unused assembler symbols.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Marek Vasut 2016-05-26 18:01:46 +02:00 committed by Tom Rini
parent 806f86bd82
commit 13b0a91a6d
7 changed files with 38 additions and 0 deletions

View file

@ -17,6 +17,7 @@
ENTRY(__ashldi3) ENTRY(__ashldi3)
ENTRY(__aeabi_llsl) ENTRY(__aeabi_llsl)
.pushsection .text.__ashldi3, "ax"
subs r3, r2, #32 subs r3, r2, #32
rsb ip, r2, #32 rsb ip, r2, #32
@ -28,5 +29,6 @@ ENTRY(__aeabi_llsl)
mov al, al, lsl r2 mov al, al, lsl r2
ret lr ret lr
.popsection
ENDPROC(__ashldi3) ENDPROC(__ashldi3)
ENDPROC(__aeabi_llsl) ENDPROC(__aeabi_llsl)

View file

@ -17,6 +17,7 @@
ENTRY(__ashrdi3) ENTRY(__ashrdi3)
ENTRY(__aeabi_lasr) ENTRY(__aeabi_lasr)
.pushsection .text.__ashrdi3, "ax"
subs r3, r2, #32 subs r3, r2, #32
rsb ip, r2, #32 rsb ip, r2, #32
@ -28,5 +29,6 @@ ENTRY(__aeabi_lasr)
mov ah, ah, asr r2 mov ah, ah, asr r2
ret lr ret lr
.popsection
ENDPROC(__ashrdi3) ENDPROC(__ashrdi3)
ENDPROC(__aeabi_lasr) ENDPROC(__aeabi_lasr)

View file

@ -47,6 +47,7 @@
ENTRY(__do_div64) ENTRY(__do_div64)
UNWIND(.fnstart) UNWIND(.fnstart)
.pushsection .text.__do_div64, "ax"
@ Test for easy paths first. @ Test for easy paths first.
subs ip, r4, #1 subs ip, r4, #1
@ -192,6 +193,7 @@ UNWIND(.fnstart)
moveq yh, xh moveq yh, xh
moveq xh, #0 moveq xh, #0
reteq lr reteq lr
.popsection
UNWIND(.fnend) UNWIND(.fnend)
UNWIND(.fnstart) UNWIND(.fnstart)

View file

@ -196,6 +196,7 @@
ENTRY(__udivsi3) ENTRY(__udivsi3)
ENTRY(__aeabi_uidiv) ENTRY(__aeabi_uidiv)
UNWIND(.fnstart) UNWIND(.fnstart)
.pushsection .text.__udivsi3, "ax"
subs r2, r1, #1 subs r2, r1, #1
reteq lr reteq lr
@ -219,12 +220,14 @@ UNWIND(.fnstart)
mov r0, r0, lsr r2 mov r0, r0, lsr r2
ret lr ret lr
.popsection
UNWIND(.fnend) UNWIND(.fnend)
ENDPROC(__udivsi3) ENDPROC(__udivsi3)
ENDPROC(__aeabi_uidiv) ENDPROC(__aeabi_uidiv)
ENTRY(__umodsi3) ENTRY(__umodsi3)
UNWIND(.fnstart) UNWIND(.fnstart)
.pushsection .text.__umodsi3, "ax"
subs r2, r1, #1 @ compare divisor with 1 subs r2, r1, #1 @ compare divisor with 1
bcc Ldiv0 bcc Ldiv0
@ -238,12 +241,14 @@ UNWIND(.fnstart)
ret lr ret lr
.popsection
UNWIND(.fnend) UNWIND(.fnend)
ENDPROC(__umodsi3) ENDPROC(__umodsi3)
ENTRY(__divsi3) ENTRY(__divsi3)
ENTRY(__aeabi_idiv) ENTRY(__aeabi_idiv)
UNWIND(.fnstart) UNWIND(.fnstart)
.pushsection .text.__divsi3, "ax"
cmp r1, #0 cmp r1, #0
eor ip, r0, r1 @ save the sign of the result. eor ip, r0, r1 @ save the sign of the result.
@ -280,12 +285,14 @@ UNWIND(.fnstart)
rsbmi r0, r0, #0 rsbmi r0, r0, #0
ret lr ret lr
.popsection
UNWIND(.fnend) UNWIND(.fnend)
ENDPROC(__divsi3) ENDPROC(__divsi3)
ENDPROC(__aeabi_idiv) ENDPROC(__aeabi_idiv)
ENTRY(__modsi3) ENTRY(__modsi3)
UNWIND(.fnstart) UNWIND(.fnstart)
.pushsection .text.__modsi3, "ax"
cmp r1, #0 cmp r1, #0
beq Ldiv0 beq Ldiv0
@ -305,6 +312,7 @@ UNWIND(.fnstart)
rsbmi r0, r0, #0 rsbmi r0, r0, #0
ret lr ret lr
.popsection
UNWIND(.fnend) UNWIND(.fnend)
ENDPROC(__modsi3) ENDPROC(__modsi3)
@ -313,6 +321,7 @@ ENDPROC(__modsi3)
ENTRY(__aeabi_uidivmod) ENTRY(__aeabi_uidivmod)
UNWIND(.fnstart) UNWIND(.fnstart)
UNWIND(.save {r0, r1, ip, lr} ) UNWIND(.save {r0, r1, ip, lr} )
.pushsection .text.__aeabi_uidivmod, "ax"
stmfd sp!, {r0, r1, ip, lr} stmfd sp!, {r0, r1, ip, lr}
bl __aeabi_uidiv bl __aeabi_uidiv
@ -321,12 +330,15 @@ UNWIND(.save {r0, r1, ip, lr} )
sub r1, r1, r3 sub r1, r1, r3
ret lr ret lr
.popsection
UNWIND(.fnend) UNWIND(.fnend)
ENDPROC(__aeabi_uidivmod) ENDPROC(__aeabi_uidivmod)
ENTRY(__aeabi_idivmod) ENTRY(__aeabi_idivmod)
UNWIND(.fnstart) UNWIND(.fnstart)
UNWIND(.save {r0, r1, ip, lr} ) UNWIND(.save {r0, r1, ip, lr} )
.pushsection .text.__aeabi_uidivmod, "ax"
stmfd sp!, {r0, r1, ip, lr} stmfd sp!, {r0, r1, ip, lr}
bl __aeabi_idiv bl __aeabi_idiv
ldmfd sp!, {r1, r2, ip, lr} ldmfd sp!, {r1, r2, ip, lr}
@ -334,6 +346,7 @@ UNWIND(.save {r0, r1, ip, lr} )
sub r1, r1, r3 sub r1, r1, r3
ret lr ret lr
.popsection
UNWIND(.fnend) UNWIND(.fnend)
ENDPROC(__aeabi_idivmod) ENDPROC(__aeabi_idivmod)
@ -343,16 +356,21 @@ Ldiv0:
UNWIND(.fnstart) UNWIND(.fnstart)
UNWIND(.pad #4) UNWIND(.pad #4)
UNWIND(.save {lr}) UNWIND(.save {lr})
.pushsection .text.Ldiv0, "ax"
str lr, [sp, #-8]! str lr, [sp, #-8]!
bl __div0 bl __div0
mov r0, #0 @ About as wrong as it could be. mov r0, #0 @ About as wrong as it could be.
ldr pc, [sp], #8 ldr pc, [sp], #8
.popsection
UNWIND(.fnend) UNWIND(.fnend)
ENDPROC(Ldiv0) ENDPROC(Ldiv0)
/* Thumb-1 specialities */ /* Thumb-1 specialities */
#if defined(CONFIG_SYS_THUMB_BUILD) && !defined(CONFIG_HAS_THUMB2) #if defined(CONFIG_SYS_THUMB_BUILD) && !defined(CONFIG_HAS_THUMB2)
ENTRY(__gnu_thumb1_case_sqi) ENTRY(__gnu_thumb1_case_sqi)
.pushsection .text.__gnu_thumb1_case_sqi, "ax"
push {r1} push {r1}
mov r1, lr mov r1, lr
lsrs r1, r1, #1 lsrs r1, r1, #1
@ -362,9 +380,11 @@ ENTRY(__gnu_thumb1_case_sqi)
add lr, lr, r1 add lr, lr, r1
pop {r1} pop {r1}
bx lr bx lr
.popsection
ENDPROC(__gnu_thumb1_case_sqi) ENDPROC(__gnu_thumb1_case_sqi)
ENTRY(__gnu_thumb1_case_uqi) ENTRY(__gnu_thumb1_case_uqi)
.pushsection .text.__gnu_thumb1_case_uqi, "ax"
push {r1} push {r1}
mov r1, lr mov r1, lr
lsrs r1, r1, #1 lsrs r1, r1, #1
@ -374,9 +394,11 @@ ENTRY(__gnu_thumb1_case_uqi)
add lr, lr, r1 add lr, lr, r1
pop {r1} pop {r1}
bx lr bx lr
.popsection
ENDPROC(__gnu_thumb1_case_uqi) ENDPROC(__gnu_thumb1_case_uqi)
ENTRY(__gnu_thumb1_case_shi) ENTRY(__gnu_thumb1_case_shi)
.pushsection .text.__gnu_thumb1_case_shi, "ax"
push {r0, r1} push {r0, r1}
mov r1, lr mov r1, lr
lsrs r1, r1, #1 lsrs r1, r1, #1
@ -387,9 +409,11 @@ ENTRY(__gnu_thumb1_case_shi)
add lr, lr, r1 add lr, lr, r1
pop {r0, r1} pop {r0, r1}
bx lr bx lr
.popsection
ENDPROC(__gnu_thumb1_case_shi) ENDPROC(__gnu_thumb1_case_shi)
ENTRY(__gnu_thumb1_case_uhi) ENTRY(__gnu_thumb1_case_uhi)
.pushsection .text.__gnu_thumb1_case_uhi, "ax"
push {r0, r1} push {r0, r1}
mov r1, lr mov r1, lr
lsrs r1, r1, #1 lsrs r1, r1, #1
@ -400,5 +424,6 @@ ENTRY(__gnu_thumb1_case_uhi)
add lr, lr, r1 add lr, lr, r1
pop {r0, r1} pop {r0, r1}
bx lr bx lr
.popsection
ENDPROC(__gnu_thumb1_case_uhi) ENDPROC(__gnu_thumb1_case_uhi)
#endif #endif

View file

@ -17,6 +17,7 @@
ENTRY(__lshrdi3) ENTRY(__lshrdi3)
ENTRY(__aeabi_llsr) ENTRY(__aeabi_llsr)
.pushsection .text.__lshldi3, "ax"
subs r3, r2, #32 subs r3, r2, #32
rsb ip, r2, #32 rsb ip, r2, #32
@ -28,5 +29,6 @@ ENTRY(__aeabi_llsr)
mov ah, ah, lsr r2 mov ah, ah, lsr r2
ret lr ret lr
.popsection
ENDPROC(__lshrdi3) ENDPROC(__lshrdi3)
ENDPROC(__aeabi_llsr) ENDPROC(__aeabi_llsr)

View file

@ -25,6 +25,7 @@
ENTRY(__muldi3) ENTRY(__muldi3)
ENTRY(__aeabi_lmul) ENTRY(__aeabi_lmul)
.pushsection .text.__muldi3, "ax"
mul xh, yl, xh mul xh, yl, xh
mla xh, xl, yh, xh mla xh, xl, yh, xh
@ -42,5 +43,6 @@ ENTRY(__aeabi_lmul)
adc xh, xh, ip, lsr #16 adc xh, xh, ip, lsr #16
ret lr ret lr
.popsection
ENDPROC(__muldi3) ENDPROC(__muldi3)
ENDPROC(__aeabi_lmul) ENDPROC(__aeabi_lmul)

View file

@ -34,6 +34,8 @@ TMP .req r8
) )
ENTRY(__aeabi_uldivmod) ENTRY(__aeabi_uldivmod)
.pushsection .text.__aeabi_uldivmod, "ax"
stmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) lr} stmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) lr}
@ Test if B == 0 @ Test if B == 0
orrs ip, B_0, B_1 @ Z set -> B == 0 orrs ip, B_0, B_1 @ Z set -> B == 0
@ -240,4 +242,5 @@ L_div_by_0:
mov R_0, #0 mov R_0, #0
mov R_1, #0 mov R_1, #0
ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc}
.popsection
ENDPROC(__aeabi_uldivmod) ENDPROC(__aeabi_uldivmod)