powerpc/boot: Fix crt0.S current address branch form
Nicholas Piggin
reviewerPATCH 1/1 powerpc/boot: Fix crt0.S current address branch form
Use the preferred form of branch-and-link for finding the current address so objtool doesn't think it is an unannotated intra-function call.
--- arch/powerpc/boot/crt0.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/boot/crt0.S +2 -2
@@ -51,7 +51,7 @@ _zimage_start: _zimage_start_lib: /* Work out the offset between the address we were linked at and the address where we're running. */ - bl .+4 + bcl 20,31,.+4 p_base: mflr r10 /* r10 now points to runtime addr of p_base */ #ifndef __powerpc64__ /* grab the link address of the dynamic section in r11 */
@@ -274,7 +274,7 @@ prom: mtsrr1 r10 /* Load FW address, set LR to label 1, and jump to FW */ - bl 0f + bcl 20,31,0f 0: mflr r10 addi r11,r10,(1f-0b) mtlr r11
Signature · 1 line
2.40.0
Michael Ellerman
reviewerQuoted 3 lines · Nicholas Piggin
Use the preferred form of branch-and-link for finding the current address so objtool doesn't think it is an unannotated intra-function call.
We don't run objtool on this code in mainline AFAIK. Because BOOTAS doesn't call it.
Did you actually see a warning, or are you just anticipating that it would warn about it?
This diff would run it on boot asm and seems to build OK, so maybe we should do that.
arch/powerpc/boot/Makefile +1 -1
@@ -223,7 +223,7 @@ quiet_cmd_bootcc = BOOTCC $@ cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< quiet_cmd_bootas = BOOTAS $@ - cmd_bootas = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $< + cmd_bootas = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $< $(cmd_objtool) quiet_cmd_bootar = BOOTAR $@ cmd_bootar = $(BOOTAR) $(BOOTARFLAGS) $@.$$$$ $(real-prereqs); mv $@.$$$$ $@
cheers
Michael Ellerman
reviewerQuoted 7 lines · Michael Ellerman
Quoted 3 lines · Nicholas Piggin
Use the preferred form of branch-and-link for finding the current address so objtool doesn't think it is an unannotated intra-function call.
We don't run objtool on this code in mainline AFAIK. Because BOOTAS doesn't call it.
But as Nick pointed out, if you run:
$ make arch/powerpc/boot/crt0.o
It does run objtool, because it uses the generic cmd_as_o_S rule instead of the BOOTAS rule.
cheers
Michael Ellerman
AppliedQuoted 5 lines · Nicholas Piggin
Use the preferred form of branch-and-link for finding the current address so objtool doesn't think it is an unannotated intra-function call.
Applied to powerpc/next.
[1/1] powerpc/boot: Fix crt0.S current address branch form
https://git.kernel.org/powerpc/c/cd99dac6ec5fff763852d8ccb8a79f5de50ed830
cheers