Jakub Konka
aef2c91d9f
macho: move incr Zig sections in file if overlap nonincr sections
2024-01-24 12:34:42 +01:00
Jakub Konka
a531ecf9dc
macho: refactor segment creation logic
2024-01-24 12:34:42 +01:00
Jakub Konka
eaf4bb4423
macho: fix not resetting __got_zig sect index after sorting headers
2024-01-24 12:34:42 +01:00
Jakub Konka
8f74d2519f
macho: resolve relocs pointing at __got_zig
2024-01-24 12:34:41 +01:00
Jakub Konka
a112241f64
macho: re-read atom code from ZigObject when resolving relocs
2024-01-24 12:34:41 +01:00
Jakub Konka
7647db3273
macho: reserve space for __got_zig rebase opcodes
2024-01-24 12:34:41 +01:00
Jakub Konka
16b66588f0
macho: allocate __LINKEDIT in a separate pass
2024-01-24 12:34:41 +01:00
Jakub Konka
f4da814535
macho: init linkedit segment separately
2024-01-24 12:34:41 +01:00
Jakub Konka
1bdcb23b13
macho: allocate sections and segments that need it
2024-01-24 12:34:41 +01:00
Jakub Konka
0143dd8fdc
macho: fix '_' prefixing rules for exports
2024-01-24 12:34:41 +01:00
Jakub Konka
5c951cd211
macho: again fix symbol index dereference in codegen wrt ZigObject
2024-01-24 12:34:41 +01:00
Jakub Konka
a8629fb850
macho: fix symbol index dereference in codegen wrt ZigObject
...
This is incredibly confusing and I really need to simplify it.
Elf also possesses this shortcoming so once I get Coff up to speed
it should hopefully become clear on how to refactor this.
2024-01-24 12:34:41 +01:00
Jakub Konka
30b7d3e45f
macho: implement resolveSymbols in ZigObject
2024-01-24 12:34:41 +01:00
Jakub Konka
5ef63e333a
macho: set atom_index for newly created Atom in ZigObject
2024-01-24 12:34:41 +01:00
Jakub Konka
5d0ea3fd27
macho: let us dump some state and debug!
2024-01-24 12:34:41 +01:00
Jakub Konka
9a78173ee0
macho: implement ZigObject.flushModule
2024-01-24 12:34:41 +01:00
Jakub Konka
a79a038e61
codegen: implement more missing bits
2024-01-24 12:34:41 +01:00
Jakub Konka
96cc9fafbf
codegen: re-implement enough of codegen to error out instead panic
2024-01-24 12:34:41 +01:00
Jakub Konka
76dc305d4e
codegen: re-enable MachO support in genDeclRef
2024-01-24 12:34:41 +01:00
Jakub Konka
82e92fe5f6
macho: fill the rest of ZigObject
2024-01-24 12:34:41 +01:00
Jakub Konka
ee463efdf2
macho: fill in more blanks in ZigObject
2024-01-24 12:34:41 +01:00
Jakub Konka
c98d229844
macho: fill in more blanks in ZigObject
2024-01-24 12:34:41 +01:00
Jakub Konka
6cd4c7612f
macho: implement growSection mechanism
2024-01-24 12:34:41 +01:00
Jakub Konka
2169a5559d
macho: implement more self-hosted primitives
2024-01-24 12:34:41 +01:00
Jakub Konka
55c8b82b50
macho: set alignment of pre-allocated sections
2024-01-24 12:34:41 +01:00
Jakub Konka
a6ed54ea22
macho: init metadata for incremental linking
2024-01-24 12:34:41 +01:00
Jakub Konka
8c578ba02c
macho: add __zig_got section implementation
2024-01-24 12:34:41 +01:00
Jakub Konka
c7de5e5111
macho: re-implement updateDeclCode
2024-01-24 12:34:41 +01:00
Jakub Konka
0b2133d441
macho: init metadata and partially implement updateDecl
2024-01-24 12:34:41 +01:00
Jakub Konka
bd9d8bd462
macho: create Atom for Decl in ZigObject
2024-01-24 12:34:41 +01:00
Jakub Konka
9509fadbe3
macho: split symbol.flags.got into needs_got and has_got
2024-01-24 12:34:41 +01:00
Jakub Konka
b66911370b
macho: forward parsed -compatibility_version to the linker
2024-01-24 12:34:41 +01:00
Jakub Konka
8437ba6a79
macho: patch up more holes with ZigObject
2024-01-24 12:34:41 +01:00
Jakub Konka
667af6511f
macho: move all unimplemented function stubs into ZigObject
2024-01-24 12:34:40 +01:00
Jakub Konka
6d0ba6dd10
macho: introduce ZigObject
2024-01-24 12:34:40 +01:00
Jakub Konka
abeb0e3ea4
test/link/macho: test force-loading objects containing ObjC from archives
2024-01-24 12:34:40 +01:00
Jakub Konka
8105390fff
macho: remove all rpath parsing from the linker
2024-01-24 12:34:40 +01:00
Jakub Konka
b1cf6d3103
macho: print all definitions of symbols when printing duplicates
2024-01-24 12:34:40 +01:00
Jakub Konka
b038bcb93b
test/link/macho: test -r mode
2024-01-24 12:34:40 +01:00
Jakub Konka
56303d770e
macho: fix invalid generation of FDE records
2024-01-24 12:34:39 +01:00
Jakub Konka
0a60e4448d
macho: preserve section name for code sections
2024-01-24 12:34:39 +01:00
Jakub Konka
ee7a027059
macho: parse dependent dylibs
2024-01-24 12:34:39 +01:00
Jakub Konka
ef9aea75d0
macho: fix dead stripping logic to exclude debug sections
2024-01-24 12:34:39 +01:00
Jakub Konka
10a5536a7c
macho: re-instate build-obj codepath
2024-01-24 12:34:39 +01:00
Jakub Konka
c2a0a88284
macho: report duplicate symbols
2024-01-24 12:34:39 +01:00
Jakub Konka
3968aea8ec
macho: write to file
2024-01-24 12:34:39 +01:00
Jakub Konka
98d6d40cd6
macho: allocate sections, segments and atoms
2024-01-24 12:34:39 +01:00
Jakub Konka
32ebceea95
macho: sort sections; use Atom.Alignment for alignment; init segments
2024-01-24 12:34:39 +01:00
Jakub Konka
0b2231998f
macho: init output and synthetic sections
2024-01-24 12:34:39 +01:00
Jakub Konka
f0119ce373
macho: report undefined symbols to the user
2024-01-24 12:34:39 +01:00