From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 20 May 2021 11:51:57 -0600 Subject: [PATCH u-boot v4 17/36] sandbox: use sections instead of symbols for getopt array boundaries In-Reply-To: <20210520112425.25166-18-marek.behun@nic.cz> References: <20210520112425.25166-1-marek.behun@nic.cz> <20210520112425.25166-18-marek.behun@nic.cz> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 20 May 2021 at 05:25, Marek Beh?n wrote: > > In style of linked lists, instead of declaring symbols for boundaries > of getopt options array in the linker script, declare corresponding > sections and retrieve the boundaries via static inline functions. > > Without this clang's LTO produces binary without any getopt options, > because for some reason it thinks that array is empty (start and end > symbols are at the same address). > > Signed-off-by: Marek Beh?n > --- > arch/sandbox/cpu/os.c | 3 ++- > arch/sandbox/cpu/start.c | 3 ++- > arch/sandbox/cpu/u-boot-spl.lds | 8 +++++--- > arch/sandbox/cpu/u-boot.lds | 8 +++++--- > arch/sandbox/include/asm/sections.h | 21 ++++++++++++++++++--- > 5 files changed, 32 insertions(+), 11 deletions(-) Reviewed-by: Simon Glass