| Age | Commit message (Collapse) | Author |
|
Structs were previously using `SegmentedList` to be given indexes, but
were not actually backed by the InternPool arrays.
After this, the only remaining uses of `SegmentedList` in the compiler
are `Module.Decl` and `Module.Namespace`. Once those last two are
migrated to become backed by InternPool arrays as well, we can introduce
state serialization via writing these arrays to disk all at once.
Unfortunately there are a lot of source code locations that touch the
struct type API, so this commit is still work-in-progress. Once I get it
compiling and passing the test suite, I can provide some interesting
data points such as how it affected the InternPool memory size and
performance comparison against master branch.
I also couldn't resist migrating over a bunch of alignment API over to
use the log2 Alignment type rather than a mismash of u32 and u64 byte
units with 0 meaning something implicitly different and special at every
location. Turns out you can do all the math you need directly on the
log2 representation of alignments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Write thunks separately from other atoms - this can still be improved
by not using atoms at all, but one thing at a time.
|
|
|
|
|
|
|
|
|
|
This is in particular very important to the Zig language which
allows exporting the same symbol under different names. For instance,
it is possible to have a case such that:
```
...
4258 T _foo
4258 T _bar
...
```
In this case we need to keep track of both symbol names when resolving
FDEs and unwind records.
|
|
This solves the nuance case of compiling hand-crafted assembly files
which do not feature `MH_SUBSECTIONS_VIA_SYMBOLS` flag resulting in
input `Atom`s encompassing multiple symbols each with unique unwind
information.
|
|
|
|
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:
* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
|
|
|
|
|
|
|
|
|
|
|
|
Previously, if we were looking for the very last symbol by address in some
section, and the next symbol happened to also have the same address value
but would reside in a different section, we would keep going finding the
wrong symbol in the wrong section.
This mechanism turns out vital for correct linking of Go binaries
where the runtime looks for specially crafted synthetic symbols
which mark the beginning and end of each section. In this case,
we had an unfortunate clash between the end of PC marked machine code
section (`_runtime.etext`) and beginning of read-only data (`_runtime.rodata`).
|
|
|
|
|
|
Parse and sort relocations by address descending.
|
|
|
|
Unlike Apple ld, we will not do any DWARF CFI parsing and simply
output DWARF type unwind records.
|
|
|
|
Correctly handle calculating encompassing atoms for local
relocations (`r_extern == 0`).
|
|
|
|
|
|
|
|
|
|
|
|
kubkon/zld gitrev 5733ed87abe2f07e1330c3232a252e9defec638a
|
|
|
|
|
|
|
|
|
|
|
|
For example, building stage2 requires an empty `empty.cc` source file
compiling which generates a valid translation unit with no symtab/strtab.
In this case, we cannot simply assume that every translation unit will
have a valid symtab; instead, we cautiously default the input symtab
and strtab fields to optional `null` to signal symtab's presence or its lack of.
In case the symtab is not present, we catch this fact when splitting
input sections into subsections and create a synthetic symbol per every
suitable section.
|
|
stage2+stage1: remove type parameter from bit builtins
|
|
|
|
|
|
* Added support for stroffsetsptr class in Dwarf stdlib
* Proper initializion of debug_str_offsets in DwarfInfo
* Added missing null initializer to DwarfInfo in Macho
* Added missing is_64 field to getAttrString in DwarfInfo
* Fixed formatting
* Added missing is_64 param to getAttrString
* Added required cast to usize
* Adding missing .debug_str_offsets initialization
* getAttrString now uses the str_offsets_base attr
|
|
Closes #12529
Closes #12511
Closes #6835
|
|
Also adds a new method to ArrayList: appendUnalignedSlice
|
|
This reverts commit 45c444ff18b43d30a7277e346174ba6eca4a6193.
|