From: Marek Behun <marek.behun@nic.cz>
To: u-boot@lists.denx.de
Subject: [PATCH u-boot v2 10/38] efi_loader: fix warning when linking with LTO
Date: Mon, 15 Mar 2021 23:34:20 +0100 [thread overview]
Message-ID: <20210315233420.34a7e7cd@nic.cz> (raw)
In-Reply-To: <be65b10f-3268-b1dd-742d-97e85f74bfb8@gmx.de>
On Fri, 12 Mar 2021 17:42:35 +0100
Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> On 12.03.21 11:34, Marek Beh?n wrote:
> > When linking with LTO, the compiler complains about type mismatch of
> > variables `__efi_runtime_start`, `__efi_runtime_stop`,
> > `__efi_runtime_rel_start` and `__efi_runtime_rel_stop`:
> >
> > include/efi_loader.h:218:21: warning: type of ?__efi_runtime_start?
> > does not match original
> > declaration [-Wlto-type-mismatch]
> > 218 | extern unsigned int __efi_runtime_start, __efi_runtime_stop;
> > | ^
> > arch/sandbox/lib/sections.c:7:6: note: ?__efi_runtime_start? was
> > previously declared here
> > 7 | char __efi_runtime_start[0] __attribute__((section(".__efi_run
> > | ^
> >
> > Change the type to char[] in include/efi_loader.h.
> >
> > Signed-off-by: Marek Beh?n <marek.behun@nic.cz>
> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>
> This patch leaves us with definition differences:
>
> We have:
>
> arch/arm/lib/sections.c:31:
> char __efi_runtime_start[0]
> __attribute__((section(".__efi_runtime_start")));
>
> arch/x86/lib/sections.c:6:char __efi_runtime_start[0]
> __attribute__((section(".__efi_runtime_start")));
>
> We should use [] everywhere. [0] was needed by elder GCC versions.
No, these two things are different: in the header file we have an
extern declaration, while in the sections.c files those are definitions.
We cannot use char __efi_runtime_start[] for definition, the compiler
will complain:
warning: array ?__efi_runtime_start? assumed to have one element
On the other hand the sections.c file explains why those symbols need
to be declared in a C file and why a 0-size array is chosen.
Marek
next prev parent reply other threads:[~2021-03-15 22:34 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-12 10:33 [PATCH u-boot v2 00/38] U-Boot LTO (Sandbox + Some ARM boards) Marek Behún
2021-03-12 10:33 ` [PATCH u-boot v2 01/38] regmap: fix a serious pointer casting bug Marek Behún
2021-03-12 10:33 ` [PATCH u-boot v2 02/38] api: fix a potential serious bug caused by undef CONFIG_SYS_64BIT_LBA Marek Behún
2021-03-12 10:33 ` [PATCH u-boot v2 03/38] checkpatch: require quotes around section name in the __section() macro Marek Behún
2021-03-12 10:33 ` [PATCH u-boot v2 04/38] treewide: Convert macro and uses of __section(foo) to __section("foo") Marek Behún
2021-03-12 10:33 ` [PATCH u-boot v2 05/38] compiler.h: align the __ADDRESSABLE macro with Linux' version Marek Behún
2021-03-12 10:33 ` [PATCH u-boot v2 06/38] linker_lists: prepare macros to avoid code repetition Marek Behún
2021-03-12 10:33 ` [PATCH u-boot v2 07/38] test/py: improve regular expression for ut subtest symbol matcher Marek Behún
2021-03-12 10:33 ` [PATCH u-boot v2 08/38] linker_lists: declare lists and entries as __ADDRESSABLE for LTO Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 09/38] string: make memcpy(), memset(), memcmp() and memmove() visible " Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 10/38] efi_loader: fix warning when linking with LTO Marek Behún
2021-03-12 16:42 ` Heinrich Schuchardt
2021-03-15 22:34 ` Marek Behun [this message]
2021-03-12 10:34 ` [PATCH u-boot v2 11/38] efi_loader: add Sphinx doc for __efi_runtime and __efi_runtime_data Marek Behún
2021-03-12 16:45 ` Heinrich Schuchardt
2021-03-12 10:34 ` [PATCH u-boot v2 12/38] efi_loader: add macro for const EFI runtime data Marek Behún
2021-03-12 16:47 ` Heinrich Schuchardt
2021-03-12 10:34 ` [PATCH u-boot v2 13/38] efi_selftest: compiler flags for efi_selftest_miniapp_exception.o Marek Behún
2021-03-12 16:49 ` Heinrich Schuchardt
2021-03-12 10:34 ` [PATCH u-boot v2 14/38] lib: crc32: put the crc_table variable into efi_runtime_rodata section Marek Behún
2021-03-12 16:51 ` Heinrich Schuchardt
2021-03-12 10:34 ` [PATCH u-boot v2 15/38] Makefile, Makefile.spl: cosmetic change Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 16/38] build: use thin archives instead of incremental linking Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 17/38] build: support building with Link Time Optimizations Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 18/38] sandbox: errno: avoid conflict with libc's errno Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 19/38] sandbox: use sections instead of symbols for getopt array boundaries Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 20/38] sandbox: make LTO available Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 21/38] sandbox: enable LTO by default Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 22/38] ARM: global_data: make set_gd() work for armv5 and armv6 Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 23/38] ARM: make gd a function call for LTO and set via set_gd() Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 24/38] ARM: fix LTO build for some thumb-interwork cases Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 25/38] ARM: fix LTO for imx28_xea Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 26/38] ARM: fix LTO for apf27 Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 27/38] ARM: fix LTO for keystone Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 28/38] ARM: kona: fix clk_bsc_enable() type mismatch for LTO Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 29/38] ARM: imx8m: fix imx_eqos_txclk_set_rate() " Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 30/38] ARM: fix LTO for seaboard Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 31/38] ARM: fix LTO for rockchip and samsung Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 32/38] ARM: omap3: fix LTO for DM3730 (and possibly other omap3 boards) Marek Behún
2021-03-12 13:43 ` Adam Ford
2021-03-13 15:23 ` Adam Ford
2021-03-13 16:05 ` Marek Behun
2021-03-13 17:34 ` Adam Ford
2021-03-12 10:34 ` [PATCH u-boot v2 33/38] armv8: SPL: discard relocation information Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 34/38] ata: ahci: fix ahci_link_up() type mismatch for LTO Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 35/38] ARM: make LTO available Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 36/38] ARM: don't use -ffunction-sections/-fdata-sections with LTO build Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 37/38] ARM: don't use --gc-sections with LTO when using private libgcc Marek Behún
2021-03-12 10:34 ` [PATCH u-boot v2 38/38] ARM: enable LTO for some boards Marek Behún
2021-03-12 14:21 ` [PATCH u-boot v2 00/38] U-Boot LTO (Sandbox + Some ARM boards) Harald Seiler
2021-03-12 14:26 ` Marek Behun
2021-03-12 15:07 ` Harald Seiler
2021-03-12 15:11 ` Harald Seiler
2021-03-12 15:18 ` Marek Behun
2021-03-12 15:17 ` Pali Rohár
2021-03-12 15:26 ` Harald Seiler
2021-03-12 15:32 ` Pali Rohár
2021-03-12 15:33 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210315233420.34a7e7cd@nic.cz \
--to=marek.behun@nic.cz \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox