android_kernel_sony_sdm845/arch
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Fangrui Song 41cc72a0d5 BACKPORT: bpf: Support llvm-objcopy for vmlinux BTF
commit 90ceddcb495008ac8ba7a3dce297841efcd7d584 upstream.

Simplify gen_btf logic to make it work with llvm-objcopy. The existing
'file format' and 'architecture' parsing logic is brittle and does not
work with llvm-objcopy/llvm-objdump.

'file format' output of llvm-objdump>=11 will match GNU objdump, but
'architecture' (bfdarch) may not.

.BTF in .tmp_vmlinux.btf is non-SHF_ALLOC. Add the SHF_ALLOC flag
because it is part of vmlinux image used for introspection. C code
can reference the section via linker script defined __start_BTF and
__stop_BTF. This fixes a small problem that previous .BTF had the
SHF_WRITE flag (objcopy -I binary -O elf* synthesized .data).

Additionally, `objcopy -I binary` synthesized symbols
_binary__btf_vmlinux_bin_start and _binary__btf_vmlinux_bin_stop (not
used elsewhere) are replaced with more commonplace __start_BTF and
__stop_BTF.

Add 2>/dev/null because GNU objcopy (but not llvm-objcopy) warns
"empty loadable segment detected at vaddr=0xffffffff81000000, is this intentional?"

We use a dd command to change the e_type field in the ELF header from
ET_EXEC to ET_REL so that lld will accept .btf.vmlinux.bin.o.  Accepting
ET_EXEC as an input file is an extremely rare GNU ld feature that lld
does not intend to support, because this is error-prone.

The output section description .BTF in include/asm-generic/vmlinux.lds.h
avoids potential subtle orphan section placement issues and suppresses
--orphan-handling=warn warnings.

Fixes: df786c9b9476 ("bpf: Force .BTF section start to zero when dumping from vmlinux")
Fixes: cb0cc635c7a9 ("powerpc: Include .BTF section")
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Change-Id: I145b50cfe3e0e1e034fb750cf55642905382a06c
Signed-off-by: Fangrui Song <maskray@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Stanislav Fomichev <sdf@google.com>
Tested-by: Andrii Nakryiko <andriin@fb.com>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Link: https://github.com/ClangBuiltLinux/linux/issues/871
Link: https://lore.kernel.org/bpf/20200318222746.173648-1-maskray@google.com
Signed-off-by: Maria Teguiani <teguiani@google.com>
Tested-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sorayukii <sorayukii69@gmail.com>
2026-05-15 17:58:11 +07:00
..
alpha BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
arc BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
arm BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
arm64 BACKPORT: bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2026-05-15 17:57:05 +07:00
avr32 BACKPORT: net: Introduce SO_INCOMING_NAPI_ID 2026-05-15 17:55:02 +07:00
blackfin uapi: export all headers under uapi directories 2020-04-09 15:39:35 +05:30
c6x uapi: export all headers under uapi directories 2020-04-09 15:39:35 +05:30
cris treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
frv BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
h8300 BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
hexagon BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
ia64 BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
m32r BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
m68k BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
metag BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
microblaze uapi: export all headers under uapi directories 2020-04-09 15:39:35 +05:30
mips BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
mn10300 BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
nios2 Merge remote-tracking branch 'common/android-4.9-q' into android13-4.9-sdm845 2022-12-20 19:52:09 +02:00
openrisc Merge remote-tracking branch 'common/android-4.9-q' into android12-4.9-sdm845 2022-07-18 14:05:31 +03:00
parisc BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
powerpc BACKPORT: bpf: Support llvm-objcopy for vmlinux BTF 2026-05-15 17:58:11 +07:00
s390 BACKPORT: bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2026-05-15 17:57:05 +07:00
score uapi: export all headers under uapi directories 2020-04-09 15:39:35 +05:30
sh BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
sparc BACKPORT: bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2026-05-15 17:57:05 +07:00
tile BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
um treewide: Backport new vmalloc for large performance benefits 2026-05-15 17:48:25 +07:00
unicore32 uapi: export all headers under uapi directories 2020-04-09 15:39:35 +05:30
x86 UPSTREAM: mm: add pt_mm to struct page 2026-05-15 17:57:59 +07:00
xtensa BACKPORT: atomics/treewide: Rename __atomic_add_unless() => atomic_fetch_add_unless() 2026-05-15 17:56:39 +07:00
.gitignore
Kconfig BACKPORT: error-injection: Separate error-injection from kprobe 2026-05-15 17:56:33 +07:00