Browse Source
Using the asm .incbin statement in C sources breaks gcc wrapper. Build fails with a following errors: /tmp/ccRXHTU4.s: Assembler messages: /tmp/ccRXHTU4.s:34: Warning: dwarf line number information for .pmusram.incbin ignored ... /tmp/ccRXHTU4.s:2119: Warning: dwarf line number information for .pmusram.incbin ignored /tmp/ccRXHTU4.s:112497: Error: leb128 operand is an undefined symbol: .LVU5 /tmp/ccRXHTU4.s:112498: Error: leb128 operand is an undefined symbol: .LVU6 /tmp/ccRXHTU4.s:112507: Error: leb128 operand is an undefined symbol: .LVU9 ... /tmp/ccRXHTU4.s:115407: Error: leb128 operand is an undefined symbol: .LVU668 /tmp/ccRXHTU4.s:115408: Error: leb128 operand is an undefined symbol: .LVU710 /tmp/ccRXHTU4.s:115409: Error: leb128 operand is an undefined symbol: .LVU713 lto-wrapper: fatal error: aarch64-none-elf-gcc returned 1 exit status compilation terminated. aarch64-none-elf/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status Fix it in a similar way to what the Linux kernel does, see commit 919aa45e43a84d40c27c83f6117cfa6542cee14e (MODSIGN: Avoid using .incbin in C source). [1] 1. https://lkml.org/lkml/2012/12/4/136 Change-Id: Iecc19729ce59e8c3b3c30fa37b1fddef95e83c96 Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>pull/2000/merge
Andrey Skvortsov
11 months ago
3 changed files with 24 additions and 25 deletions
@ -0,0 +1,21 @@ |
|||
/* |
|||
* Copyright (c) 2024, ARM Limited and Contributors. All rights reserved. |
|||
* |
|||
* SPDX-License-Identifier: BSD-3-Clause |
|||
*/ |
|||
|
|||
/* convoluted way to make sure that the define is pasted just the right way */ |
|||
.macro INCBIN file sym sec |
|||
.section \sec |
|||
.global \sym |
|||
.type \sym, @object |
|||
.align 4 |
|||
\sym : |
|||
.incbin \file |
|||
.size \sym , .-\sym |
|||
.global \sym\()_end |
|||
\sym\()_end : |
|||
.endm |
|||
|
|||
INCBIN ""RK3399M0FW"", "rk3399m0_bin", ".sram.incbin" |
|||
INCBIN ""RK3399M0PMUFW"", "rk3399m0pmu_bin", ".pmusram.incbin" |
@ -1,22 +0,0 @@ |
|||
/*
|
|||
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. |
|||
* |
|||
* SPDX-License-Identifier: BSD-3-Clause |
|||
*/ |
|||
|
|||
/* convoluted way to make sure that the define is pasted just the right way */ |
|||
#define INCBIN(file, sym, sec) \ |
|||
__asm__( \ |
|||
".section " sec "\n" \ |
|||
".global " sym "\n" \ |
|||
".type " sym ", %object\n" \ |
|||
".align 4\n" \ |
|||
sym ":\n" \ |
|||
".incbin \"" file "\"\n" \ |
|||
".size " sym ", .-" sym "\n" \ |
|||
".global " sym "_end\n" \ |
|||
sym "_end:\n" \ |
|||
) |
|||
|
|||
INCBIN(RK3399M0FW, "rk3399m0_bin", ".sram.incbin"); |
|||
INCBIN(RK3399M0PMUFW, "rk3399m0pmu_bin", ".pmusram.incbin"); |
Loading…
Reference in new issue