| 12 Nov 2025 |
Tristan Ross | ELF Header:
Magic: 7f 45 4c 46 02 01 01 03 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - GNU
ABI Version: 0
Type: EXEC (Executable file)
Machine: RISC-V
Version: 0x1
Entry point address: 0x2ca98
Start of program headers: 64 (bytes into file)
Start of section headers: 2203656 (bytes into file)
Flags: 0x5, RVC, double-float ABI
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 12
Size of section headers: 64 (bytes)
Number of section headers: 31
Section header string table index: 30
| 06:29:25 |
dramforever | okay we're cooked | 06:29:31 |
Tristan Ross | lol | 06:29:39 |
Tristan Ross | Is it because of the entry point addr? | 06:29:58 |
dramforever | no it's just it's not a PIE | 06:30:14 |
dramforever | and the address is 0xf000 | 06:30:19 |
Tristan Ross | Oh | 06:30:21 |
dramforever | and the kernel goes wait a sec | 06:30:24 |
Tristan Ross | That's a problem | 06:30:29 |
dramforever | how did this happen | 06:30:42 |
Tristan Ross | Idk | 06:30:50 |
Tristan Ross | It's from nixpkgs, I didn't touch PIE stuff lol | 06:31:02 |
dramforever | anyway there are random crap we don't build as pie due to it breaking things | 06:33:22 |
dramforever | random crap like... gcc | 06:33:26 |
dramforever | i cba to check rn but you can dig around to see if all the non-PIEs have 0xf000 | 06:34:20 |
Tristan Ross | So the fix would be to disable PIE on RISC-V? Or actually fix whatever the hell is going on? | 06:34:22 |
Tristan Ross | I already did, they do... | 06:34:39 |
dramforever | yeah so only PIEs will work lmao | 06:34:56 |
dramforever | or you set vm.mmap_min_addr and ignore this problem | 06:35:05 |
Tristan Ross | Great... | 06:35:18 |
dramforever | it's set in the kernel in CONFIG_DEFAULT_MMAP_MIN_ADDR | 06:35:57 |
dramforever | so presumably ubuntu is doing something to their binutils to match | 06:36:06 |
Tristan Ross | Oh neat | 06:36:17 |
dramforever | or maybe they just all have full on PIEs | 06:36:28 |
Tristan Ross | I checked gcc -V and they do have default PIE set | 06:36:43 |
dramforever | you can try to check a -no-pie thing on ubuntu and see if the base address is different | 06:36:48 |
dramforever | how has nobody ever noticed this problem | 06:37:22 |
Tristan Ross | I don't really feel like checking lol. I'm glad to have a solution right now lol. My head hurts after working on this for 3 days. | 06:37:28 |
dramforever | are you the first person to every try to use nixpkgs on ubuntu on riscv64 | 06:37:39 |
Tristan Ross | Because not many people use RISC-V I assume lol | 06:37:46 |