Re: [PATCH] firmware_loader: Fix labels with comma for builtin firmware

From: Luis Chamberlain
Date: Mon Nov 18 2019 - 15:16:22 EST

On Fri, Nov 15, 2019 at 11:59:11PM +0100, Linus Walleij wrote:
> Some firmware images contain a comma, such as:
> EXTRA_FIRMWARE "brcm/,gt-s7710.txt"
> as Broadcom firmware simply tags the device tree compatible
> string at the end of the firmware parameter file. And the
> compatible string contains a comma.
> This doesn't play well with gas:
> drivers/base/firmware_loader/builtin/brcm/,gt-s7710.txt.gen.S: Assembler messages:
> drivers/base/firmware_loader/builtin/brcm/,gt-s7710.txt.gen.S:4: Error: bad instruction `_fw_brcm_brcmfmac4334_sdio_samsung,gt_s7710_txt_bin:'
> drivers/base/firmware_loader/builtin/brcm/,gt-s7710.txt.gen.S:9: Error: bad instruction `_fw_brcm_brcmfmac4334_sdio_samsung,gt_s7710_txt_name:'
> drivers/base/firmware_loader/builtin/brcm/,gt-s7710.txt.gen.S:15: Error: can't resolve `.rodata' {.rodata section} - `_fw_brcm_brcmfmac4334_sdio_samsung' {*UND* section}
> make[6]: *** [../scripts/ drivers/base/firmware_loader/builtin/brcm/,gt-s7710.txt.gen.o] Error 1
> We need to get rid of the comma from the labels used by the
> assembly stub generator.
> Replacing a comma using GNU Make subst requires a helper
> variable.
> Cc: Stephan Gerhold <stephan@xxxxxxxxxxx>
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Loading should still work after this patch given that the original
firmware name is kept in a different variable FWNAME, and used as a
variable for the object entry.

Acked-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>