Jakub Konka
e69ffcd8c1
macho: set filename as ident in code signature
2024-01-24 12:34:42 +01:00
Jakub Konka
46bc91ade5
macho: skip -r when single input object file
...
This is to ensure we don't unnecessarily strip debug info from
the final relocatable input file, so just copy the file out for now.
2024-01-24 12:34:42 +01:00
Jakub Konka
f2dce0c337
macho: exclude symbols from empty sections when parsing unwind info
2024-01-24 12:34:42 +01:00
Jakub Konka
82628dd151
macho: synthesise unwind records from __eh_frame even if no __compact_unwind
2024-01-24 12:34:42 +01:00
Jakub Konka
fe19d1e09b
macho: allocate segments in sep step and tweak sorting logic
2024-01-24 12:34:42 +01:00
Jakub Konka
c57e77a455
build: bump max_rss for building the compiler again
2024-01-24 12:34:42 +01:00
Jakub Konka
d726538494
test/link/macho: ensure we do not run testStackSize on foreign host
2024-01-24 12:34:42 +01:00
Jakub Konka
06224c23b7
macho: fix 32bit compilation issues
2024-01-24 12:34:42 +01:00
Jakub Konka
67ea039426
macho: do not enforce platform check for now
2024-01-24 12:34:42 +01:00
Jakub Konka
ead0237814
build: bump maxrss
2024-01-24 12:34:42 +01:00
Jakub Konka
060406a526
macho: ensure we zero-out regions after copying them over
...
This is to ensure that the loader correctly zeroes-out zerofill
sections when mapping them. For context, Apple's loader dyld
will map the regions where any zerofill would theoretically reside
as belonging to zerofill section.
2024-01-24 12:34:42 +01:00
Jakub Konka
3a6410959c
macho: actually lower TLS variables
2024-01-24 12:34:42 +01:00
Jakub Konka
411c7f6669
macho: fix wrong symbol type for TLV vars
2024-01-24 12:34:42 +01:00
Jakub Konka
5c4db4e578
x86_64: emit MachO TLV sequence
2024-01-24 12:34:42 +01:00
Jakub Konka
080ad94249
x86_64: save TLS to stack for MachO
2024-01-24 12:34:42 +01:00
Jakub Konka
6ad4062bf2
macho: save TLS variables in ZigObject
2024-01-24 12:34:42 +01:00
Jakub Konka
c02a603b63
macho: get start index of Zig sections when allocating other sections
2024-01-24 12:34:42 +01:00
Jakub Konka
55f57ceb2e
macho: prep for lowering TLS variables
2024-01-24 12:34:42 +01:00
Jakub Konka
5c30c23fc4
macho: get rid of allocateSegments
2024-01-24 12:34:42 +01:00
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