u-boot/arch/sandbox/cpu/u-boot-spl.lds
Andrew Scull 0648b13269 sandbox: Rename getopt sections
Rename the sections used for defining sandbox command line options so
that they don't start with a '.'. ELF says that sections starting with a
'.' are reserved for system use, but the sandbox runs as a normal user
process so should be using user sections instead.

Clang's ASAN adds redzones to non-user sections and the extra padding
meant that the list of options was being corrupted. Naming the sections
as user sections avoids this issue as clang handles them as we intended.

Signed-off-by: Andrew Scull <ascull@google.com>
2022-06-23 12:58:18 -04:00

31 lines
625 B
Text

/* 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(32);
.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;