Jakub Konka
73f385eec5
Update src/arch/x86_64/CodeGen.zig
...
Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com>
2024-08-16 11:49:23 +02:00
Jacob Young
624016e8f3
riscv64: fix incorrect branch target
2024-08-16 05:44:55 -04:00
Jakub Konka
9473d76449
test/elf: enhance testImportingDataDynamic
2024-08-15 21:47:34 +02:00
Jakub Konka
4d5bf0f09a
x86_64: deref GOT pointer when requesting var value
2024-08-15 14:23:36 +02:00
Jakub Konka
79418fa0ab
riscv: remove redundant by-symbol-name check; just check for PIC and extern ptr
2024-08-15 10:52:06 +02:00
Jakub Konka
c79290467f
elf: fix GOT32 reloc resolution logic
2024-08-15 10:36:37 +02:00
Jakub Konka
f0df0acd70
x86_64: fix handling on externs in lower/emit
2024-08-15 10:33:30 +02:00
Jakub Konka
0fd0b11bc4
riscv: do not emit GOT relocations for special linker symbols
2024-08-15 10:21:20 +02:00
Jakub Konka
8a0cb7002e
elf: introduce Symbol.flags.is_extern_ptr for refs potentially needing GOT
2024-08-15 10:05:41 +02:00
David Rubin
2e8351cc9e
elf: fix up riscv for .got.zig rewrite
2024-08-15 08:53:41 +02:00
Jakub Konka
c9db887800
builtin: init test_functions to empty slice to avoid coercing to undefined
2024-08-15 08:38:08 +02:00
Jakub Konka
b8203fac1b
elf: check for relocs before deciding on shndx in getNavShdrIndex
2024-08-15 08:37:13 +02:00
Jakub Konka
f26573fddf
elf: re-use old atom slot for a trampoline to that atom
...
This is the initial implementation of Jacob Young's idea of
re-using old function slots as trampolines for new function's
location. This way the trampoline is guaranteed to be aligned
to the function's alignment.
The only edge case is if an incremental update further overaligns
the function in which case we skip/delete the trampoline and
re-evaluate all references.
2024-08-14 12:10:40 +02:00
Jakub Konka
1bd54a55fa
fix compile errors in other codegen backends
2024-08-13 21:52:40 +02:00
Jakub Konka
97ab420dcf
elf: do not emit zig jump table in relocatables
2024-08-13 13:30:24 +02:00
Jakub Konka
49d78cc793
elf: only apply zig jump table indirection to function calls (PLT32)
2024-08-13 13:30:24 +02:00
Jakub Konka
9daf5e81c4
elf: commit non-indirected symbol address to symtab
2024-08-13 13:30:24 +02:00
Jakub Konka
df80ccf760
elf: pretty print alingment when pretty printing atoms
2024-08-13 13:30:24 +02:00
Jakub Konka
39ee346681
elf: make .text.zig bigger now that jump table is part of it
2024-08-13 13:30:24 +02:00
Jakub Konka
afaec5c3e4
x86_64: fix generating lazy symbol refs
2024-08-13 13:30:24 +02:00
Jakub Konka
edd72c75eb
elf: fix circular dep loop in zig jump table
2024-08-13 13:30:24 +02:00
Jakub Konka
57f7209508
elf: replace use of linker_extern_fn with more generic Immediate.reloc
2024-08-13 13:30:24 +02:00
Jakub Konka
ce8886d57d
elf: make zig jump table indirection implicit via Symbol.address
2024-08-13 13:30:24 +02:00
Jakub Konka
d25c93a868
x86_64: emit call rel32 for near calls with linker reloc
2024-08-13 13:30:24 +02:00
Jakub Konka
ffcf0478fe
x86_64: remove handling of .call since it's unused for now
2024-08-13 13:30:24 +02:00
Jakub Konka
78b1c73602
elf: rename OffsetTable to JumpTable
2024-08-13 13:30:24 +02:00
Jakub Konka
e1ce9a7065
elf: add poorman's reporting tool for unallocated NAVs/UAVs
2024-08-13 13:30:24 +02:00
Jakub Konka
e3f6ebaea9
x86_64+elf: fix jump table indirection for functions
2024-08-13 13:30:24 +02:00
Jakub Konka
16abf51cee
x86_64: handle lea_symbol returned by genNavRef
2024-08-13 13:30:24 +02:00
Jakub Konka
f968dd0cb1
comp: actually report codegen errors
2024-08-13 13:30:24 +02:00
Jakub Konka
5fd53dc36f
x86_64: start converting away from .got.zig knowledge
2024-08-13 13:30:24 +02:00
Jakub Konka
d7c5fbce92
elf: emit a jump table in place of offset table for functions
2024-08-13 13:30:24 +02:00
Jakub Konka
d328140858
elf: nuke ZigGotSection from existence
2024-08-13 13:30:24 +02:00
Jakub Konka
4c2b34e8ab
elf: relax R_X86_64_32 into jump table indirection if zig_offset_table set
2024-08-13 13:30:24 +02:00
Jakub Konka
7556b32840
elf: indirect via offset table in the linker away from backend
2024-08-13 13:30:24 +02:00
Jakub Konka
97a65ea0d5
elf: dirty offset table entry on moving Atom in off/addr space
2024-08-13 13:30:24 +02:00
Jakub Konka
24b915c9f2
elf: write offset table entry if dirty
2024-08-13 13:30:24 +02:00
Jakub Konka
67e703dc71
elf: allocate new offset table via Atom.allocate mechanism
2024-08-13 13:30:23 +02:00
Jakub Konka
27e1e63671
elf: introduce OffsetTable in ZigObject for funcs only
2024-08-13 13:30:23 +02:00
Alex Rønne Petersen
eadc0c01cc
test: Re-enable armv8-linux-gnueabihf tests.
...
Closes #3287 .
2024-08-13 00:57:49 -07:00
Alex Rønne Petersen
e725d1e226
std.Thread: Fix freeAndExit() syscall numbers for mips64.
...
These just seem to have been copy/pasted from mips32.
2024-08-13 00:56:35 -07:00
Alex Rønne Petersen
d0ae803a77
std.Thread: Fix freeAndExit() assembly for powerpc.
...
Wrong source/destination register order.
2024-08-13 00:56:14 -07:00
Alex Rønne Petersen
b00f586c3d
std.os.linux: Add clone() implementation for mips64. (#21038 )
...
Only for n64; no handling for n32 yet.
Also remove pointless comment about o32 in mips64 code.
2024-08-12 16:09:52 -07:00
Alex Rønne Petersen
d6f9972594
all: Handle spirv in addition to spirv(32,64) where applicable.
...
Some of this is arbitrary since spirv (as opposed to spirv32/spirv64) refers to
the version with logical memory layout, i.e. no 'real' pointers. This change at
least matches what clang does.
2024-08-12 16:08:28 -07:00
Alex Rønne Petersen
6d23850108
std.Thread: Explain apparently pointless mips instruction in freeAndExit().
...
https://git.musl-libc.org/cgit/musl/commit/?id=ce3688eca920aa77549323f84e21f33522397115
2024-08-12 16:07:46 -07:00
Andrew Kelley
f988cea825
Merge pull request #21019 from alexrp/target-os-cleanup
...
`std.Target`: Remove `minix` and `liteos`, rename `glsl450` to `opengl`, and some minor housekeeping
2024-08-12 16:06:57 -07:00
Alex Rønne Petersen
82b0f44721
llvm: Disable lowering to f16 on s390x.
...
https://github.com/llvm/llvm-project/issues/50374
2024-08-12 16:01:59 -07:00
Alex Rønne Petersen
a1a823f69c
llvm: Disable lowering to f128 on sparc32.
...
efc6b50d2d/llvm/lib/Target/Sparc/SparcISelLowering.cpp (L561-L562)
2024-08-12 16:01:34 -07:00
Alex Rønne Petersen
87ec4e11c9
compiler-rt: Fix the leoncasa CPU feature check for sparc32.
2024-08-12 14:36:21 -07:00
Alex Rønne Petersen
f7fb261efd
std.os.linux.tls: Support sparc32.
2024-08-12 14:22:24 -07:00