mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-28 05:24:47 +08:00
11cd8a6483
If explicit relocation hints are used by the toolchain, -Wa,-mla-* options will be useless for the C code. So only use them for the !CONFIG_AS_HAS_EXPLICIT_RELOCS case. Replace "la" with "la.pcrel" in head.S to keep the semantic consistent with new and old toolchains for the low level startup code. For per-CPU variables, the "address" of the symbol is actually an offset from $r21. The value is near the loading address of main kernel image, but far from the loading address of modules. So we use model("extreme") attibute to tell the compiler that a PC-relative addressing with 32-bit offset is not sufficient for local per-CPU variables. The behavior with different assemblers and compilers are summarized in the following table: AS has CC has explicit relocs explicit relocs * Behavior ============================================================== No No Use la.* macros. No change from Linux 6.0. -------------------------------------------------------------- No Yes Disable explicit relocs. No change from Linux 6.0. -------------------------------------------------------------- Yes No Not supported. -------------------------------------------------------------- Yes Yes Enable explicit relocs. No -Wa,-mla* options used. ============================================================== *: We assume CC must have model attribute if it has explicit relocs. Both features are added in GCC 13 development cycle, so any GCC release >= 13 should be OK. Using early GCC 13 development snapshots may produce modules with unsupported relocations. Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=f09482a Link: https://gcc.gnu.org/r13-1834 Link: https://gcc.gnu.org/r13-2199 Tested-by: WANG Xuerui <git@xen0n.name> Signed-off-by: Xi Ruoyao <xry111@xry111.site> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> |
||
---|---|---|
.. | ||
.gitignore | ||
access-helper.h | ||
acpi.c | ||
asm-offsets.c | ||
cacheinfo.c | ||
cpu-probe.c | ||
dma.c | ||
efi-header.S | ||
efi.c | ||
elf.c | ||
entry.S | ||
env.c | ||
fpu.S | ||
genex.S | ||
head.S | ||
idle.c | ||
image-vars.h | ||
inst.c | ||
io.c | ||
irq.c | ||
Makefile | ||
mem.c | ||
module-sections.c | ||
module.c | ||
numa.c | ||
proc.c | ||
process.c | ||
ptrace.c | ||
reset.c | ||
setup.c | ||
signal.c | ||
smp.c | ||
stacktrace.c | ||
switch.S | ||
syscall.c | ||
time.c | ||
topology.c | ||
traps.c | ||
unwind_guess.c | ||
unwind_prologue.c | ||
vdso.c | ||
vmlinux.lds.S |