Andrew Kelley
3fc6fc6812
std.builtin.Endian: make the tags lower case
...
Let's take this breaking change opportunity to fix the style of this
enum.
2023-10-31 21:37:35 -04:00
Jacob Young
d890e81761
mem: fix ub in writeInt
...
Use inline to vastly simplify the exposed API. This allows a
comptime-known endian parameter to be propogated, making extra functions
for a specific endianness completely unnecessary.
2023-10-31 21:37:35 -04:00
Jakub Konka
ea95c74948
elf: encapsulate ZigObject-specific logic in flushModule hook
2023-10-30 20:36:34 +01:00
Jakub Konka
b1a735ac65
elf: put init logic of ZigObject in init function
2023-10-30 19:44:27 +01:00
Jakub Konka
9bdbb6312f
elf: move incremental codegen bits into ZigObject.zig
2023-10-30 19:09:13 +01:00
Jakub Konka
b2e847a41a
elf: rename ZigModule to ZigObject
2023-10-30 19:09:13 +01:00
Jakub Konka
a6a10d9c2b
x86_64: do not hardcode memory passed by Elf linker
2023-10-28 03:48:18 -04:00
Jakub Konka
8087ec8e8c
elf: improve parsing of ld scripts and actually test linking against them
2023-10-24 19:03:00 +02:00
Jakub Konka
6dc45e7d31
Merge pull request #17621 from ziglang/elf-pic-pie
...
elf: actually check for dynamic executables
2023-10-20 22:33:44 +02:00
Jakub Konka
3768c95371
elf: actually check for dynamic executables
2023-10-19 15:57:58 +02:00
Jakub Konka
1448d6b77c
elf: store shndx to Zig module atoms out-of-band
...
This allows us to increase the effective resolution of `st_shndx`
from `u8` to `u32`.
2023-10-18 18:33:35 +02:00
Jakub Konka
9ced0ecbbd
elf: increase resolution of Atom.input_section_index to u32
2023-10-18 17:29:19 +02:00
Jakub Konka
27d7ac88a3
elf: increase resolution of Atom.relocs_section_index to u32
2023-10-18 17:25:28 +02:00
Jakub Konka
52e0ca1312
elf: parse GNU ld script as system lib indirection
2023-10-18 13:54:43 +02:00
Jakub Konka
d2727b808c
elf: fix 32bit build
2023-10-16 19:56:47 +02:00
Jakub Konka
e89155b565
elf: refactor logs
2023-10-16 19:33:06 +02:00
Jakub Konka
7b2cbcf0fe
codegen+elf: check if extern is a variable ref
2023-10-16 19:33:06 +02:00
Jakub Konka
c71a79f618
elf: make .zig.rodata writeable
2023-10-16 19:33:06 +02:00
Jakub Konka
17635e4f2a
x86_64: add -fPIC support targeting ELF
2023-10-16 19:33:06 +02:00
Jakub Konka
b3d98a4b88
elf: emit dynamic base relocs for .zig.got entries when required
2023-10-16 19:33:06 +02:00
Jakub Konka
85d451f96c
elf: re-enable self-hosted backends
2023-10-16 19:33:05 +02:00
Jakub Konka
7be983ac92
elf: create new synthetic section ZigGotSection
2023-10-16 19:33:05 +02:00
Jakub Konka
0b37a9c78d
elf: fix GotSection.write in presence of TLSLD symbol
2023-10-16 19:33:05 +02:00
Jakub Konka
1efc0519ce
elf: make init/fini sorting deterministic
2023-10-16 19:33:05 +02:00
Jakub Konka
1772dbb503
elf: fix generating .plt.got indirection
2023-10-16 19:33:05 +02:00
Jakub Konka
a748ca3725
elf: populate symtab with symbols coming from DSOs
2023-10-16 19:33:05 +02:00
Jakub Konka
def7190e84
elf: hook up common symbols handler
2023-10-16 19:33:04 +02:00
Jakub Konka
4af5caa81f
elf: add missing generators for special dynamic sections
2023-10-16 19:33:04 +02:00
Jakub Konka
5fa90afb64
elf: fix synthetic section handling and actually parse DSOs
2023-10-16 19:33:04 +02:00
Jakub Konka
d1446565a1
elf: re-enable dynamic linking codepaths
2023-10-16 19:33:04 +02:00
Jakub Konka
04a8f217c6
elf: fix COMDAT deduping logic
2023-10-16 19:33:04 +02:00
Jakub Konka
9a80ac0429
elf: add garbage collection of sections
2023-10-16 19:33:04 +02:00
Jakub Konka
d6cec5a586
elf: add more prepwork for linking c++ objects
2023-10-16 19:33:04 +02:00
Jakub Konka
2c2bc66ce1
elf: handle .eh_frame and non-alloc sections
2023-10-16 19:33:04 +02:00
Jakub Konka
9ccd94d560
elf: refactor object.shdrContents to never error out
2023-10-16 19:33:04 +02:00
Jakub Konka
53340544c6
elf: get hello-world with LLVM in Zig working
2023-10-16 19:33:04 +02:00
Jakub Konka
1b70ad622b
elf: port zld's allocation mechanism
2023-10-16 19:33:04 +02:00
Jakub Konka
860beda55f
elf: remove dirty from synthetic .got section
2023-10-16 19:33:04 +02:00
Jakub Konka
6faed6269f
elf: update section sizes accumulated from objects
2023-10-16 19:33:04 +02:00
Jakub Konka
679accd887
elf: initialize output sections from input objects in a separate step
2023-10-16 19:33:04 +02:00
Jakub Konka
75f4420c2d
elf: increase Atom.Index resolution to u32
2023-10-16 19:33:04 +02:00
Jakub Konka
605e3eb08c
elf: clean up generating GOT symbol names
2023-10-16 19:33:03 +02:00
Jakub Konka
43406c0696
elf: update .strtab with GOT symbols
2023-10-16 19:33:03 +02:00
Jakub Konka
af40bce08a
x86_64: emit R_X86_64_GOT32 for non-PIC GOT references
2023-10-01 21:09:35 +02:00
Jakub Konka
5381bfd348
elf: fix setting st_value of _end synthetic symbol
2023-09-29 22:18:38 +02:00
Jakub Konka
04a7051c4b
elf: fix 32bit build
2023-09-28 21:42:09 +02:00
Jakub Konka
89c2151a97
elf: move logic for extracing atom's code into input files
2023-09-28 18:35:26 +02:00
Jakub Konka
785bd270ed
elf: correctly allocate TLS segment
2023-09-28 14:59:09 +02:00
Jakub Konka
af00ac53b5
elf: report fatal linker error for unhandled relocation types
2023-09-28 14:06:12 +02:00
Jakub Konka
1200a5a240
elf: allow expanding segments in virtual memory
2023-09-27 09:59:59 +02:00