linux-yocto/arch/riscv/kernel
Fangrui Song 70685fb621 riscv: vdso: Exclude .rodata from the PT_DYNAMIC segment
[ Upstream commit e0eb1b6b0c ]

.rodata is implicitly included in the PT_DYNAMIC segment due to
inheriting the segment of the preceding .dynamic section (in both GNU ld
and LLD).  When the .rodata section's size is not a multiple of 16
bytes on riscv64, llvm-readelf will report a "PT_DYNAMIC dynamic table
is invalid" warning.  Note: in the presence of the .dynamic section, GNU
readelf and llvm-readelf's -d option decodes the dynamic section using
the section.

This issue arose after commit 8f8c1ff879
("riscv: vdso.lds.S: remove hardcoded 0x800 .text start addr"), which
placed .rodata directly after .dynamic by removing .eh_frame.

This patch resolves the implicit inclusion into PT_DYNAMIC by explicitly
specifying the :text output section phdr.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://github.com/ClangBuiltLinux/linux/issues/2093
Signed-off-by: Fangrui Song <i@maskray.me>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20250602-riscv-vdso-v1-1-0620cf63cff0@maskray.me
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-07-17 18:37:22 +02:00
..
compat_vdso Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
pi riscv: Do not use fortify in early code 2024-10-25 06:18:36 -07:00
probes riscv: uprobes: Add missing fence.i after building the XOL buffer 2025-05-02 07:59:04 +02:00
tests treewide: replace or remove redundant def_bool in Kconfig files 2024-02-20 20:47:45 +09:00
vdso riscv: vdso: Exclude .rodata from the PT_DYNAMIC segment 2025-07-17 18:37:22 +02:00
vendor_extensions riscv: Make riscv_isa_vendor_ext_andes array static 2024-09-17 08:05:08 -07:00
.gitignore
acpi_numa.c ACPI: NUMA: initialize all values of acpi_early_node_map to NUMA_NO_NODE 2024-09-20 01:31:26 -07:00
acpi.c RISC-V: ACPI: fix early_ioremap to early_memremap 2024-10-25 06:18:31 -07:00
alternative.c riscv: errata: Rename defines for Andes 2024-03-12 07:13:12 -07:00
asm-offsets.c riscv: Remove unused GENERATING_ASM_OFFSETS 2024-10-25 06:18:41 -07:00
cacheinfo.c riscv: cacheinfo: Use of_property_present() for non-boolean properties 2025-03-07 18:25:44 +01:00
cfi.c bpf, riscv64/cfi: Support kCFI + BPF on riscv64 2024-03-06 15:18:16 -08:00
compat_signal.c
compat_syscall_table.c riscv: convert to generic syscall table 2024-07-10 14:23:38 +02:00
copy-unaligned.h
copy-unaligned.S
cpu_ops_sbi.c riscv: cpu_ops_sbi: Use static array for boot_data 2025-07-10 16:05:13 +02:00
cpu_ops_spinwait.c riscv: prevent pt_regs corruption for secondary idle threads 2024-05-30 09:42:51 -07:00
cpu_ops.c
cpu-hotplug.c riscv: Use '%u' to format the output of 'cpu' 2024-10-25 06:18:40 -07:00
cpu.c riscv: Add vendor extensions to /proc/cpuinfo 2024-07-22 15:36:55 -07:00
cpufeature.c riscv: cpufeature: use bitmap_equal() instead of memcmp() 2025-03-07 18:25:45 +01:00
crash_dump.c
crash_save_regs.S
efi-header.S riscv: efi: Set NX compat flag in PE/COFF header 2024-10-25 06:18:38 -07:00
efi.c
elf_kexec.c riscv/kexec_file: Handle R_RISCV_64 in purgatory relocator 2025-04-10 14:39:33 +02:00
entry.S riscv: use local label names instead of global ones in assembly 2025-01-17 13:40:44 +01:00
fpu.S riscv: typo in comment for get_f64_reg 2024-05-22 16:12:53 -07:00
ftrace.c riscv: patch: Flush the icache right after patching to avoid illegal insns 2024-06-26 07:37:27 -07:00
head.h
head.S riscv: set trap vector earlier 2024-07-12 08:55:31 -07:00
hibernate-asm.S
hibernate.c
image-vars.h
irq.c
jump_label.c riscv: jump_label: Batch icache maintenance 2024-06-26 07:36:27 -07:00
kernel_mode_fpu.c riscv: add support for kernel-mode FPU 2024-05-19 14:36:19 -07:00
kernel_mode_vector.c riscv: vector: allow kernel-mode Vector with preemption 2024-01-16 07:14:02 -08:00
kexec_relocate.S
kgdb.c riscv: KGDB: Remove ".option norvc/.option rvc" for kgdb_compiled_break 2025-04-25 10:47:48 +02:00
machine_kexec_file.c
machine_kexec.c riscv: kexec: Avoid deadlock in kexec crash path 2024-07-03 13:11:30 -07:00
Makefile Fix mis-uses of 'cc-option' for warning disablement 2025-05-29 11:03:25 +02:00
Makefile.syscalls syscalls: fix syscall macros for newfstat/newfstatat 2024-08-02 15:20:47 +02:00
mcount-dyn.S ftrace: riscv: move from REGS to ARGS 2024-05-22 16:12:48 -07:00
mcount.S riscv: remove MCOUNT_NAME workaround 2024-02-22 15:38:54 -08:00
module-sections.c riscv: module: Allocate PLT entries for R_RISCV_PLT32 2025-04-25 10:47:48 +02:00
module.c riscv: module: Fix out-of-bounds relocation access 2025-04-25 10:47:47 +02:00
paravirt.c RISC-V: KVM: Rename the SBI_STA_SHMEM_DISABLE to a generic name 2024-04-22 11:13:52 +05:30
patch.c riscv: Re-introduce global icache flush in patch_text_XXX() 2024-08-06 06:49:14 -07:00
perf_callchain.c riscv: stacktrace: Add USER_STACKTRACE support 2024-09-14 23:57:16 -07:00
perf_regs.c
process.c riscv: Randomize lower bits of stack address 2024-09-17 08:05:10 -07:00
ptrace.c Merge patch series "riscv: Introduce compat-mode helpers & improve arch_get_mmap_end()" 2024-03-20 08:56:05 -07:00
reset.c
return_address.c riscv: add CALLER_ADDRx support 2024-02-22 12:17:47 -08:00
riscv_ksyms.c riscv: Omit optimized string routines when using KASAN 2024-09-19 01:10:00 -07:00
sbi_ecall.c riscv: Fix RISCV_ALTERNATIVE_EARLY 2024-09-03 07:57:55 -07:00
sbi-ipi.c RISC-V: Enable the IPI before workqueue_online_cpu() 2024-08-01 07:15:43 -07:00
sbi.c riscv: Fix RISCV_ALTERNATIVE_EARLY 2024-09-03 07:57:55 -07:00
setup.c riscv: Properly export reserved regions in /proc/iomem 2025-04-25 10:47:47 +02:00
signal.c riscv: signal: fix signal frame size 2025-03-07 18:25:44 +01:00
smp.c RISC-V: Implement kgdb_roundup_cpus() to enable future NMI Roundup 2024-09-17 05:52:44 -07:00
smpboot.c Merge patch series "Add ACPI NUMA support for RISC-V" 2024-07-22 10:31:51 -07:00
soc.c
stacktrace.c riscv: stacktrace: fix backtracing through exceptions 2025-01-17 13:40:44 +01:00
suspend_entry.S
suspend.c riscv: Do not save the scratch CSR during suspend 2024-04-28 14:50:36 -07:00
sys_hwprobe.c RISC-V: hwprobe: Add SCALAR to misaligned perf defines 2024-08-14 13:13:24 -07:00
sys_riscv.c syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
syscall_table.c riscv: convert to generic syscall table 2024-07-10 14:23:38 +02:00
time.c
traps_misaligned.c Revert "riscv: misaligned: fix sleeping function called during misaligned access handling" 2025-07-06 11:01:39 +02:00
traps.c riscv: misaligned: enable IRQs while handling misaligned accesses 2025-05-18 08:24:57 +02:00
unaligned_access_speed.c RISC-V: Scalar unaligned access emulated on hotplug CPUs 2024-12-05 14:02:52 +01:00
vdso.c riscv: vdso: Use generic union vdso_data_store 2024-02-20 20:56:00 +01:00
vector.c RISC-V: Mark riscv_v_init() as __init 2025-02-08 09:58:09 +01:00
vendor_extensions.c riscv: Fix out-of-bounds when accessing Andes per hart vendor extension array 2024-08-15 13:12:16 -07:00
vmcore_info.c riscv: don't export va_kernel_pa_offset in vmcoreinfo for XIP kernel 2024-09-12 07:22:56 -07:00
vmlinux-xip.lds.S riscv: remove limit on the size of read-only section for XIP kernel 2024-09-12 07:23:02 -07:00
vmlinux.lds.S