1856 Commits

Author SHA1 Message Date
Jakub Konka
02451bdebf elf: atom.index of 0 reserved for null atom 2023-09-04 22:41:50 +02:00
Jakub Konka
7d396110d6 elf: remove dead code 2023-09-04 11:31:48 +02:00
Jakub Konka
bc37c95e56 elf: simplify accessors to symbols, atoms, etc 2023-09-04 11:23:19 +02:00
Jakub Konka
009a349779 elf: add global symbol resolver 2023-09-03 08:32:28 +02:00
Jakub Konka
baea106b71 elf: mark dirty .symtab shdr after updating sh_info field 2023-09-02 23:00:39 +02:00
Jakub Konka
cfc0429bc9 elf: correctly set symtab's sh_info to first global index 2023-09-02 22:12:49 +02:00
Jakub Konka
9bd60bef2a elf: write all symbols in bulk in flush
This avoids leaving undefined bytes in the output file in case
a decl has been garbage collected before it's been committed into
the binary.

This should have minimal impact on performance since we have to
write globals on every iteration anyway.
2023-09-02 21:49:33 +02:00
Jakub Konka
da56727e6a elf: write symbol names into .strtab rather than .shstrtab 2023-09-02 15:17:44 +02:00
Jakub Konka
cf3a6fe0f5 dwarf: fix copy-paste typo in variable lowering code for reg and stack 2023-09-02 09:40:12 +02:00
Jakub Konka
2187744411 macho: we actually care about stem and not basename for dependencies 2023-09-01 00:43:02 +02:00
Jakub Konka
611ddd426c macho: forgot to include dirname when resolving dependencies 2023-09-01 00:30:26 +02:00
Jakub Konka
21c04b119e macho: report missing libSystem/libc system libraries to the user 2023-08-31 23:47:55 +02:00
Jakub Konka
43adfd9689 macho: check if fallback libSystem.{d}.tbd exists in Zig's installation 2023-08-31 22:04:24 +02:00
Jakub Konka
19a1332ca1 macho: improve formatting of invalid targets in libraries 2023-08-30 22:30:42 +02:00
Jakub Konka
a7240f0c99 macho: remove error.UnhandledDwFormValue from link.File
Eventually, we will validate DWARF info upfront and report errors
to the user but this will require a rewrite of several parts of
the linker so leaving as a TODO for the near future.
2023-08-30 22:29:27 +02:00
Jakub Konka
ebe371b757 macho: report basic __eh_frame problems as errors 2023-08-30 21:48:24 +02:00
Jakub Konka
ba710ec09d macho: remove obsolete error.FailedToResolveRelocationTarget 2023-08-30 20:34:16 +02:00
Jakub Konka
5144132320 macho: report formatted error for unhandled symbol types 2023-08-30 20:16:37 +02:00
Jakub Konka
5806e761bb macho: improve error reporting for re-exports mismatch 2023-08-30 19:02:25 +02:00
Jakub Konka
22c81740ef macho: convert error.TODOImplementWritingStaticLibFiles into an actual error 2023-08-30 12:37:05 +02:00
Jakub Konka
f21245f5e7 macho: refactor resolving and parsing dependent dylibs 2023-08-30 12:30:17 +02:00
Jakub Konka
ea9f2513a3 macho: format parse error for fat libs to include CPU archs only 2023-08-29 22:26:58 +02:00
Jakub Konka
7e167537c0 macho: simplify handling and reporting parsing errors 2023-08-29 22:16:48 +02:00
Jakub Konka
79b3285aa2 macho: handle mismatched and missing platform errors 2023-08-29 15:27:44 +02:00
Jakub Konka
1cae41bbbb macho: clean up array of supported platforms and versions 2023-08-29 12:14:57 +02:00
Jakub Konka
1b01715a73 link: remove unused darwin_sdk_version field 2023-08-29 12:02:58 +02:00
Jakub Konka
3ece3f83f3 macho: clean up helpers for std.SemanticVersion <-> Apple version formatting 2023-08-29 12:00:25 +02:00
Jakub Konka
2e28ab153c macho: parse platform info from each object file into Platform struct 2023-08-29 11:45:03 +02:00
Jakub Konka
ec03619dcf macho: make MachO.requiresCodeSignature accept link.Options 2023-08-29 11:40:20 +02:00
Jakub Konka
052984c5ae macho: remove MachO.requiresThunks as it is obsolete 2023-08-29 11:40:20 +02:00
Jakub Konka
2473ccc335 macho: create an explicit error set for parse functions 2023-08-29 11:40:20 +02:00
Jakub Konka
1820aed786 macho: convert log.err when CPU arch is mismatched into actual errors 2023-08-29 11:40:20 +02:00
Jakub Konka
68dc1a3e3f macho: report symbol collision as compiler error 2023-08-29 11:40:20 +02:00
Jakub Konka
0f02a1fcb0 macho: fix 32bit compilation issues 2023-08-29 11:40:20 +02:00
Jakub Konka
8330065a99 macho: report undefined via compiler errors in incremental driver 2023-08-29 11:40:20 +02:00
Jakub Konka
8d1ca8ce7b macho: swap sectname with segname typo when allocating sections 2023-08-29 11:40:20 +02:00
Jakub Konka
700b1e38ce macho: fix overalignment of stubs on aarch64 2023-08-29 11:40:20 +02:00
Jakub Konka
0353bfd55e macho: fix a few regressions in incremental codepath 2023-08-29 11:40:20 +02:00
Jakub Konka
5eb6c81d07 macho: fix invalid alignment of stubs for x86_64 2023-08-29 11:40:20 +02:00
Jakub Konka
9d62ebc0ce macho: fix compilation issues 2023-08-29 11:40:20 +02:00
Jakub Konka
2c68fb3d7c macho: merge Zld state with MachO state 2023-08-29 11:40:18 +02:00
Jakub Konka
42e0850d78 macho: save indexes to all sections of interest 2023-08-29 11:39:35 +02:00
Jakub Konka
84853c5c56 macho: unify resolving globals 2023-08-29 11:39:35 +02:00
Jakub Konka
7f6973fbae macho: unify segment handling 2023-08-29 11:39:35 +02:00
Jakub Konka
d17867939e macho: unify writeLinkeditSegmentData func 2023-08-29 11:39:35 +02:00
Jakub Konka
7f74b3562d macho: unify creating atoms 2023-08-29 11:39:35 +02:00
Jakub Konka
ef0d35e00c macho: unify allocating special symbols 2023-08-29 11:39:35 +02:00
Jakub Konka
664b983518 macho: unify writeSegmentHeaders func 2023-08-29 11:39:35 +02:00
Jakub Konka
b2773cd712 macho: move initSection into MachO from Zld 2023-08-29 11:39:34 +02:00
Jakub Konka
180979ee41 macho: move getOutputSection into Atom 2023-08-29 11:39:34 +02:00