Commit Graph

31432 Commits

Author SHA1 Message Date
Andrew Kelley
c86a334d43 link.Elf.Object.initAtoms: reduce state access and indirection
The initAtoms function now only uses the `elf_file` parameter for
reporting linker error messages, making it easier to see that the
function has no data dependencies other than the Object struct itself,
making it easier to parallelize or otherwise move that logic around.

Also removed an indirect call via `addExtra` since we already know the
atom's file is the current Object instance. All calls to `Atom.addExtra`
should be audited for similar reasons.

Also removed unjustified use of `inline fn`.
2024-10-09 15:40:59 -07:00
Andrew Kelley
10cb578e4e
Merge pull request #21640 from jacobly0/dwarf-progress
Dwarf: progress
2024-10-09 14:09:18 -07:00
Jakub Konka
33401ff3bb test/link/macho: test reporting undefined special symbols 2024-10-09 21:39:45 +02:00
Jakub Konka
d43b0cb31f macho: fix a typo in InternalObject.addObjcMethnameSection 2024-10-09 21:39:45 +02:00
Jakub Konka
90aa68cbfc macho: report special symbols if undefined
Special symbols include explictly force undefined symbols passed via -u
flag, missing entry point symbol, missing 'dyld_stub_binder' symbol, or
missing '_objc_msgsend' symbol.
2024-10-09 21:39:44 +02:00
Jakub Konka
73c3b9b8ab elf: revert growing atoms in Dwarf.resize for standard alloc 2024-10-09 12:38:53 -07:00
Jakub Konka
e9d819a29e elf: clean up how we create un-allocated sections 2024-10-09 12:38:53 -07:00
Jakub Konka
e448fb9601 elf: change how we manage debug atoms in Dwarf linker 2024-10-09 12:38:53 -07:00
Jakub Konka
c92c72d08c elf: do not create atoms for section symbols that do not require it 2024-10-09 12:38:53 -07:00
Jakub Konka
ef7bac4aa5 elf: move setting section size back to Elf.growSection 2024-10-09 12:38:53 -07:00
Jakub Konka
3d315f45d8 elf: drastically simplify extracting section size logic 2024-10-09 12:38:53 -07:00
Jakub Konka
0e5cd112ef elf: clear dynamic relocs before resolving relocs in atoms
When resolving and writing atoms to file, we may add dynamic relocs
to the output buffer so clear the buffers before that happens.
2024-10-09 12:38:53 -07:00
Jakub Konka
cf2e462d91 elf: add some extra logging for created dynamic relocs 2024-10-09 12:38:48 -07:00
Jakub Konka
133aa709b0 elf: do not panic if we already have create a PLT entry for a symbol 2024-10-09 12:38:11 -07:00
Jakub Konka
906cf48e14 elf: fix creation of synthetic sections 2024-10-09 12:38:11 -07:00
Jakub Konka
887f9a29f3 elf: combine growAllocSection and growNonAllocSection into growSection 2024-10-09 12:38:11 -07:00
Jakub Konka
0aa24ac2e3 elf: move sections in segments that need moving only 2024-10-09 12:38:11 -07:00
Jakub Konka
9a15c3e1a1 elf: mark objects as dirty/not-dirty
This way we can track if we need to redo the object parsing or not.
2024-10-09 12:38:09 -07:00
Jakub Konka
4604577ae1 elf: use arena for incremental cache 2024-10-09 12:31:04 -07:00
Jakub Konka
bd5fc899db elf: do not re-allocate AtomLists unless dirtied 2024-10-09 12:27:30 -07:00
Jakub Konka
bae3dbffdf elf: clear dynamic relocs before repopulating 2024-10-09 12:27:30 -07:00
Jakub Konka
bc7e0342b5 elf: do not re-populate synthetic sections when updating 2024-10-09 12:27:30 -07:00
Jakub Konka
7fead5d6dd elf: track atoms within AtomList with array hash map 2024-10-09 12:27:30 -07:00
Jacob Young
d748cfc2b7 x86_64: print pseudo instructions in wip_mir log 2024-10-09 07:48:10 -04:00
Jacob Young
c127c06fd7 Dwarf: implement and test lexical blocks 2024-10-09 07:48:09 -04:00
Jacob Young
d354daf143 lldb: disable pretty printers on self-hosted backends 2024-10-09 07:48:09 -04:00
Jacob Young
65f6623ba4 lldb: print field names with a leading dot
This more closely resembles zig struct literals.
2024-10-09 07:48:07 -04:00
Andrew Kelley
ce5a5c361b
Merge pull request #21633 from ziglang/reduce-flush-logic
link.Elf: reduce flush logic
2024-10-09 01:43:57 -07:00
Andrew Kelley
22661f3d67 link tests: add a way to check prefix and use it 2024-10-08 21:57:08 -07:00
Andrew Kelley
31d70cb1e1 link.Elf: avoid needless file system reads in flush()
flush() must not do anything more than necessary. Determining the type
of input files must be done only once, before flush. Fortunately, we
don't even need any file system accesses to do this since that
information is statically known in most cases, and in the rest of the
cases can be determined by file extension alone.

This commit also updates the nearby code to conform to the convention
for error handling where there is exactly one error code to represent
the fact that error messages have already been emitted. This had the
side effect of improving the error message for a linker script parse
error.

"positionals" is not a linker concept; it is a command line interface
concept. Zig's linker implementation should not mention "positionals".
This commit deletes that array list in favor of directly making function
calls, eliminating that heap allocation during flush().
2024-10-08 18:02:59 -07:00
Andrew Kelley
2c41c453b6 link.Elf: avoid converting rpath data in flush()
The goal is to minimize as much as possible how much logic is inside
flush(). So let's start by moving out obvious stuff. This data can be
preformatted before flush().
2024-10-08 18:02:59 -07:00
Parzival-3141
e1e151df0d untangle skip conditions 2024-10-08 23:34:20 +02:00
Parzival-3141
7dc0014769 revert disabling aarch64 skip
I was too optimistic in disabling the aarch64 skip, assuming it was also
caused by ConEmu. Unfortunately I don't have access to a machine for testing.
2024-10-08 23:34:20 +02:00
Parzival-3141
f522fb9ca3 fix standalone/empty_env test
The problem seems to be ConEmu setting environment variables before
executing the test process. The test passes when run in Windows CMD.
2024-10-08 23:34:20 +02:00
Pavel Verigo
4b89a4c7cb stage2-wasm: airRem + airMod for floats 2024-10-08 20:58:15 +02:00
Alex Rønne Petersen
b00cbecfd3
Merge pull request #21622 from mikdusan/bsd
bsd: revive freebsd and dragonfly
2024-10-08 18:32:02 +02:00
Michael Dusan
e535e65eb3
freebsd posix: add SystemOutdated to MemFdCreateError 2024-10-07 13:19:33 -04:00
Michael Dusan
be91b68e66
dragonfly std: more std.c support 2024-10-07 13:19:33 -04:00
Matthew Lugg
ea527f7a85
Merge pull request #21618 from mlugg/validate-runtime-value
Sema: add a few missing runtime value validations
2024-10-07 13:46:21 +01:00
mlugg
95857d6b21
Sema: add missing runtime value validation to global mutable variables
Resolves: #20365
2024-10-07 07:42:17 +01:00
mlugg
36243567e6
Sema: add missing runtime value validation to @memcpy and @memset 2024-10-07 07:27:50 +01:00
Alex Rønne Petersen
7a2fde973d link.Elf: Fix page size calculation for more architectures.
Sourced from binutils/bfd.
2024-10-07 07:04:05 +02:00
Alex Rønne Petersen
20e03beaef
Merge pull request #21611 from alexrp/target-abi-default
`std.Target`: Rewrite `Abi.default()` to have better defaults across the board.
2024-10-07 06:14:10 +02:00
Alex Rønne Petersen
cc79cc9f55
Merge pull request #21615 from linusg/panic-uefi
std.debug: Fix defaultPanic() uefi build
2024-10-07 03:38:41 +02:00
Alex Rønne Petersen
aa8f39e271
Merge pull request #21614 from alexrp/target-avr-align
`std.Target`: Fix `cTypePreferredAlignment()` to always return 1 for avr.
2024-10-07 01:56:42 +02:00
Alex Rønne Petersen
790fc8cd98
Merge pull request #21499 from alexrp/loongarch-gnusf
Add `loongarch64-linux-gnusf` target support
2024-10-07 01:24:00 +02:00
Alex Rønne Petersen
221bd829bc
std.Target: Rewrite Abi.default() to have better defaults across the board. 2024-10-06 23:28:21 +02:00
Alex Rønne Petersen
b6b86cb878
test: Fix powerpc-aix-eabihf target triple in llvm_targets. 2024-10-06 22:41:53 +02:00
Andrew Kelley
d5c9d85295
Merge pull request #21597 from achan1989/issue_14324
Create/open file on WASI targets should have POLL_FD_READWRITE rights
2024-10-06 13:02:51 -07:00
InKryption
3284d1ffb1 Build: Add option(LazyPath, ...) support
Also adds support for `[]const LazyPath` in a similar vein, and
refactors a few other bits of code.
2024-10-06 12:39:35 -07:00