| 23 Nov 2025 |
dramforever | do you mean a go program? | 20:22:38 |
Tristan Ross | GCC & patchelf in the bootstrap-tools | 20:25:30 |
Tristan Ross | But the go error is preventing me from building for the system lol | 20:25:49 |
dramforever | wasn't that a non-pie problem? | 20:26:38 |
Tristan Ross | GCC has a PIE address but the flag in the ELF header isn't set | 20:26:58 |
Tristan Ross | So vm.mmap_min_addr is higher than the PHDR address | 20:27:09 |
Tristan Ross | Which causes the kernel to fail the mmap of the PHDR | 20:27:21 |
Tristan Ross | Patchelf was fixed at some point and that one fixes itself after updating the bootstrap-tools but GCC is still broken | 20:28:06 |
dramforever | no no no a normal PIE would start at address 0 | 20:29:05 |
dramforever | that one has file type ET_EXEC | 20:29:16 |
dramforever | pies have ET_DYN but also DF_1_PIE | 20:29:34 |
Tristan Ross | The PHDR starts at 0xf000 but the vm.mmap_min_addr is 65535 | 20:29:38 |
dramforever | why do you think it's a pie | 20:29:58 |
Tristan Ross | Because I thought that's what you mentioned it was when we were looking at this problem a couple weeks ago | 20:30:32 |
dramforever | i said it's not a pie | 20:30:45 |
Tristan Ross | Huh | 20:30:59 |
Tristan Ross | So why else would mmap fail with 0xf000 when vm.mmap_min_addr is 65535? | 20:31:29 |
Tristan Ross | mmap return EPERM | 20:31:49 |
dramforever | because it's not a pie | 20:31:50 |
dramforever | that's why it fails | 20:31:54 |
Tristan Ross | What? | 20:32:00 |
dramforever | it fails because it's not position independent | 20:32:06 |
Tristan Ross | I thought you just said it's not a PIE problem | 20:32:06 |
dramforever | it's a problem because it's a PDE | 20:32:24 |
Tristan Ross | Yes, so it's the problem I was explaining. The executable should be a PIE but the kernel thinks its not. | 20:32:49 |
dramforever | the executable has no signs of being a PIE | 20:33:04 |
dramforever | it has type ET_EXEC, first segment doesn't start at address 0 | 20:33:41 |
Tristan Ross | Yeah | 20:33:56 |
Tristan Ross | And the good binaries have a different address for the PHDR | 20:34:08 |
dramforever | so why "should" it be a PIE? | 20:34:10 |