-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LLD + ThinLTO fails with "SHF_MERGE section size must be a multiple of sh_entsize" #510
Comments
Clearly there's something funky going on with ThinLTO, because according to the ELF specification, LLD is correct here. However, changing |
Apologies for the delay in replying. The requirement in ELF is for the SHF_MERGE section to consist of an array of identically sized entries. LLD's position in giving an error when a SHF_MERGE section doesn't conform to that is conservative. If the compiler has taken advantage of the entry size, such as when the constants are loaded with vector instructions with alignment requirements, LLD could be protecting against a run-time error. If the compiler hasn't then LLD could just treat the SHF_MERGE section as a normal Data section (returning false) and there won't be a problem. I don't know what happens in the case with the kernel, it will be safe to return false if the data in the section is never used. I don't know whether the boot process touches it or not. In practice the uses of SHF_MERGE in clang and gcc tends to use these sections for 8, 16 and 32 byte aligned data that is often loaded by vector instructions, in these cases I think that a malformed SHF_MERGE section is likely going to cause strange runtime behaviour if the data is accessed. A case could be made for only giving an error message if the sh_entsize was <= sh_align as this would imply that the compiler has taken advantage of the structure of the data, however given this is the first time I've seen this error occur, I think it is more indicative of a real problem than LLD being fussy. |
Thanks for the response, that makes sense. I managed to track down the code that generates this section. It's in drivers/soc/tegra/fuse/speedo-tegra210.c: static const u32 __initconst cpu_process_speedos[][CPU_PROCESS_CORNERS] = {
{ 2119, UINT_MAX },
{ 2119, UINT_MAX },
};
static const u32 __initconst gpu_process_speedos[][GPU_PROCESS_CORNERS] = {
{ UINT_MAX, UINT_MAX },
{ UINT_MAX, UINT_MAX },
};
static const u32 __initconst soc_process_speedos[][SOC_PROCESS_CORNERS] = {
{ 1950, 2100, UINT_MAX },
{ 1950, 2100, UINT_MAX },
} Where
Note that this appears not to be the case here. sh_entsize is 16 bytes, but sh_align is 4. We can work around the problem by disabling |
Disable temporarily to work around a problem with ThinLTO+LLD. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Link: ClangBuiltLinux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Change-Id: I792b52370ff66749ee2783d4d54032ee013ca5aa Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev> Signed-off-by: CloudedQuartz <ravenklawasd@gmail.com> Signed-off-by: GeoPD <geoemmanuelpd2001@gmail.com> Signed-off-by: Dmitrii <bankersenator@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Change-Id: I792b52370ff66749ee2783d4d54032ee013ca5aa Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev> Signed-off-by: CloudedQuartz <ravenklawasd@gmail.com> Signed-off-by: GeoPD <geoemmanuelpd2001@gmail.com> Signed-off-by: Dmitrii <bankersenator@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Change-Id: I792b52370ff66749ee2783d4d54032ee013ca5aa Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev> Signed-off-by: CloudedQuartz <ravenklawasd@gmail.com> Signed-off-by: GeoPD <geoemmanuelpd2001@gmail.com> Signed-off-by: Dmitrii <bankersenator@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev> Signed-off-by: Jprimero15 <jprimero155@gmail.com> Signed-off-by: wulan17 <wulan17@nusantararom.org>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Change-Id: I792b52370ff66749ee2783d4d54032ee013ca5aa Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev> Signed-off-by: CloudedQuartz <ravenklawasd@gmail.com> Signed-off-by: GeoPD <geoemmanuelpd2001@gmail.com> Signed-off-by: Dmitrii <bankersenator@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Dakkshesh <dakkshesh5@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Dakkshesh <dakkshesh5@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Change-Id: I792b52370ff66749ee2783d4d54032ee013ca5aa Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev> Signed-off-by: CloudedQuartz <ravenklawasd@gmail.com> Signed-off-by: GeoPD <geoemmanuelpd2001@gmail.com> Signed-off-by: Dmitrii <bankersenator@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Dakkshesh <dakkshesh5@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Dakkshesh <dakkshesh5@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Dakkshesh <dakkshesh5@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Change-Id: I792b52370ff66749ee2783d4d54032ee013ca5aa Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev> Signed-off-by: CloudedQuartz <ravenklawasd@gmail.com> Signed-off-by: GeoPD <geoemmanuelpd2001@gmail.com> Signed-off-by: Dmitrii <bankersenator@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Change-Id: I792b52370ff66749ee2783d4d54032ee013ca5aa Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev> Signed-off-by: CloudedQuartz <ravenklawasd@gmail.com> Signed-off-by: GeoPD <geoemmanuelpd2001@gmail.com> Signed-off-by: Dmitrii <bankersenator@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Change-Id: I792b52370ff66749ee2783d4d54032ee013ca5aa Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev> Signed-off-by: CloudedQuartz <ravenklawasd@gmail.com> Signed-off-by: GeoPD <geoemmanuelpd2001@gmail.com> Signed-off-by: Dmitrii <bankersenator@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Rve <rve27github@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Rve <rve27github@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Change-Id: I792b52370ff66749ee2783d4d54032ee013ca5aa Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev> Signed-off-by: CloudedQuartz <ravenklawasd@gmail.com> Signed-off-by: GeoPD <geoemmanuelpd2001@gmail.com>
Disable CONFIG_ARCH_TEGRA_210_SOC with LTO to work around an issue with ThinLTO. Bug: 145210207 Change-Id: Idc2792d6b7d0c755f6f7695cf0b20fa49721d09c Link: ClangBuiltLinux/linux#510 Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Dakkshesh <dakkshesh5@gmail.com>
After working around issue #509, an arm64 defconfig still fails to link with ThinLTO with the following LLD error:
While the error message is not very informative, the section it refers to is
.init.rodata
and the size is 56 bytes, while sh_entsize is 16 bytes.The text was updated successfully, but these errors were encountered: