mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-29 05:18:51 +09:00
![Marek Behún](/assets/img/avatar_default.png)
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 <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
32 lines
624 B
Plaintext
32 lines
624 B
Plaintext
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Copyright (c) 2011-2012 The Chromium OS Authors.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
SECTIONS
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
.u_boot_list : {
|
|
KEEP(*(SORT(.u_boot_list*)));
|
|
}
|
|
|
|
/* Private data for devices with OF_PLATDATA_RT */
|
|
. = ALIGN(4);
|
|
.priv_data : {
|
|
__priv_data_start = .;
|
|
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.priv_data*)))
|
|
__priv_data_end = .;
|
|
}
|
|
|
|
_u_boot_sandbox_getopt : {
|
|
*(.u_boot_sandbox_getopt_start)
|
|
KEEP(*(.u_boot_sandbox_getopt))
|
|
*(.u_boot_sandbox_getopt_end)
|
|
}
|
|
}
|
|
|
|
INSERT AFTER .data;
|