Jacob Young
2eeb735822
Dwarf: improve x86_64 backend debug info
...
Closes #17811
2023-11-12 03:21:52 -05:00
Andrew Kelley
53f74d6a04
move libssp into libcompiler_rt
...
closes #7265
2023-11-10 13:12:10 -07:00
Jakub Konka
197fd41e27
macho: check for null Module before creating llvm_object
2023-11-10 13:43:43 +01:00
Jakub Konka
0f2489d8fc
macho: resolve special section/segment boundary symbols
...
Boundary symbols have a special name prefix:
* section$start$segname$sectname
* section$stop$segname$sectname
* segment$start$segname
* segment$stop$segname
and will resolve to either start or end of the respective
section/segment if found.
If not found, we return an error stating we couldn't find the
requested section/segment rather than silently failing and resolving
the address to 0 which seems to be the case with Apple's ld64.
2023-11-10 12:52:56 +01:00
Jakub Konka
c550eb3e8a
Merge pull request #17933 from ziglang/elf-r-mode
...
elf: the dreaded `-r` mode
2023-11-10 07:57:52 +01:00
Jakub Konka
08882234d1
elf: fix overflowing designated capacity when writing COMDAT groups
2023-11-09 23:16:41 +01:00
Jakub Konka
6e797d8648
elf: add SHF_INFO_LINK flag to any emitted SHT_RELA section
2023-11-09 19:41:50 +01:00
Jakub Konka
27970bab07
elf: format shdr flags when dumping state
2023-11-09 18:49:19 +01:00
Jakub Konka
03c3a85ea3
elf: write out COMDAT groups to file
2023-11-09 18:29:58 +01:00
Jakub Konka
acd7cbf0b5
elf: init output COMDAT group sections
2023-11-09 17:41:14 +01:00
Jakub Konka
031d9faf02
elf: separate logic for reseting shdr indexes into a separate fn
2023-11-09 15:05:29 +01:00
Jakub Konka
1f8dd27e40
elf: correctly format output .eh_frame when emitting relocatable
2023-11-09 14:46:28 +01:00
Jakub Konka
b1fcf0ed8f
elf: emit .rela.eh_frame section contents
2023-11-09 12:24:49 +01:00
Jakub Konka
0efc471122
elf: calculate required size for .rela.eh_frame
2023-11-09 12:02:20 +01:00
Jakub Konka
666ac6bf9b
elf: track .rela.eh_frame section and emit .eh_frame section symbol
2023-11-09 11:49:32 +01:00
Jakub Konka
0de5dd2ef1
elf: misc fixes
2023-11-09 10:32:39 +01:00
Luuk de Gram
2ac0ba03a6
wasm-linker: ensure symbol fields are set for decls
...
Previously the symbol tag field would remain `undefined` until it
was set during `flush`. However, the symbol's tag would be observed
earlier than where it was being set. We now set it to the explicit
tag `undefined` so this can be caught during debug. The symbol tag of
a decl will now also be set right after `updateDecl` and `updateFunc`.
Likewise, we now also set the `name` field during atom creation for
decls, as well as set the other fields to the max(u32) to ensure we
get a compiler crash during debug to ensure any misses will be caught.
2023-11-09 00:00:17 +01:00
Jakub Konka
0299ed5036
elf: fix 32bit build
2023-11-08 18:45:43 +01:00
Jakub Konka
29d7727254
elf: emit SHN_COMMON symbols in -r mode
2023-11-08 18:15:41 +01:00
Jakub Konka
0b4d398c40
elf: streamline codepaths for different linker modes (object, ar, exe/dyn)
2023-11-08 17:35:56 +01:00
Jakub Konka
a16e6706b3
elf: LLVM emits relocs to undef local symbols - color me surprised!
2023-11-08 15:10:28 +01:00
Jacob Young
6c15c34421
MachO: support -fsingle-threaded mode
2023-11-08 08:40:10 -05:00
Jakub Konka
d8b1ef9430
elf: adjust r_addend with offset of the original input section ref'd via STT_SECTION
2023-11-08 12:11:55 +01:00
Jakub Konka
ae08f9bfe9
elf: claim unresolved dangling symbols as undef externs in -r mode
2023-11-08 11:51:11 +01:00
Jakub Konka
e87c751558
elf: reference .rela sections via output section index
2023-11-08 10:57:34 +01:00
Jakub Konka
5e78600f0f
elf: actually track output symtab index of symbols
2023-11-07 23:18:41 +01:00
Jakub Konka
ecf6ed7d9b
elf: allocate alloc sections when emitting relocatable
2023-11-07 15:04:57 +01:00
Jakub Konka
31b280c78f
elf: emit .rela.eh_frame section header if required
2023-11-07 14:47:11 +01:00
Jakub Konka
0211d6bf4f
elf: create link between .rela and output section
2023-11-07 14:42:27 +01:00
Jakub Konka
e22b3595c1
elf: update .rela section sizes
2023-11-07 14:29:44 +01:00
Jakub Konka
c7ed7c4690
elf: generate section symbols when writing symtab
2023-11-07 13:31:31 +01:00
Jakub Konka
3df53d1722
elf: create skeleton of required changes for supporting -r mode
2023-11-07 11:19:55 +01:00
Jakub Konka
bf0387b6bb
Merge pull request #17873 from ziglang/elf-archive
...
elf: implement archiving input object files
2023-11-07 03:22:14 +01:00
Jakub Konka
261db02018
CheckObject: support parsing and dumping archive symtab for ELF
2023-11-06 21:18:26 +01:00
Jakub Konka
1b69b0c621
elf: clearly separate updating and writing symtab from only ZigObject
2023-11-06 14:26:35 +01:00
Jakub Konka
281dabaa88
Compilation: unconditionally close open file handles for writable dance
2023-11-06 13:47:39 +01:00
Andrew Kelley
1b0b46a8a9
Merge pull request #17871 from jacobly0/x86_64
...
x86_64: get a compiler compiled with the x86_64 backend passing x86_64 backend tests
2023-11-05 18:45:21 -05:00
Andrew Kelley
702b809ea3
Merge pull request #17815 from Luukdegram/wasm-no-entry
...
wasm-linker: implement `-fno-entry` and correctly pass `--shared` and `--pie` when given
2023-11-05 18:44:12 -05:00
Jacob Young
c2cda947c9
src: fix memory leaks
2023-11-05 11:54:29 -05:00
Jakub Konka
8142925c7e
elf: hook up saving object files in an archive
2023-11-05 13:37:13 +01:00
Jakub Konka
55fa8a04f1
elf: add hooks for archiving Objects
2023-11-05 12:56:17 +01:00
Jakub Konka
5c48236103
elf: init objects after parsing them
2023-11-05 12:37:15 +01:00
Jakub Konka
8d7ec05070
elf: actually save correct object names in the archive
2023-11-05 12:08:15 +01:00
Jakub Konka
f24ceec35a
Merge pull request #17844 from ziglang/elf-object
...
elf: handle emitting relocatables and static libraries - humble beginnings
2023-11-04 20:58:15 +01:00
Jakub Konka
533c88158e
elf: actually capture positionals when linking static library
2023-11-04 09:14:15 +01:00
Jakub Konka
bd0416aeb6
elf: flag errors on hitting unimplemented codepaths
2023-11-04 09:14:05 +01:00
Jakub Konka
9cf3ebe524
elf: fix more int resolution issues
2023-11-04 09:13:50 +01:00
Jakub Konka
56296694d9
elf: fix 32bit build
2023-11-04 09:13:43 +01:00
Jakub Konka
e3b82eaa66
elf: do not store filename in strtab unless longer than 15 chars
2023-11-04 09:13:26 +01:00
Jakub Konka
acd700ac6b
elf: store ar state per input object file
2023-11-04 09:13:18 +01:00