Jakub Konka
bf285c7e40
test/link/macho: test for correct handling of large __bss sections
2024-01-24 12:34:39 +01:00
Jakub Konka
faa1849f81
test/link/macho: test for correct handling of __mh_execute_header symbol
2024-01-24 12:34:39 +01:00
Jakub Konka
49c11e0c34
test/link/macho: upgrade and migrate needed_library test
2024-01-24 12:34:39 +01:00
Jakub Konka
d93a0763d4
test/link/link: pass build options to elf and macho tests
2024-01-24 12:34:39 +01:00
Jakub Konka
041f7d69f0
test/link/macho: test segment boundary symbols
2024-01-24 12:34:39 +01:00
Jakub Konka
ffd7f7f642
test/link/macho: fix naming in entry-in-dylib test
2024-01-24 12:34:39 +01:00
Jakub Konka
6cdcf61a5c
test/link/macho: upgrade and migrate dead_strip test
2024-01-24 12:34:39 +01:00
Jakub Konka
aa50bca151
test/link/elf: make invalid input file test less janky
2024-01-24 12:34:39 +01:00
Jakub Konka
56303d770e
macho: fix invalid generation of FDE records
2024-01-24 12:34:39 +01:00
Jakub Konka
11524e4d0c
test/link/macho: migrate entry_in_dylib test to new test format
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
ee68f35bfe
macho: fix section boundary symbols test
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
Jakub Konka
40e1bb11f8
macho: set dylib ordinals after pruning
2024-01-24 12:34:39 +01:00
Jakub Konka
eca9bc4c33
macho: dead strip dylibs
2024-01-24 12:34:39 +01:00
Jakub Konka
b28ff75f5d
macho: mark imports and exports
2024-01-24 12:34:39 +01:00
Jakub Konka
b0327ff233
macho: handle dead stripping of atoms
2024-01-24 12:34:39 +01:00
Jakub Konka
21e3bb38af
macho: claim unresolved symbols
2024-01-24 12:34:39 +01:00
Jakub Konka
1b76779857
macho: convert tentative defs and create objc sections
2024-01-24 12:34:39 +01:00
Jakub Konka
6b617afe2a
macho: resolve synthetic symbols
2024-01-24 12:34:39 +01:00
Jakub Konka
8a1311733b
macho: resolve symbols and mark files live
2024-01-24 12:34:39 +01:00
Jakub Konka
b8f67d7985
macho: init InternalObject and add forced undefined globals
2024-01-24 12:34:39 +01:00
Jakub Konka
8c7a34ae68
macho: prep for dylib deps (no resolution yet)
2024-01-24 12:34:39 +01:00
Jakub Konka
c023b762cd
macho: parse tbds
2024-01-24 12:34:38 +01:00
Jakub Konka
d153bc2f0c
macho: parse dylibs
2024-01-24 12:34:38 +01:00
Jakub Konka
c5e509595a
macho: parse archives
2024-01-24 12:34:38 +01:00
Jakub Konka
d05e9c3792
macho: create scaffolding for parsing different input objects
2024-01-24 12:34:38 +01:00
Jakub Konka
0c171afab0
macho: parse an input object file!
2024-01-24 12:34:38 +01:00
Jakub Konka
7588eeccea
macho: re-enable --verbose-link
2024-01-24 12:34:38 +01:00
Jakub Konka
dd0addab1f
macho: get the ball rolling!
2024-01-24 12:34:38 +01:00
Jakub Konka
2f94dc939e
macho: copy over new implementation sources from zld
2024-01-24 12:34:38 +01:00
Andrew Kelley
92211135f1
Merge pull request #17155 from winterqt/ignore-nix-ldflags-linkage-directives
...
std.zig.system.NativePaths: ignore linkage directives in `NIX_LDFLAGS`
2024-01-24 00:01:23 -08:00
Andrew Kelley
9d5a133f18
Revert "Don't assume a write if an operand is not in function parameters"
...
This reverts commit 2ab78937dd29fbc299ac434f962a5ff41002cc43.
Premature merge - apologies for the disruption.
Reopens #15685
Reopens #17580
2024-01-23 20:24:58 -07:00
Rahul Prabhu
2ab78937dd
Don't assume a write if an operand is not in function parameters
...
Liveness assumes that if the operand is not in the parameters of
a function call it is being written to, resulting in pointless memcpies.
2024-01-23 18:32:34 -08:00
Krzysztof Wolicki
eff58d6c18
os.windows: Fix error 258 name in Win32Error
2024-01-23 18:06:23 -08:00
Andrew Kelley
f37513aa68
NativePaths: support -L and -l arguments in NIX_LDFLAGS
...
A slightly more robust parsing of these flags in case of a separate
argument appearing after "-L" in the flags.
2024-01-23 18:01:59 -07:00
Winter
6f3ee587ba
std.zig.system.NativePaths: ignore linkage directives in NIX_LDFLAGS
...
`NIX_LDFLAGS` typically contains just `-rpath` and `-L`, which we already
handle. However, at least one setup hook in Nixpkgs [0] adds a linkage
directive to it. To prevent library paths from being missed (as I've
observed myself with `NIX_LDFLAGS` being `-liconv ...`, making it so that
*all* paths are missed), let's just skip over them.
[0]: 08f615eb1b/pkgs/development/libraries/libiconv/setup-hook.sh
2024-01-23 17:49:25 -07:00
Khang Nguyen Duy
993a83081a
std.fmt: fix unecessary deref on user-defined format function
...
When formatting a pointer to user type, currently it needs to be
dereferenced first, then call `formatType` on the child type.
Fix the problem by checking for "format" function on not only the type
itself, but also the struct it points to. Add hasMethod to std.meta.
2024-01-23 01:03:45 -08:00
Andrew Kelley
aef1da1634
Sema: use Sema.typeAbiSize rather than Type.abiSize
...
This resolves the type instead of asserting that the type is resolved,
fixing a crash.
2024-01-23 00:56:52 -08:00
Tristan Ross
c0e0bb385c
std.process: return u64 in totalSystemMemory
2024-01-23 00:17:53 -08:00
jacwil
68ea1121fc
objcopy ofmt=hex iterates through segments instead of sections
2024-01-22 21:29:21 -08:00
Veikka Tuominen
eeec34ccb6
Sema: implement comptime error return traces
2024-01-22 18:08:56 -08:00