llvm/llvm-project#113838 "[RISCV] ld.lld: error: relaxation not converged with openssl"
ld.lld @response.txt --noinhibit-exec -o out.30
S=1 ld.lld @response.txt --noinhibit-exec -o out.31| Jul 12 15:34:14 hacking kernel: Linux version 6.15.6-arch1-1 (linux@archlinux) (gcc (GCC) 15.1.1 20250425, GNU ld (GNU Binutils) 2.44.0) #1 SMP PREEMPT_DYNAMIC Thu, 10 Jul 2025 17:10:18 +0000 | |
| Jul 12 15:34:14 hacking kernel: Command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root=UUID=2403f944-7fdf-4185-8119-4f6fd8f7f887 rw intel_idle.max_cstate=2 | |
| Jul 12 15:34:14 hacking kernel: x86/split lock detection: #AC: crashing the kernel on kernel split_locks and warning on user-space split_locks | |
| Jul 12 15:34:14 hacking kernel: BIOS-provided physical RAM map: | |
| Jul 12 15:34:14 hacking kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable | |
| Jul 12 15:34:14 hacking kernel: BIOS-e820: [mem 0x000000000009f000-0x00000000000fffff] reserved | |
| Jul 12 15:34:14 hacking kernel: BIOS-e820: [mem 0x0000000000100000-0x000000005df8afff] usable | |
| Jul 12 15:34:14 hacking kernel: BIOS-e820: [mem 0x000000005df8b000-0x000000005e88afff] reserved | |
| Jul 12 15:34:14 hacking kernel: BIOS-e820: [mem 0x000000005e88b000-0x0000 |
| Jul 11 21:37:24 hacking kernel: Linux version 6.15.6-arch1-1 (linux@archlinux) (gcc (GCC) 15.1.1 20250425, GNU ld (GNU Binutils) 2.44.0) #1 SMP PREEMPT_DYNAMIC Thu, 10 Jul 2025 17:10:18 +0000 | |
| Jul 11 21:37:24 hacking kernel: Command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root=UUID=2403f944-7fdf-4185-8119-4f6fd8f7f887 rw intel_idle.max_cstate=2 | |
| Jul 11 21:37:24 hacking kernel: x86/split lock detection: #AC: crashing the kernel on kernel split_locks and warning on user-space split_locks | |
| Jul 11 21:37:24 hacking kernel: BIOS-provided physical RAM map: | |
| Jul 11 21:37:24 hacking kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable | |
| Jul 11 21:37:24 hacking kernel: BIOS-e820: [mem 0x000000000009f000-0x00000000000fffff] reserved | |
| Jul 11 21:37:24 hacking kernel: BIOS-e820: [mem 0x0000000000100000-0x000000005df8afff] usable | |
| Jul 11 21:37:24 hacking kernel: BIOS-e820: [mem 0x000000005df8b000-0x000000005e88afff] reserved | |
| Jul 11 21:37:24 hacking kernel: BIOS-e820: [mem 0x000000005e88b000-0x0000 |
llvm/llvm-project#113838 "[RISCV] ld.lld: error: relaxation not converged with openssl"
ld.lld @response.txt --noinhibit-exec -o out.30
S=1 ld.lld @response.txt --noinhibit-exec -o out.31| #!/usr/bin/env python | |
| import os, re, sys | |
| from ipdb import set_trace as bp | |
| X = 'log' | |
| Y = 'Log' | |
| def update(lines): | |
| ret = [] | |
| s = 0 |
| linux/arch/arm/mach-rockchip/sleep.S:20:23: error: too many positional arguments | |
| setmode 0x00000080 | 0x00000040 | 0x00000013, r1 @ set svc, irqs off | |
| ^ | |
| make[5]: *** [linux/scripts/Makefile.build:362: arch/arm/mach-rockchip/sleep.o] Error 1 | |
| make[5]: Target 'arch/arm/mach-rockchip/' not remade because of errors. | |
| make[4]: *** [linux/scripts/Makefile.build:485: arch/arm/mach-rockchip] Error 2 | |
| linux/arch/arm/mach-tegra/sleep.S:127:23: error: too many positional arguments | |
| mov32 r2, 0x50040000 + 0x3000 | |
| ^ | |
| linux/arch/arm/mach-tegra/reset-handler.S:95:23: error: too many positional arguments |
void f0(void);
void f1(void);
void f2(void);
void g() { f0(); f1(); f2(); }
g:
push {r4, lr}
mov r4, r9
bl f(PLT)
mov r9, r4
| #!/usr/bin/env python | |
| import os, re, subprocess, sys | |
| from ipdb import set_trace as bp | |
| def main(filename): | |
| last = 0 | |
| while 1: | |
| p = subprocess.run(['/tmp/Rel/bin/llvm-lit', '-v', filename], capture_output=True) | |
| if p.returncode != 1: break | |
| lines = p.stdout.decode().split('\n') |
| ## Linux binfmt loaders | |
| `fs/Kconfig.binfmt` defines a few loaders. | |
| * `BINFMT_ELF` defaults to y and depends on `MMU`. | |
| * `BINFMT_ELF_FDPIC` defaults to y when `BINFMT_ELF` is not selected. A few architecture support `BINFMT_ELF_FDPIC` for NOMMU. ARM supports FDPIC even with a MMU. | |
| * `BINFMT_FLAT` is provided for a few architectures. | |
| `BINFMT_AOUT`, removed in 2022, had been supported for alpha/arm/x86-32. |
| % echo 'int main(){}' > a.cc | |
| % clang -fuse-ld=lld a.cc -z separate-code | |
| % readelf -WSl a.out | |
| There are 30 section headers, starting at offset 0x2868: | |
| Section Headers: | |
| [Nr] Name Type Address Off Size ES Flg Lk Inf Al | |
| [ 0] NULL 0000000000000000 000000 000000 00 0 0 0 | |
| [ 1] .interp PROGBITS 00000000000002a8 0002a8 00001c 00 A 0 0 1 | |
| [ 2] .note.ABI-tag NOTE 00000000000002c4 0002c4 000020 00 A 0 0 4 |
Published to https://maskray.me/blog/2024-01-23-riscv-tlsdesc-works
Patch musl
--- c/arch/riscv64/reloc.h
+++ i/arch/riscv64/reloc.h
@@ -17,6 +17,7 @@
#define REL_DTPMOD R_RISCV_TLS_DTPMOD64
#define REL_DTPOFF R_RISCV_TLS_DTPREL64
#define REL_TPOFF R_RISCV_TLS_TPREL64