summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map_groups.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2019-08-13 16:04:50 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-05 13:13:39 +0200
commit2bc1f53cc46a4d286869d2e955be84678d455bd1 (patch)
treeeeaad42b3f33d87573d046c18c652c559bfe39a7 /tools/perf/util/map_groups.h
parentc0282736b94f2b3f7841b276a6f8c20db629f5ac (diff)
downloadlinux-stable-2bc1f53cc46a4d286869d2e955be84678d455bd1.tar.gz
linux-stable-2bc1f53cc46a4d286869d2e955be84678d455bd1.tar.bz2
linux-stable-2bc1f53cc46a4d286869d2e955be84678d455bd1.zip
arm64/efi: Move variable assignments after SECTIONS
[ Upstream commit 90776dd1c427cbb4d381aa4b13338f1fb1d20f5e ] It seems that LLVM's linker does not correctly handle variable assignments involving section positions that are updated during the SECTIONS parsing. Commit aa69fb62bea1 ("arm64/efi: Mark __efistub_stext_offset as an absolute symbol explicitly") ran into this too, but found a different workaround. However, this was not enough, as other variables were also miscalculated which manifested as boot failures under UEFI where __efistub__end was not taking the correct _end value (they should be the same): $ ld.lld -EL -maarch64elf --no-undefined -X -shared \ -Bsymbolic -z notext -z norelro --no-apply-dynamic-relocs \ -o vmlinux.lld -T poc.lds --whole-archive vmlinux.o && \ readelf -Ws vmlinux.lld | egrep '\b(__efistub_|)_end\b' 368272: ffff000002218000 0 NOTYPE LOCAL HIDDEN 38 __efistub__end 368322: ffff000012318000 0 NOTYPE GLOBAL DEFAULT 38 _end $ aarch64-linux-gnu-ld.bfd -EL -maarch64elf --no-undefined -X -shared \ -Bsymbolic -z notext -z norelro --no-apply-dynamic-relocs \ -o vmlinux.bfd -T poc.lds --whole-archive vmlinux.o && \ readelf -Ws vmlinux.bfd | egrep '\b(__efistub_|)_end\b' 338124: ffff000012318000 0 NOTYPE LOCAL DEFAULT ABS __efistub__end 383812: ffff000012318000 0 NOTYPE GLOBAL DEFAULT 15325 _end To work around this, all of the __efistub_-prefixed variable assignments need to be moved after the linker script's SECTIONS entry. As it turns out, this also solves the problem fixed in commit aa69fb62bea1, so those changes are reverted here. Link: https://github.com/ClangBuiltLinux/linux/issues/634 Link: https://bugs.llvm.org/show_bug.cgi?id=42990 Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/perf/util/map_groups.h')
0 files changed, 0 insertions, 0 deletions