Hi Chris,
On 11/4/24 5:55 PM, Chris Kay wrote:
Ah, sorry, I was building for RK3588 – got confused about what’s building where. Anyway, the issue is that the INCBIN macro creates sections without indicating their attributes, and .incbin does not provide enough information about what the binary data is to allow it to infer them. It’s generally reasonable to assume that the data is SHF_ALLOC, which I guess is what LD does, but evidently not LLD. The fix is quite simple:
diff --git a/plat/rockchip/rk3399/drivers/pmu/pmu_fw.S b/plat/rockchip/rk3399/drivers/pmu/pmu_fw.S index 26f331317..74f569402 100644 --- a/plat/rockchip/rk3399/drivers/pmu/pmu_fw.S +++ b/plat/rockchip/rk3399/drivers/pmu/pmu_fw.S @@ -6,7 +6,7 @@
/* convoluted way to make sure that the define is pasted just the right way */ .macro INCBIN file sym sec
.section \sec
.section \sec, "a" .global \sym .type \sym, @object .align 4
That did the trick, thanks.
With the following changes:
""" diff --git a/plat/rockchip/rk3399/drivers/pmu/pmu_fw.S b/plat/rockchip/rk3399/drivers/pmu/pmu_fw.S index 26f331317..db2d4219a 100644 --- a/plat/rockchip/rk3399/drivers/pmu/pmu_fw.S +++ b/plat/rockchip/rk3399/drivers/pmu/pmu_fw.S @@ -6,16 +6,16 @@
/* convoluted way to make sure that the define is pasted just the right way */ .macro INCBIN file sym sec - .section \sec + .section \sec, "a" .global \sym .type \sym, @object .align 4 \sym : - .incbin \file + .incbin "\file" .size \sym , .-\sym .global \sym()_end \sym()_end : .endm
-INCBIN ""RK3399M0FW"", "rk3399m0_bin", ".sram.incbin" -INCBIN ""RK3399M0PMUFW"", "rk3399m0pmu_bin", ".pmusram.incbin" +INCBIN RK3399M0FW, "rk3399m0_bin", ".sram.incbin" +INCBIN RK3399M0PMUFW, "rk3399m0pmu_bin", ".pmusram.incbin" """
RK3399 (the cortex-A part only!) now builds with GCC and clang.
I'm not entirely sure the INCBIN changes are safe, but the RK3399M0*FW are all strings with escaped quotes, so maybe that's safe enough?
Are you going to send a patch or should I send it? I don't really understand the fix so I would add the sentence in your previous mail in the commit log instead of coming up with something on my own. Let me know!
Thanks for the help and fixes!
Cheers, Quentin