| ... | @@ -188,11 +188,41 @@ pub fn createEmpty( | ... | @@ -188,11 +188,41 @@ pub fn createEmpty( |
| 188 | else => return error.UnsupportedELFArchitecture, | 188 | else => return error.UnsupportedELFArchitecture, |
| 189 | }; | 189 | }; |
| 190 | | 190 | |
| | 191 | // This is the max page size that the target system can run with, aka the ABI page size. Not to |
| | 192 | // be confused with the common page size, which is the page size that's used in practice on most |
| | 193 | // systems. |
| 191 | const page_size: u32 = switch (target.cpu.arch) { | 194 | const page_size: u32 = switch (target.cpu.arch) { |
| 192 | .aarch64, .hexagon, .powerpc64le => 0x10000, | 195 | .bpfel, |
| 193 | .sparc64 => 0x2000, | 196 | .bpfeb, |
| | 197 | .sparc64, |
| | 198 | => 0x100000, |
| | 199 | .aarch64, |
| | 200 | .aarch64_be, |
| | 201 | .amdgcn, |
| | 202 | .hexagon, |
| | 203 | .mips, |
| | 204 | .mipsel, |
| | 205 | .mips64, |
| | 206 | .mips64el, |
| | 207 | .powerpc, |
| | 208 | .powerpcle, |
| | 209 | .powerpc64, |
| | 210 | .powerpc64le, |
| | 211 | .sparc, |
| | 212 | => 0x10000, |
| | 213 | .loongarch32, |
| | 214 | .loongarch64, |
| | 215 | => 0x4000, |
| | 216 | .arc, |
| | 217 | .m68k, |
| | 218 | => 0x2000, |
| | 219 | .msp430, |
| | 220 | => 0x4, |
| | 221 | .avr, |
| | 222 | => 0x1, |
| 194 | else => 0x1000, | 223 | else => 0x1000, |
| 195 | }; | 224 | }; |
| | 225 | |
| 196 | const is_dyn_lib = output_mode == .Lib and link_mode == .dynamic; | 226 | const is_dyn_lib = output_mode == .Lib and link_mode == .dynamic; |
| 197 | const default_sym_version: elf.Elf64_Versym = if (is_dyn_lib or comp.config.rdynamic) | 227 | const default_sym_version: elf.Elf64_Versym = if (is_dyn_lib or comp.config.rdynamic) |
| 198 | elf.VER_NDX_GLOBAL | 228 | elf.VER_NDX_GLOBAL |